ccanalyzer
v2.2.0
Published
Web-based analyzer for Claude Code sessions
Maintainers
Readme
ccanalyzer
A web-based dashboard for analyzing your Claude Code sessions — costs, token usage, agent activity, and conversation timelines.

Usage
npx -y ccanalyzer@latestOpens a local dashboard at http://localhost:3737 in your browser.
If port 3737 is already in use, specify a different port with -p:
npx -y ccanalyzer@latest -p 3738By default the server binds to 127.0.0.1 (localhost only). To expose it — for
example when running inside a Docker container where port-forwarding routes
through eth0 rather than the container loopback — bind to all interfaces via
the HOST env var or the --host flag:
HOST=0.0.0.0 npx -y ccanalyzer@latest
# or
npx -y ccanalyzer@latest --host 0.0.0.0Features
- Dashboard — all projects with token counts, costs, and last activity (sortable columns)
- Tool usage — tool, skill, MCP-server and subagent activity, globally or filtered per project, as charts + sortable tables
- Session browser — list sessions per project sorted by recency, with a per-project tool-usage breakdown
- Session detail — full message thread with token/cost breakdown per exchange, plus a per-conversation tool-usage panel
- Gantt timeline — visual timeline of user turns, AI responses, and spawned agents
- Click a message bar → see the exchange inline
- Click an agent bar → open the full agent conversation in a popup
- Agent popup — complete agent conversation with stats (input/output tokens, cost)
Custom config directory
By default, ccanalyzer reads ~/.claude. To analyze a different Claude config directory (e.g. a work profile or a custom CLAUDE_CONFIG_DIR):
CLAUDE_CONFIG_DIR=/path/to/your/.claude npx -y ccanalyzer@latestExample — analyze a secondary profile:
CLAUDE_CONFIG_DIR=~/.claude-work npx -y ccanalyzer@latestAnalyzing OpenCode sessions (experimental)
ccanalyzer can also analyze OpenCode sessions. OpenCode
stores its data in a local SQLite database (opencode.db); ccanalyzer reads it
read-only and maps it onto the same dashboard, session browser, Gantt
timeline, and tool-usage views.
# via flag
npx -y ccanalyzer@latest --source opencode
# or via env
CCANALYZER_SOURCE=opencode npx -y ccanalyzer@latestThe default source stays Claude Code (
--source claude); nothing changes for existing users.Costs are taken from OpenCode's own per-message figures, so multi-provider models (Anthropic, Google, OpenAI, …) are reported accurately.
By default ccanalyzer looks for the database under
$XDG_DATA_HOME/opencode(falling back to~/.local/share/opencode). Override the location withOPENCODE_DATA_DIR:OPENCODE_DATA_DIR=/path/to/opencode npx -y ccanalyzer@latest --source opencode
Note: the OpenCode source uses Node's built-in
node:sqlite, which requires Node 22+. The Claude Code source still runs on Node 18+.
Docker
A ready-to-use docker-compose.yaml is included:
services:
node:
image: node:22-slim
restart: unless-stopped
environment:
- HOST=0.0.0.0 # bind all interfaces (see note below)
- CLAUDE_CONFIG_DIR=/data/.claude # where ccanalyzer reads sessions from
volumes:
- ${HOME}/.claude:/data/.claude:ro # host Claude data, mounted read-only
command: [npx, -y, ccanalyzer@latest, -p, "${APP_PORT}"]
ports:
- "${APP_PORT}:${APP_PORT}"With an .env next to it:
APP_PORT=3737Then:
docker compose upTwo things are essential in a container:
HOST=0.0.0.0— the server defaults to127.0.0.1, which inside a container only covers the container loopback. Docker's port-forwarding routes througheth0, so without this you getconnection reset by peer.- Mounting your Claude data — ccanalyzer reads sessions from
~/.claude/projects/**. Mount the host's~/.claudeinto the container and pointCLAUDE_CONFIG_DIRat it, otherwise the dashboard starts up empty.
Development
To run from a local clone (instead of npx):
git clone https://github.com/olivier-j/ccanalyzer.git
cd ccanalyzer
npm install
npm run devnpm run dev uses Node's built-in --watch, so the server restarts on changes
to src/parser.js / src/server.js. Frontend edits (src/public/**) are served
statically — just refresh the browser (hard-refresh, as assets are cache-busted
with ?v=). Use npm start for a plain run without the watcher.
The same flags and env vars apply as above, e.g.:
PORT=3738 CLAUDE_CONFIG_DIR=~/.claude-work npm run devRequirements
- Node.js >= 18
- Claude Code sessions in
~/.claude/projects/(or your customCLAUDE_CONFIG_DIR)
Contributing
Contributions are welcome! See CONTRIBUTING.md to get started, and please follow the Code of Conduct.
