The honest token meter for Claude Code. Measure your real bill, run only what pays, and cut cost without ever busting the cache — while the compressors triple the bill and report a saving. Here's the proof.
npx @getnadir/farthing audit # decompose your real bill
Add a method to expressjs/express — a multi-turn Claude Code session on Opus.
headroom genuinely compressed — and reported a −16% saving. The real bill rose 45–282%. Self-reported savings were the wrong sign.
Three price lanes (Opus, per 1M tokens). Cache-read is 12× cheaper than cache-create for the same token.
A stable prefix is served from cache — nearly free. Compression rewrites the prefix to shrink it, invalidating the cache from the edit point on, forcing Claude to re-create the whole downstream context at 12× the price. headroom counts the tokens it deleted; it never counts the survivors it shoved into the expensive lane. farthing never touches the cached prefix — it trims output and blocks byte-identical re-reads, and measures cache churn instead of causing it.
Same axis — cache_create. headroom manufactures it; farthing measures and avoids it. That is the whole idea.
| arm | median $/task (96 runs) | vs baseline | accuracy |
|---|---|---|---|
| baseline | $0.311 | — | 23/24 |
| farthing terse | $0.296 | −5% | 24/24 |
| caveman | $0.364 | +17% | 24/24 |
| headroom | $0.581 | +87% | 24/24 |
Real express sessions: headroom +45% / +58% / +99% across trace / feature / bugfix — dashboard reported a saving on every one.
| tool | axis | verdict on Claude Code coding |
|---|---|---|
| Nadir | which model runs (route + verify) | −60%, 98% quality — the axis that moves the bill |
| farthing | measure bill; cache-safe layers | −5% to −12%, gated, never busts cache |
| caveman | output tokens | +16–17% |
| headroom | input tokens (compress) | +45% to +282% |
The savings live at model choice (Nadir) and honest measurement + cache discipline (farthing) — never at token-shaving a cache-dominated bill.
git clone --depth 1 https://github.com/expressjs/express.git /tmp/express-bench
( cd /tmp/express-bench && npm install )
headroom proxy --port 8787 --mode token &
bash benchmark/express_session.sh baseline feature
bash benchmark/express_session.sh headroom feature # compare totals, not its dashboard
Full runbook in REPRODUCE.md. Every run edits only throwaway /tmp copies.