To reduce Claude Code costs, measure where the tokens go first, then work through seven levers in order: keep the prompt cache warm, shrink what loads on every turn, clear or compact at task boundaries, pick the model per task, give subagents a cheaper model, lower reasoning effort where it isn't needed, and only then add a router. Most of a long session's bill is the model re-reading context it has already seen, so the cache and context levers usually move more than the model lever.
This is a checklist, not a benchmark. It contains no savings percentage, because the result depends on your sessions. Command names are from Claude Code as of November 2026. Run `/help` to confirm them in your version.
Where a Claude Code bill comes from.
Every turn re-sends the whole conversation: system prompt, tool definitions, CLAUDE.md, every file read and every command output so far. Four token types are billed, at four different rates:
| Token type | What it is | Rate relative to base input |
|---|---|---|
| Cache read | Context the model has seen and re-reads | 0.1x |
| Cache write | New context added to the cache | 1.25x (five-minute cache) |
| Uncached input | Context sent with no cache | 1x |
| Output | The answer, tool calls and thinking | Several times input, varies by model |
Two things follow. A long session is mostly cache reads, which are cheap per token but large in volume. And anything that breaks the cache turns a 0.1x read into a 1.25x write of the entire prefix, which is why a few bad turns can cost more than the rest of the session.
Step 0: measure before you change anything.
- `/cost` shows the current session's token use and cost on API billing.
- `/context` shows what is filling the context window right now.
- `npx nadir-receipt` prices your local Claude Code and Codex history at API list prices and splits it into re-reading context, adding context and answers. It runs locally, makes no network calls and is MIT licensed.
--budget 20000shows the monthly pace against a team budget, and--mergecombines a team's files. Details are on the receipt page.
If re-reading context is the largest share, start with levers 1 to 3. If answers are, start with levers 4 to 6.
The seven levers.
1. Keep the prompt cache warm
The default cache lives five minutes. Walk away for ten, come back, and the next turn re-writes the whole prefix at the write rate. Finish a task in one sitting, or clear the session before a break instead of resuming a large one after it. Don't edit CLAUDE.md, add an MCP server or change the system prompt mid-task: each one changes the prefix and rebuilds the cache.
2. Shrink what loads on every turn
CLAUDE.md and every connected MCP server's tool definitions are sent on every turn of every session. Keep CLAUDE.md to rules the agent needs each time and move reference material into files it can open on demand. Disconnect MCP servers you aren't using in this project. /context shows what each one costs.
3. Clear or compact at task boundaries
/clear between unrelated tasks. /compact when one task has grown long and you still need its thread. Compaction isn't free: it pays for a summary and then re-writes the cache, so compacting often costs more than it saves. We priced that in the compaction tax. Also point the agent at the exact file or line range. A whole-file read stays in context for the rest of the session.
4. Pick the model per task, at the start
/model switches the session model. Renames, formatting, docstrings and lookups rarely need the largest model. Decide at the start of a task, not in the middle: the cache is keyed to the model, so a mid-session switch makes the new model process the whole prefix from scratch. The break-even math is in Your Router Is Fighting Your Prompt Cache.
5. Give subagents a cheaper model
A subagent starts with a fresh, small context, so the cache penalty in lever 4 doesn't apply. Set model in the subagent's definition for mechanical work such as searches, sweeps and test runs, and keep the main session on the stronger model. This is the lowest-risk place to use a small model.
6. Lower reasoning effort where it isn't needed
Thinking tokens bill as output, the most expensive token type. High effort on a one-line edit pays for reasoning nobody reads. Lower it for routine edits and raise it for design and debugging.
7. Add a router last
Manual model choice works until every developer has to remember it on every task. A router makes the choice per task. It helps when your work is a real mix of easy and hard tasks and you would otherwise leave the largest model on. It doesn't help when the cheap model already passes nearly everything, or when switching throws away a warm cache. We published our own negative results in When LLM Routing Does Not Help.
A team is a different problem.
For one developer, the levers above are habits. For a team, they are policy: a model allowlist, a per-developer budget and spend broken out by person and agent. A gateway such as LiteLLM, Bifrost or Portkey enforces the budget and the allowlist. A router decides the model inside those limits. The two are different layers, compared in AI gateway vs model router.
Where Nadir fits.
Nadir covers three of the steps above.
- Step 0.
npx nadir-receiptis the free local receipt described above. - Levers 4 and 5. Nadir Auto is a launcher for Claude Code and Codex. It asks Nadir for a model before each turn, keeps your configured model as the quality fallback and the cost ceiling, checks the cache switch cost before it moves a turn, and writes a local receipt per turn. Inference stays on your own provider account. It works without a Nadir key on the anonymous decision quota. Set it up with
npx --yes https://getnadir.com/install/nadir-labs.tgz. - Teams. Nadir Lens shows spend by team and member, agent loops by role and cache economics, with a gateway-enforced model allowlist.
Nadir doesn't do levers 1 to 3 for you. Cache discipline and context size are yours, and on most sessions they are the larger share. Nadir publishes no universal savings rate. Run the receipt, then decide whether a router is worth adding.
Conclusion.
Measure first. Fix what is re-read on every turn before you change who reads it. Choose the model at the start of a task and give subagents the cheap one. Add a router when the choice needs to happen without anyone remembering it.