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
- Skip the deck: present with Codex Sites and embed live demos instead — gabrielchua · 2026-10-15
- Geoffrey Huntley: hand-typing code is over—delete your skills, engineer the loop — rseroter · 2026-10-15
- AI coding agent deletes production database in 9 seconds; Keycard calls for task-based agent auth — matt_slotnick · 2026-10-15
- vLLM's bitwise-consistent RL: zero KL on Nemotron NVFP4, 91.3% throughput on DeepSeek-V4-Flash — DynamicWebPaige · 2026-10-15
- vLLM achieves bitwise-consistent RL training: DeepSeek-V4-Flash hits 0 diff over 100 steps — vllm_project · 2026-10-15
- ChatGPT Sites + MCP Events + dots: A Workflow-Triggered Agent Pattern — gabrielchua · 2026-10-15