token-damage
v0.6.0
Published
The receipt your AI agent never gave you. Reads the local logs of Claude Code, Codex, Gemini CLI and OpenCode and prints an itemized receipt, or watches today live. Uploads nothing.
Maintainers
Readme
npx token-damageWorks with Claude Code, Codex, Antigravity, Grok Build, OpenCode and Gemini CLI. Runs on your machine; nothing is uploaded.
You typed a paragraph. It read a library.
Token Damage reads the logs your agents already keep and prints an itemized receipt: the words you typed, the tokens they read, what that would cost at API list price, an electricity estimate, and a note from a tired insurance adjuster.
================================================
T O K E N D A M A G E
customer copy
statement · aug 25 – sep 23, 2026
(30 days — all claude code kept)
================================================
WORDS YOU TYPED ......................... 14,690
MODEL CALLS .............................. 7,480
TOKENS READ BY AGENTS ............ 1,178,700,000
re-read from cache ..................... 96.2%
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■··
TOKENS WRITTEN BY AGENTS ............. 4,700,000
------------------------------------------------
BY MODEL TOKENS LIST PRICE
opus 840.2M ≡ $665.34
■■■■■■■■■■■■■■■■■■■■■■■■■■■■············ 71%
sonnet 284.0M ≡ $134.94
■■■■■■■■■······························· 24%
haiku 59.2M ≡ $9.37
■■······································ 5%
------------------------------------------------
LIST-PRICE VALUE (API-EQUIV.) ........ ≡ $809.65
CACHE SAVED YOU .................... ≡ $4,383.85
------------------------------------------------
SURCHARGE (ESTIMATE, SHOWN AS A RANGE)
ELECTRICITY ..................... ≈ 26–120 kWh
------------------------------------------------
BY DAY .......................... 1 day = 1 mark
▃▃▃▃▃·▃▃▃▃▃▃·▃▃▃▃▃▂·▂▂▂█▂▂·▂▂▂
▲ sep 17
------------------------------------------------
DAMAGE CLASS
┏━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ A C T O F G O D ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━┛
■······················· 4% to UNINSURABLE
------------------------------------------------
ACHIEVEMENTS
ONE LAST FIX ...... last model call at 3:47 am
CACHE LORD
over 95% of input from cache for a week
MIDDLE MANAGER ....... 12 subagents in one day
------------------------------------------------
ADJUSTER'S NOTE
for every word you typed, the machine read
80,558 tokens. that's the great gatsby,
and a third of it again. per word.
================================================
≡ list-price equiv · ≈ estimate · ✶ satireA sample month, not yours. Yours is one command away.
Watch it live
npx token-damage liveA calm pane to keep next to your agent. The top rows are today; the one that counts up is the prompt running right now.
WATER DAMAGE next STRUCTURAL at 100M ■■···· 38%
today 1,212 words → 38.2M read ≡ $41.20
now claude+3 · 4 words → 9.8M ▸ ≡ $7.10
rate 1.4M/min ▁▂▃▅█▇▅▃▂▁ ● printing
─────────────────────────────────────────────────
time agent you typed → it read list
13:41 claude 12 words → 3.1M ≡ $2.40
13:52 codex 31 words → 410.0K ≡ $0.31
✶ four words in. a library out. the usual.q quits. --json streams snapshots as JSON lines instead, for tmux bars and scripts.
To see the same numbers in Claude Code's own status line, install it once and run the setup. It shows the settings.json change and asks before writing:
npm i -g token-damage
token-damage statusline --install▸ 4 words → 9.8M read ≡ $7.10 · +3 interns · ctx 41%
WATER DAMAGE · today 38.2M ≡ $41.20 · 5h 58% resets 16:00 · 7d 21%Share it
After the receipt, c saves a 1080×1920 card and s makes a share link. Both show you every field first. A friend who opens the link has to guess your number before they see it.
Receipt options
--plan 200 your monthly plan in USD, for "value extracted: 4.0× your plan"
--since 30d how far back to look, or a start date (YYYY-MM-DD)
--json the whole receipt as JSON
--no-anim print it all at oncenpx token-damage --help lists the rest. Needs Node 22 or newer (22.13 or newer to read OpenCode and Antigravity).
FAQ
Is this what I paid? No. ≡ is what the same tokens would cost at the providers' API list prices. On a subscription you pay the plan; --plan 200 shows how many times over you used it.
Does it upload anything? No. No network calls, no telemetry, no accounts. A share link keeps its numbers after the #, the part of a URL browsers never send to a server.
Why don't my numbers match another tool? Claude Code deletes transcripts older than 30 days by default, so the receipt covers what survived and says so. Duplicate log lines are counted once. Every counted line is checked against hand-derived fixture totals, per day, and real logs are cross-checked against ccusage before each release; if your numbers look wrong, open an issue.
Privacy
It reads Claude Code's transcripts and retention setting, Codex's session logs, Antigravity's conversation databases (read-only) and prompt history, Grok Build's session logs, OpenCode's message database (read-only) and Gemini CLI's chats (Gemini CLI now serves API-key and enterprise users; Antigravity replaced it for everyone else), and nothing else. Your prompts are counted, never stored. The live view keeps one file, ~/.token-damage/today.json, with numbers and hashed file names only. More at tokendamage.com/privacy.
How the numbers work
Prices come from Anthropic's, OpenAI's and Google's public price lists, and every receipt prints the date they were checked. Electricity is always a range, because nobody publishes the real figure. Satire is printed in red and says so, and never carries a real number. The method is at tokendamage.com/method; the details are in docs/METRICS.md, docs/DATA-SOURCES.md and docs/LIVE.md.
Source
github.com/dancemonk/token-damage. Issues welcome, especially when a new agent version breaks the numbers.
MIT. Not affiliated with Anthropic, OpenAI or Google. No refunds: tokens cannot be un-read.
