Source: https://github.com/phuryn/claude-usage
A local dashboard that reads Claude Code's JSONL session transcripts and shows token usage, cost estimates, and session history. Works on API, Pro, and Max plans.
- Python 3.8+, standard library only (no pip install, no venv)
sqlite3— persistent storage at~/.claude/usage.dbhttp.server— serves a single-page HTML/JS dashboard- Chart.js on the frontend for visualizations
scanner.py— parses JSONL into SQLite, incremental (tracks file mtime)dashboard.py— HTTP server, single-page UIcli.py— command dispatcher
python cli.py scan— populate the DB from JSONL filespython cli.py today— today's breakdown by model (terminal)python cli.py stats— all-time stats (terminal)python cli.py dashboard— scan + open browser atlocalhost:8080- Env vars:
HOST,PORT,--projects-dirfor custom paths
- Claude Code CLI (
claudein terminal) - VS Code extension (Claude Code sidebar)
- Dispatched Code sessions
- Cowork sessions — server-side, no local JSONL
- Cost calculations for non-standard model names (only matches
opus/sonnet/haiku— others shown/a)
Each JSONL line is a message. Usage lives at message.usage:
- input tokens, output tokens
- cache creation tokens, cache read tokens
Model identifier at message.model.
- Cost for Pro/Max users is misleading — API rates shown, but those users pay a flat subscription. The original admits this in its README.
- Unknown models show
n/a— no fallback pricing, no way to add custom pricing. - UI is a single HTML page with Chart.js — functional but dated.
- No session drill-down — can't easily click into a session and see what happened.
- No per-project comparison — aggregates are global.
- 30-second auto-refresh only; no live tailing of the active session.
These are candidates (not commitments) for what our version could do better.