tokenscope โฃ
See what your AI-coding session actually cost โ and what's eating your context. A local, read-only CLI that parses your Claude Code session logs and shows where the money goes: model output vs. context being re-sent every turn (the hidden 60%+ of most bills).
$ npx @wartzar-bee/tokenscope
tokenscope โฃ latest session
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Total cost $868.84 over 967 model turns
Where the money went
output (model writing) โโโโโโโโโโโโโโโโโโโโโโโโ 16% $137.24
cache read (re-sent ctx) โโโโโโโโโโโโโโโโโโโโโโโโ 66% $577.59
cache write (new ctx) โโโโโโโโโโโโโโโโโโโโโโโโ 18% $153.67
Context size per turn (peak 822k ยท avg 404k ยท now 822k tokens)
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ
โ
โ
โโโโโโโโโโโ
Insights
โข Re-sent (cached) context cost $577.59 (66% of spend) โ context re-read every turn.
โข Peak context ~822k tokens โ /compact or a fresh session would cut per-turn cost.
โข Only 16% of spend is the model's actual output.
(A real session, default Opus pricing. Your numbers will differ โ prices are overridable.)
Why
Agentic coding (Claude Code, etc.) produces surprise bills, and the cause is mundane: as a session grows, the whole context is re-sent every turn, so cost balloons even when the model writes little. Existing dashboards show totals; tokenscope shows the attribution โ output vs. cache-read vs. cache-write vs. fresh input, the per-turn context-growth curve, cost by model, subagent spend, and which tools fill your context โ with concrete "trim this" insights.
Install / run
No install โ runs via npx:
npx @wartzar-bee/tokenscope # your most recent Claude Code session
npx @wartzar-bee/tokenscope --all # aggregate every session
npx @wartzar-bee/tokenscope <file|dir> # a specific session .jsonl
npx @wartzar-bee/tokenscope --json # machine-readable
npx @wartzar-bee/tokenscope --share # privacy-safe shareable summary (markdown + SVG card)
npx @wartzar-bee/tokenscope --share-svg # just the SVG "cost report card"
Reads ~/.claude/projects/**/*.jsonl. Read-only, local, no network, no telemetry โ open the source; nothing leaves your machine.