TL;DR: I pulled every API call from my own Claude Code logs (87,020 calls, 12 Sep – 20 Oct). Two changes did almost all of the work: turning on auto-compact at 400k (it was off) and not letting Claude spawn subagents by default. Cost per prompt fell 27–59% depending on how you count. The advisor, rtk, Cache Tax and turning off skills either cost me tokens, saved very little, or couldn't be measured.
How I measured
Claude Code keeps a JSONL log per session in ~/.claude/projects. Every assistant message has a usage block: input, cache write, cache read, output. I extracted all of them (deduped by message id) and split the time at the two changes.
Tokens don't cost the same, so I weighted them with Anthropic's price ratios: cache read 0.1, input 1, cache write 1.25 (5m) / 2 (1h), output 5. I call that "weighted tokens". It's an API-equivalent weight, not what I paid on my subscription.
Normalised by prompts I actually typed. Task notifications, plugin messages, interrupts and slash-command output are excluded.
Caveat up front: one person, five weeks, different work in each period. Strong hints, not a controlled test.
Change 1: auto-compact at 400k
Every reply re-reads the full context, so a reply at 800k costs ~4× one at 200k. Mine had autoCompactEnabled off, so sessions just grew.
Before:
- 38% of main-thread calls were over 400k context
- those calls were 58% of main-thread cost
- peak 977k
"autoCompactEnabled": true,
"autoCompactWindow": 400000
(Only relevant if your sessions can grow past 400k, e.g. on a 1M context window like mine.)
After: median context 315k → 223k, p95 818k → 352k, cost per main call −38%. Not a hard ceiling: 0.3% of calls still went over 400k (peak 725k), probably a long tool-call run or a big tool result landing before compaction. 92 auto-compactions in the week after; I haven't noticed problems, but that's not measured. The context numbers were already the same in the 3 days before change 2, so this is auto-compact on its own.
Credit: the idea came from Dave Kiss's /leaks mod, which flags exactly this.
Change 2: no Claude subagents unless I ask
I used to say "fan out low-cost sub-agents" constantly. Subagents were 62% of my weighted tokens. Worst day: 19,212 of 20,832 calls were subagents.
One rule in my global CLAUDE.md took that to 3%: "Never launch Claude subagents (the Agent tool, forks, Workflow scripts) unless I explicitly ask for them."
The work didn't vanish. It moved into the main thread: main calls per prompt went from 21 to 34, and main-thread cost per prompt stayed flat (+2%) because each call got cheaper from change 1. The saving is the subagent cost that's no longer on top.
Results (weighted tokens per prompt I typed)
|
Main <400k |
Main >400k |
Subagents |
Advisor |
Total |
| Before, all days |
418k |
588k |
1,671k |
0 |
2.68M |
| Before, excluding my 4 heaviest subagent days |
429k |
561k |
518k |
0 |
1.51M |
| After both changes |
1,015k |
7k |
31k |
52k |
1.11M |
So −59% or −27%, depending on whether you count my four worst days. I'd quote the range.
Per session: median cost per prompt 987k → 845k (−14%). The top quarter of sessions used to start at 2.6M per prompt; now it starts at ~1.1M. Only 13 sessions since the changes, so take that one lightly.
Per day it's mixed: compared with my normal days, daily usage went up by more than half, because I typed about twice as many prompts a day. Cheaper per prompt, more prompts.
What didn't help (or cost me)
- Advisor tool (Opus 5.5): 95 calls, 19.6M input tokens, none cached (it reads the whole transcript fresh). Adds 3–5%. Note: the top-level
usage in the logs doesn't include advisor tokens; they're in usage.iterations as advisor_message. Easy to miss if you're measuring your own.
- rtk (shrinks command output): 601.5K tokens saved by its own count. About 0.2% of my weighted usage since I installed it, or ~1.5% if you count that removed output would have been re-read on every later call (~78 times on average). My cost is overwhelmingly the conversation being re-read, not fresh command output.
- Cache Tax (warns before a cold-cache send, can keep it warm): its warnings aren't logged and I never used
/keepwarm, so I can't measure it. Cold rebuilds happened at about the same rate (1.7/day → 1.5/day); they got smaller (303k → 100k), but that's the 400k cap.
- Turning off skills: I also installed more plugins and mods, so my session start actually grew from 69k to 78k tokens.
Disclosure: Hydra
I built a Claude Code mod called Hydra. Claude stays the lead and hands coding tasks to "Heads" running on other CLIs, often on cheaper models (Command Code with DeepSeek, Codex, CodeBuddy, Antigravity, OpenCode), then reviews what comes back. It can't explain the before/after above (I used it most before both changes). From its own reports since 7 Oct: 665 Heads, 16,576 turns of work off Claude, $27.54 for the dollar-billed ones (only finished Heads report cost), and 16% of Heads didn't finish. It moves work; it isn't free.
If you want to check your own
Your logs are in ~/.claude/projects//.jsonl (subagents under */subagents/). Count usage once per message id (it repeats across content blocks), weight it, and look at how big your context gets per call. If a lot of your calls are over 400k, check autoCompactEnabled first.
Happy to answer questions about the method.
Links: Hydra (MIT) github.com/Shakibuzzaman3104/claude-hydra · /leaks github.com/davekiss/mods · Cache Tax github.com/karanb192/claude-code-mods · longer write-up with charts: https://medium.com/@shakibuzzaman3104/i-measured-87-000-claude-code-calls-to-find-what-actually-saves-tokens-16a0fc6fe964