I run a lot of Claude Code — dozens of projects, thousands of sessions, and a bill worth caring about. This month two write-ups landed that, taken together, say something most token-saving advice gets backwards. So I built (well, had Claude build) a small open-source kit around what the data actually shows, and pointed it at my own transcripts to check.
1. Nearly all spend is reused input. Nate's analysis of a 3.77-billion-token day found 95.7% of it was input the model had already seen — earlier turns, standing instructions, tool definitions, files, command output — re-sent on every request. The context window is a ratchet: everything that enters it is billed again on every subsequent step of the session.
2. Compressing tool output doesn't help. JetBrains measured RTK, a popular hook that rewrites shell output into compact form ("60–90% less token consumption"). RTK's own analytics claimed 96M tokens saved; actual billing went up 7.6% at low reasoning effort (p=0.004) and moved ±0% at high effort. The hook only touched ~3% of input tokens — Claude Code already truncates long outputs, and re-sent context is served from the prompt cache at a tenth of the fresh-input price, which the tool's counterfactual counter never accounted for.
The lesson generalizes past one tool: optimizing bytes-per-tool-result attacks the small slice, and self-reported "tokens saved" counters measure a counterfactual, not a bill. The levers that actually move cost are (a) what enters the expensive main context at all, (b) which model tier does which work, and (c) whether the prompt cache stays warm.
token-saver is those three levers as installable pieces for any Claude Code setup — no proxy, no hook, no dependencies:
| Piece | What it does |
|---|---|
skills/token-saver | A skill that puts the session in a token diet: search-then-scoped-read (never whole-file dumps), filtered command output, batched tool calls, no re-reads, append-only context habits that keep the cache warm. Bounded by one rule from Nate's piece — a token count is a trace, not a scoreboard: nothing that risks a retry, because one retry costs more than the shortcut saved. |
agents/ | Three subagents pinned to cheap models: scout
(haiku — returns path:line, never contents), reader (sonnet — returns
a digest, never a dump), runner (haiku — returns exit status + the failing lines,
never the log). Raw material stays in the subagent's throwaway context; only conclusions enter
the expensive main loop. |
rules/model-routing.md | A CLAUDE.md snippet making
model routing a standing rule: subagents silently inherit the main-loop model unless you say
otherwise, so a fan-out from an Opus- or Fable-tier session burns top-tier pricing on
grep work by default. Haiku for mechanical, sonnet as the workhorse, opus for
substantive engineering, top tier ≤1-in-10 and individually justifiable. |
bin/token-audit | A stdlib-only Python tool that reads the usage
blocks Claude Code itself logs in ~/.claude/projects/ — real billing inputs, not
counters. Cache-aware pricing (reads at 0.1×, 5-minute writes at 1.25×, 1-hour writes at 2×),
per-model and per-session breakdown, reused-input share, and what the same traffic would have
cost uncached. |
$ ./bin/token-audit --days 7
model req input output cache-rd cache-wr cost
claude-fable-5 1210 21k 1.3M 196.0M 7.8M $418.56
claude-sonnet-5 2239 4k 6.9M 57.3M 28.8M $293.64
claude-opus-5 2146 12k 1.8M 286.3M 7.2M $260.39
claude-opus-4-8 242 447 220k 19.7M 1.1M $26.08
reused input (served from cache): 92.6% of all input tokens
estimated cost: $998.66
same traffic without caching: $4,088.52 (caching saved ~$3,089.86)
Three things the trace says, plainly:
Reused input is 92.6% of my tokens — my own sessions replicate Nate's 95.7% almost exactly. Fresh input (the thing RTK-style compressors shrink) is a rounding error: 21k tokens against 196M cache reads on the Fable tier.
The cache is doing more for my bill than any behavior change will — ~$3,090/week of the counterfactual cost is already absorbed at 0.1× pricing. Which is exactly why the skill's most important rules are the boring ones about not churning context, and why any tool that rewrites what the model sees mid-session risks costing more than it saves.
The remaining lever is model mix. Fable at $10/$50 per MTok is 42% of my spend. Every mechanical search, summary, and test run that moves from the main loop to a haiku/sonnet subagent is billed at 10–30% of the rate and keeps its raw material out of the ratchet entirely — the one optimization that attacks both terms at once.
git clone https://github.com/bryanvine/token-saver.git
cd token-saver
./install.sh # symlinks into ~/.claude — skill, agents, audit tool
./tests/run-tests.sh # 19 checks: frontmatter, installer round-trip, pricing math
./bin/token-audit # your own last 30 days, from your own transcripts