Three 6-minute pauses double a Claude agent session's input cost via cache expiry
Future_AGI · reddit · 2026-10-15
Pricing a 20-turn Claude Sonnet 5.5 agent session at list rates: replying within 5 minutes each turn costs $0.138 in input tokens; stepping away for 6 minutes before turns 6, 11 and 16 costs $0.282 — same tokens, the only difference is the prompt cache.
- Anthropic's default cache lasts 5 minutes; expiry forces a full rewrite at $2.50/M vs $0.10/M for reads (25x on Sonnet's 0.05x read rate). With 100k context, one expiry costs $0.25 instead of $0.01.
- Per-call cost logs hide the cause: turn 16 shows $0.080 (vs $0.008 warm) with a 32,000-token cache write, but the 6-minute gap sits between log rows.
- OpenAI differs: from GPT-5.6 on, cached prefixes last at least 30 minutes, so the same pause costs nothing extra.
- Recommendations: log cache read/write tokens plus seconds since last call; use the 1-hour cache ("ttl": "1h", 2x write cost) for 5–60 minute pauses, dropping this session to $0.198; keep timestamps/request IDs out of the system prompt and tool definitions ahead of the cache breakpoint.
More from coding & agent
- Antigravity already ships remote control for local agents — here's where — soumitrashukla9 · 2026-11-30
- He vibe-codes 60% of his iPhone apps via a Mac mini, Tailscale and Berth — shuyanzh36 · 2026-11-30
- Claude Code takes down a live site with its signature 'I broke the live website' apology — andfanilo · 2026-11-30
- Vibe-coded projects on the timeline are getting noticeably better — generativist · 2026-11-30
- I tested decision models against real engineering rules instead of LLM PR review — Ok-Buyer-9421 · 2026-11-30
- Developer builds a phone-run autonomous research lab that keeps working after disconnect — viksit · 2026-11-30