Real-time token cost, context health, and per-project/per-agent cost breakdown for Claude Code sessions.
- Session cost — live running total as you work
- Today / week / month tiles — cumulative spend across all sessions
- Context window bar — how full your 200K token window is, with a compaction warning when you're close
- Agent breakdown — per-subagent token and cost attribution (no more mystery burns)
- By-project table — ranked cost breakdown across all your projects for today / this week / this month
git clone https://github.com/ibrahimokdadov/claudecost.git
cd claudecost
npm installnode bin/claudecost.js
# → http://localhost:7799Open http://localhost:7799 in your browser. The dashboard updates live as Claude Code runs.
CLAUDECOST_PORT=8000 node bin/claudecost.js # custom portClaude Code writes every API response to JSONL files under ~/.claude/projects/. claudeCost:
- Finds the most recently active session file at startup and cold-parses it
- Watches all project directories with chokidar for live updates
- Computes per-turn cost from token counts using Claude's public pricing
- Scans all project directories at startup for the per-project breakdown (this-month only, for performance)
- Streams state updates to the browser over SSE
| Model | Input | Output | Cache write | Cache read |
|---|---|---|---|---|
| claude-sonnet-4-6 | $3/MTok | $15/MTok | $3.75/MTok | $0.30/MTok |
| claude-opus-4-6 | $15/MTok | $75/MTok | $18.75/MTok | $1.50/MTok |
| claude-haiku-4-5 | $0.80/MTok | $4/MTok | $1.00/MTok | $0.08/MTok |
- Node.js + Express — server + SSE
- chokidar — JSONL file watcher (polling mode on Windows)
- Vanilla JS / CSS dashboard — no build step
Set a monthly budget in the dashboard to get a % used indicator and a warning color when you're close.
- Node.js 18+
- Claude Code installed and run at least once (needs
~/.claude/projects/) - Windows, macOS, or Linux
