The idle-gap tax: what happens when you leave a session for 5 minutes
Claude’s default prompt cache lives 5 minutes. Step away longer and the next turn rewrites the entire context at the cache-write price. See what that costs and how to avoid it.
The default cache entry lives 5 minutes, refreshed every time it is read. While you and the agent keep going, the context is read cheaply on every turn.
Leave for a meeting, come back and type “continue”, and the entry has expired: the whole context is written again. At 120k tokens on Sonnet 4.6 that is about $0.45 for one turn, on Opus 4.8 about $0.75, compared with a few cents for a hit.
Long-lived sessions are where this adds up: five breaks in a day-long session can cost more than the work itself.
How to fix it
- Finish a thought before stepping away, or /clear and start a fresh session when you return.
- For long reviews where pauses are expected, the 1-hour cache costs 2x input to write but survives the break.
- Keep sessions short and task-sized: a small context makes a miss cheap.
See it in your own session
Drop the session file below. Every step this applies to is flagged on the receipt with what it cost and what fixing it would have saved.
Itemize your own session
Drop a Claude Code or Codex log. It is parsed in your browser, and you get your real numbers instead of a model.
Drop a session log here
Claude Code ~/.claude/projects/…/*.jsonl, a Codex rollout ~/.codex/sessions/…/rollout-*.jsonl, or the claude-code-action execution file.
Parsed in your browser. Your prompts and code never leave this tab.