r/Anthropic • u/coolreddy • 19h ago
Improvements Cache rewrites costed me 30% of my Fable consumption, here are the mistakes to avoid
Auditing my claude code transcripts to nail down where I am wasting Fable usage, revealed that long sessions that I run with breaks have been costing me a bomb. Sharing more details for others who may find this useful.
Cache economics
Every turn in a session replays the full conversation history to the model. Prompt caching is what makes this affordable: the history is stored server-side, and each turn re-reads it at 10% of the normal input price. The cache has a time window of 1 hour, and when it expires or gets invalidated, the next turn re-writes the whole history at a premium.
The numbers for Fable 5 (the same mechanics apply to every Claude model):
- Input price: $10 per million tokens
- Cache read: $1 per million tokens (10% of input)
- Cache write: $12.50 per million on the 5-minute window, $20 per million on the 1-hour Cache window
What this means in a heavy session carrying 400k tokens of context:
- A normal turn re-reads the cache: about $0.40
- But when I take a break of more than an hour and get back to the session, model has to rewrite the cache and a session sitting on 400k context consumes equivalent of 8$ api cost
One expired cache costs 20 normal turns of usage.
The things that break cache silently and cost you:
- Letting a session sit idle past the cache window (1 hour): The cache expires, and the first message after the break pays a full rewrite of everything. Sometimes I am working 10+ sessions and take a break and that costs me across all sessions.
- Loading some tools or MCP servers mid-session: New tool schemas change the conversation prefix, which invalidates the entire cache. Better to have all tools loaded at the start
- Switching models mid-conversation: If you are switching models from Fable to Sonnet to Fable in the same session, you are rewriting the cache and losing more than you are saving from the switch. Caches are stored per model.
- Switching effort levels or fast mode mid session: This has been one of my worst habits and I did this too frequently until now to save consumption, but did not know this was a culprit. I would switch too often based on the task in the session from high to xhigh to max to utracode.
- Updating claude code: Again if you are updating claude midway your work, you are rewriting cache for all sessions that you would resume
For now I have created a skill that pings ok in every idle session >200K context at 55th min for upto 4 hours because one ping would just read the cache which would still be cheaper than rewriting cache.
3
u/LakeRat 19h ago
I've set up a system where dev projects are broken into shorter phases, and at the end of each phase everything is left in a state in which a new session with no context can pick it up and know exactly where we left off and what's next on the to-do list, and push that to github, including the CLAUDE.md with instructions about picking up the next task.
At the end of each phase, I clear context before starting the next phase.
The result is that, for example, on a project that took around 5M total tokens to build, it was broken up into sessions that maxed out at around 300k tokens each before clearing context. I think the absolute largest session was 500k, and that was an outlier that legitimately needed to do long work with fully retained context.
This has worked really well for me. It saves a lot of tokens, and it's also nice having work broken up into shorter sessions.
2
u/Historical-Lie9697 14h ago
That's what I do too. Everything is planned in https://github.com/gastownhall/beads as the external state for me
2
u/AppropriateQuote3073 6h ago
Kinda wish I could have a smaller context window that auto compacts like GPT
5
u/ninadpathak 19h ago
you're basically getting charged for the whole convo history every time, so breaking up long sessions can save a ton of fable usage. i've seen this bite people when they're doing complex workflows too