How to Cut Your Claude Code Token Costs by 20x
How to Cut Your Claude Code Token Costs by 20x
Most people are paying up to 20 times more for their Claude Code tokens than they need to — and they have no idea it's happening. The fix isn't putting "be brief" in your CLAUDE.md file. It's understanding how prompt caching actually works. I've spent a lot of time inside Claude Code with real client projects, and once you get this one concept, everything else about managing your token spend falls into place.
Here are the five ways to get the most out of your tokens, starting with the one that matters more than all the others combined.
How Does Prompt Caching Work in Claude Code?
Prompt caching is the single most important thing to understand about your token costs. Nothing else in this article comes close to the savings it unlocks. But to get it, you first need to understand how tokens work at all — so here's the 60-second version.
Tokens are the currency of large language models. Simplified, one word is roughly one token. When you send "how are you doing today?" that's five input tokens. When the model replies "I'm doing great, thanks," that's four output tokens. And they're priced very differently — output tokens cost about five times what input tokens cost.
If tokens are the currency, the context window is your budget. Models like Opus, Fable, and Sonnet all have a budget of 1 million tokens. The catch shows up on your second message. When you say "build me an app," you're not just sending those few tokens — you're re-sending the entire conversation history up to that point so the model has full context. Every follow-on message resends everything before it.
That compounds fast. Ten messages in, you might be shipping 5,000, 10,000, even 100,000 input tokens on every single turn — and you pay for all of it. So why doesn't everyone burn through their usage instantly? The cache.
Why Does the Claude Cache Only Last One Hour?
Think of the cache as a document sitting in front of Claude that holds your entire conversation history. When you send a new message, Claude reads that document to understand the context — and reading the cache is dramatically cheaper than sending the whole history fresh.
The cache only survives one hour of inactivity. Every message resets the one-hour timer, so an active conversation stays cached indefinitely. But walk away for an hour with a 500,000-token conversation, and that document disappears. Your next message — even if it's just "hey, what's up?" — gets billed as a full-rate 500,000-token send.
Here's why that hurts so much. The difference between a cache read and a fresh read is roughly 20x, and it's right there in the pricing docs:
- Output tokens never change: about $50 per million for Fable, $25 per million for Opus.
- Base input tokens are often quoted at $10 per million — but that's misleading, because on a subscription plan you're always doing cache writes. A one-hour cache write is double the base rate: $20 per million tokens the first time you write to the cache. (The five-minute cache rate you'll see in the docs is really just for API users.)
- Cache hits — Claude just reading the document it's been accumulating — cost about $1 per million tokens.
Twenty times cheaper. That's the whole ballgame.
What Actually Resets the Claude Cache?
Time isn't the only thing that kills your cache. Run the numbers on a 500,000-token conversation: if the history is cached, your next message costs around 50 cents to read everything, plus the new message billed at the write rate. Lose the cache, and that same single message can cost you around $10. Fifty cents versus ten bucks — just for waiting an hour.
Straight from the Claude Code documentation, these all reset your cache completely:
- Switching your model (e.g., Fable to Opus)
- Changing your effort level
- Toggling fast mode
- Connecting or disconnecting an MCP server
- Plugins denying tools
- Compacting a conversation
- Upgrading Claude Code
Any one of these means your next message is billed up to 20x higher than it needs to be. Knowing this list is half the battle — you stop casually switching models mid-session on a huge conversation.
What Do You Do When You Lose the Cache?
So you stepped away, the cache is gone, and you've got a 300,000+ token conversation staring back at you. You have three good options — and all of them beat blindly firing off a full-rate message.
- Option 1:
/clear(the nuclear option). This wipes the entire conversation history. That sounds drastic, but it's often the right call. If you're working in a codebase, the evidence of what you did lives in the files themselves. Start fresh and Claude Code can read the project and pick up where you left off. You don't have to be a slave to the old conversation. - Option 2:
/compact. Claude creates a summary of your conversation, then effectively clears and restarts with that summary loaded into the message history. Don't wait for auto-compact to trigger — by the time you're in the 600,000–800,000 token range, you're dealing with context rot, which is still a real problem even on the more powerful models. Compact early and deliberately. - Option 3: a custom handoff tool. Similar to compaction, but the summary lives as an actual markdown file on your disk instead of inside the conversation. You start a new session and tell Claude Code to read the handoff document. The advantage is a living, breathing file you can edit and keep updating across sessions. There are plenty of handoff skills floating around — I have one in my free community.
The honest takeaway: you shouldn't be operating in the 400,000–600,000 token range very often in the first place. These options exist for when you do.
How Do You Route Work to Cheaper Models?
Tip three is model routing — matching the task to the right model instead of using your smartest, most expensive model for everything. You don't need Fable to run a simple find-and-replace.
Advisor mode is the easiest way in. The idea, from the original advisor blog post, is that a smart model (Fable or Opus) writes the plan while a smaller, cheaper model (like Sonnet) executes it. The small model shares its context back with the big model whenever it hits a wall. This has consistently shown better outcomes at lower cost — and to tie it back to caching, both the advisor and the executor run their own prompt caches simultaneously.
From there you can go further:
- Delegate outside Claude Code. The Codex plugin makes it trivial to call Codex from inside the Claude Code interface — so Fable can run advisor-style handoffs to GPT models instead of Sonnet or Opus. Repos like Fable advisor do exactly this, and it's not hard to write your own skill that does it.
- Lean on the cheap GPT models. I specifically point people toward Luna and Terra. Their cost dropped significantly, and honestly, there isn't a model in the Anthropic family that does what they do at that price point.
- Bring in local models for tasks that genuinely make sense for them.
Does Running /doctor Actually Save Tokens?
Tip four is Claude hygiene. You've probably seen the clip of Boris Cherny, the creator of Claude Code, saying you need to delete your CLAUDE.md file. Do you actually need to delete it? Not necessarily. But you do need to run the /doctor command — which has gotten meaningful updates over the last couple of weeks.
Here's the token connection. The 5-series models don't need nearly as much instruction as older models did. The CLAUDE.md files people wrote 6–9 months ago were extremely prescriptive and detailed. Maybe that was justified at the time. It isn't anymore. A bloated CLAUDE.md doesn't just slow the model down — it literally costs you tokens on every conversation. /doctor trims the stuff that no longer needs to be there.
It also looks at what's bloating your context window before you've even sent a message. Run /context on a fresh conversation and you might already be at 40,000 tokens — eaten up by skills, the system prompt, and memory files. /doctor trims the skills and MCPs you haven't been using. Is it a massive save? No. But it's easy, it's free, and there's a bonus: cutting dead skills makes your remaining skills fire more reliably, because Claude isn't confused about which of your ten near-identical frontend design skills to call.
Do Token-Reduction Skills Like Ponytail and Caveman Work?
The final tip is the additional skills and scaffolding you see everywhere — and it's the least impactful of the bunch these days, so treat it as a bonus on top of everything above.
- Ponytail is the most popular. It reduces the amount of code Claude writes while keeping it effective, which makes runs cheaper and faster. The GitHub repo only benchmarks Haiku 4.5, which is outdated — but when I re-ran it on Fable, the numbers held up and actually looked better on the stronger model.
- Caveman currently claims to cut output tokens by around 65%.
- One-liners like "be brief" in your CLAUDE.md will also reduce output tokens.
Here's the thing to keep in mind: all of these only touch output tokens. And output tokens are just one piece of the puzzle — a puzzle dominated by prompt caching. If you got nothing else from this, get that.
Frequently Asked Questions
How much can prompt caching actually save on Claude Code?
Up to roughly 20x on the input side. A cache hit runs about $1 per million tokens versus about $20 per million for a fresh cache write. On a large conversation, that's the difference between a message costing around 50 cents and around $10.
How long does the Claude Code prompt cache last?
One hour of inactivity. The timer resets with every message, so an active session stays cached. Step away for an hour and the cached conversation is gone — your next message gets billed at the full write rate.
What resets the Claude cache besides time?
Switching models, changing your effort level, toggling fast mode, connecting or disconnecting an MCP server, plugins denying tools, compacting a conversation, and upgrading Claude Code. Any of these forces a full-rate re-send on your next message.
Should I use /clear or /compact when a conversation gets huge?
Use /clear when your codebase already holds the context you'd need — Claude Code can just re-read the files. Use /compact when there's important reasoning in the conversation that isn't captured in the code, since it restarts with a summary. Don't wait for auto-compact; do it before you hit context rot around 600,000–800,000 tokens.
Does deleting my CLAUDE.md file save tokens?
You usually don't need to delete it — but you should run /doctor to trim it. The 5-series models need far less instruction than older ones, so a bloated CLAUDE.md wastes tokens on every conversation. /doctor also trims unused skills and MCPs eating your context window.
If you want to go deeper on getting the most out of Claude Code, join the free Chase AI community for templates, prompts, and live breakdowns. And if you're serious about building with AI, check out the paid community, Chase AI+, for hands-on guidance on how to make money with AI.


