Claude Code Cache Misses are Expensive
coolreddy · reddit · 2026-07-12
The author reviews their caching costs during long conversations in Claude Code, finding that "resuming an interrupted session" forces a cache rewrite. This significantly increases consumption, potentially eating up about 30% of the total usage.
They detail the specific pricing and mechanics: input is $10/M tokens, cache reads are 10% of the input price, while cache writes are about $12.5/M for a 5-minute window and $20/M for a 1-hour window. For a session with a 400k token context, a normal read costs about $0.40, but if the cache expires, rewriting it once equates to roughly $8 in API costs.
They summarize several operations that silently break the cache:
- Leaving a session idle for over 1 hour; the first turn after expiration requires rewriting the entire history
- Loading a new tool or MCP server mid-session changes the prefix and invalidates the cache
- Switching between different models rebuilds the cache separately for each model
- Frequently toggling between effort/fast mode also triggers extra rewrites
- Updating the Claude Code version mid-session similarly affects all continued chats
Finally, they share a workaround: sending a lightweight ping at the 55-minute mark for idle sessions exceeding 200k tokens, ensuring it only triggers a cache read instead of a costly rewrite after expiration.
More from coding & agent
- First-ever Three.js Conference lands in Paris, with a panel on AI-shortened design workflows — OdinLovis · 2026-09-11
- Data engineering, not agent frameworks, is the real bottleneck for enterprise AI agents — dhruv2038 · 2026-09-11
- GPT-6 Astra beats Factorio with enemies in 44 in-game hours at ~$4,500 API cost — liminal_bardo · 2026-09-11
- Investment Analyst Asks How to Build a Claude-Based Diligence Agent Stack — Careless_Tie2286 · 2026-09-11
- Treating agents like 50 First Dates: a 3-layer context system so every conversation doesn't start from zero — evielync · 2026-09-11
- Running the Firefox MCP on Android via Termux, ngrok, and mcp-proxy — Nervous-Strain7544 · 2026-09-11