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
- Autoresearch proposes packaging ML runs as studies with questions, analysis, and code diffs — morgymcg · 2026-07-21
- CHAP defines approvals, handoffs, and audit logs for human-agent workflows — DeliveryTechnical199 · 2026-07-21
- The author says Codex reached 20x and is now debugging spec decoding on a hybrid parallel setup — TheZachMueller · 2026-07-21
- Axcess adds an MCP connector for WCAG accessibility checks that scanners miss — modelcontextprotocol · 2026-07-21
- X post asks whether Cursor Composer, built on Kimi models, would also be banned — max_paperclips · 2026-07-21
- A developer’s Codex usage is draining pooled enterprise credits at a small company — Distinct_Relation_62 · 2026-07-21