cc-lens
Claude Code Lens (cc-lens)
Local Claude Code analytics: a dashboard of sessions, tokens, cost and projects from your ~/.claude data, no cloud
Medium risk
We rate an entry medium when the tool runs code, makes network calls or reads project files. Check what exactly it does before installing.
Why this level
- Reads local data and session conversations from the Claude Code directory
- Starts a local web server that a flag can expose to the whole network
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/claude-code-lens-cc-lensDetects the agents on your machine, checks the risk and pins the version.
Other ways to install
Install the tool
npm install -g cc-lensStart local Claude Code analytics with one command: npx cc-lens. It finds a free port and opens the dashboard in the browser. For another profile set the directory: CLAUDE_CONFIG_DIR=~/.claude-work npx cc-lens.
Other ways from the author
npx cc-lensOne-off run without install: the dashboard opens in the browser on a local port.
This is third-party code. Review the repository files before installing.
What it does
cc-lens starts a local dashboard that reads Claude Code data from the ~/.claude directory and shows it in the browser. The command finds a free port, starts a server and opens the page. The dashboard shows sessions, messages, tokens and estimated cost, breakdowns by project, model, tool and MCP server, an activity calendar and peak hours. You can replay session conversations from JSONL, inspect tool calls and context compactions. There is export to a cclens.json file; import is preview-only for now and does not write anything back.
Who it is for. For developers and founders who want to see how and where Claude Code is spent.
Good fit when
- You want to understand Claude Code cost and tokens per session
- You want a breakdown by project, model and tool
- You want to replay and inspect a past session
Not a fit when
- You do not use Claude Code and there is no ~/.claude directory
- You need shared cloud analytics for a team
Example request
Start the local dashboard and show project costs for the last monthLimitations
Cost figures are an estimate from usage data, not an exact bill. By default the server binds to the loopback address only; exposing it to the LAN is a flag. Import runs in preview mode and does not merge data into the live Claude Code directory, to avoid corrupting files.
How to disable. Stop the cc-lens process. No permanent install is required; optionally remove the ~/.cc-lens cache.
Security check
- Reads local data and session conversations from the Claude Code directory
- Starts a local web server that a flag can expose to the whole network
README in short
The README describes a local analytics dashboard for Claude Code that reads the ~/.claude directory and shows stats in the browser. It launches with npx cc-lens; the server finds a port and opens the page itself. The dashboard covers sessions, cost, tokens, projects, models, tools, MCP, activity and a Wrapped section. There is export to cclens.json and preview import. Profile selection via CLAUDE_CONFIG_DIR and host and port flags are supported. MIT licensed.
FAQ
Does the data leave my machine?
No, cc-lens reads only the local ~/.claude directory and runs without cloud, telemetry or keys.
How do I view a second Claude Code profile?
Set the CLAUDE_CONFIG_DIR variable to the target directory before launching.
Related
A self-hosted knowledge base with block-level references and a built-in MCP server for connecting AI agents to your notes
A CLI for every Google Workspace API with JSON output and agent skills: Drive, Gmail, Calendar, Sheets and more
Local search over Markdown notes, docs and meeting transcripts: keywords, semantic search and reranking, with an MCP server
A task manager for AI-driven development: breaks a PRD into dependent tasks and guides the agent through them via MCP or CLI