CCLens CLI
Terminal manager for Claude Code sessions: live status per session, token cost by model and project, and summaries saved on exit.
- 124 ★ on the repository
- Last commit
Extended access
Why this level
- The SessionEnd hook sends session text to an external LLM API.
- Reads Claude Code session logs on disk.
Install
- Works in
Manual install
git clone https://github.com/wsw669/cclens.git && cd cclens && npm install && npm run build && npm startQuick start commands from the README joined into one line.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The SessionEnd hook sends session text to an external LLM API.
- Reads Claude Code session logs on disk.
This is third-party code. Review the repository files before installing.
What it does
CCLens opens one terminal list of Claude Code sessions. Each shows its state: idle, busy or waiting for your reply. Git worktree support covers parallel work on one project, and context from older sessions is copied into the new working copies. The cost dashboard streams through session logs, including files of hundreds of megabytes, and totals tokens by model, project and date. The built-in price table covers DeepSeek, GLM, Kimi, Qwen and Claude; custom values go into `~/.config/cclens/pricing.json`. A monthly budget highlights overruns. When a session exits, CCLens builds a structured summary in the background: title, what was done, key decisions, next step. Summaries are stored locally by project. The VS Code extension in the `vscode-ext` folder shows the same data.
Who it is for. People who run several Claude Code sessions at once and want token spend broken down by model and project.
Good fit when
- Several projects are open and it is unclear which session is waiting for you.
- At month end you need to see which model and project used up the token budget.
- One repository is edited in parallel across several git worktrees.
- After a session closes you want to return to its decisions and the planned next step.
Not a fit when
- You work with an agent other than Claude Code: the tool targets only that one.
- Session content cannot go to an external LLM API but summaries are required.
- A one-off cost report is enough and no interactive interface is needed.
Example request
Show how many tokens and how much money went to each model and project this month, and mark where the budget is exceeded.Limitations
Installation is from source only: clone, `npm install` and `npm run build`, with Node.js 20 or newer. The VS Code extension is also packaged by hand into a `.vsix` file. Summaries need a key for any OpenAI-compatible API in `CCLENS_LLM_API_KEY`; the default address points to DeepSeek, so session text goes to the chosen provider. Cost comes from a price table and stays an estimate, not a vendor invoice. The project was reworked from ccmanager: support for nine assistants was cut down to Claude Code alone. The README is written in Chinese.
How to disable. Quit the app and delete the cloned repository. If you added the SessionEnd hook, remove its block from `~/.claude/settings.json`; summaries and settings live in `~/.config/cclens/`.
FAQ
How do I turn on automatic summaries in Claude Code?
Set `CCLENS_LLM_API_KEY` and add a `SessionEnd` hook to `~/.claude/settings.json` that runs `scripts/summarize-session-end.mjs` from the clone. The summary appears when the session ends and is never created twice for the same session.
Where does data go when a summary is created?
Session content is sent to the API you configured. `CCLENS_LLM_BASE_URL` changes the address and `CCLENS_LLM_MODEL` sets the model.
How do I set prices for my own model?
Create `~/.config/cclens/pricing.json` with `input`, `output`, `cacheRead` and `cacheWrite` fields for that model.
How do I open the cost dashboard?
Choose Cost Dashboard in the main menu or press `$`.
What is needed to run it?
Node.js 20 or newer and an installed Claude Code. The app runs on Windows 10 and 11, macOS and Linux.
Discussion
No questions or reviews yet.
Related
CLI toolscc-lens
Claude Code Lens (cc-lens)
Local Claude Code analytics: a dashboard of sessions, tokens, cost and projects from your ~/.claude data, no cloud
claudetop shows session cost, cache hit rate, plan limit windows and overspend alerts in the Claude Code status line
A Claude Code plugin: a status line with context, 5-hour and 7-day limits, cost and usage of Codex, Gemini and z.ai
A statusline for Claude Code: token and cost usage, context left, rate limits and git branch in four styles and six themes
Token and cost reports for Claude Code, Codex, Gemini CLI and other agents from local logs, by day, month and session
A real-time terminal monitor for Claude Code usage: tokens, messages and cost in the five-hour window, with forecasts and export
Comparison with similar tools
Cards that share the main search query, and how they differ.
README in short
The repository describes three parts: a session manager, a cost dashboard and summaries. All run in the terminal, and the VS Code extension repeats the dashboard and the summary list inside the editor. The project grew out of ccmanager with cost tracking added.