Your agent's prompt cache expires while you review the diff

Requesty's 30 days of coding-agent traffic show 23.1% of Claude API spend going to rebuilt prompt caches - most of them expired during five-to-thirty-minute pauses while a developer read a diff. The five-minute TTL, the fixes that actually return, and the two that cost more than they save.

Your agent's prompt cache expires while you review the diff

A gateway vendor spent 30 days watching coding agents spend money. The biggest cost category was not code generation — it was waiting for a human.

Requesty analysed production traffic from 24 October to 22 November 2026 across Claude Code, OpenCode, Codex, Pi and Kilo, on Anthropic's API, Bedrock, Vertex, OpenAI and Azure. By its numbers, 23.1% of the total Claude coding bill went to rebuilding prompt caches that had expired while the developer was away. On GPT models, same window, same tools: 9.3%.

Concretely: on a Claude Opus 5.5 session carrying 210,000 tokens of context, an eight-minute break turns a $0.04 cache read into a $1.05 cache write. That happens on roughly 81% of Opus 5.5 pauses in the five-to-thirty-minute band. For a 20-person team, Requesty estimates about $1,380 a month in extra rebuilds, at four short breaks per developer per working day.

Anthropic's answer, to The New Stack, is fair: the five-minute cache costs less to write, so it wins when requests arrive close together — which is what happens while an agent loops, and its own tests found it 15% to 19% cheaper at second-scale intervals. True, and beside the point once a human is in the loop.

The clock starts when the request does

Prompt caching is prefix reuse: write the tokens once at 1.25x the input rate, read them afterwards at 0.05x. In production that brings Claude coding bills to roughly 17% of list price. The mechanism only works while the prefix is still there.

On Anthropic's API and Vertex, the five-minute clock starts when a request begins, not when the response ends. A reasoning turn that runs four minutes leaves about a minute to read the diff and send the next message. Miss it and the entire prefix is rewritten. Requesty measured the hit rate falling from around 98% to under 7% just past five minutes — a cliff, not a slope.

That fact reframes a decision most teams made on quality grounds. If your harness makes a developer inspect a diff and approve a tool call before the agent continues, you have put a pause of unknown length in front of a billing event. Careful review is correct engineering, and it is also what your invoice now measures. As Anthropic put it, developers should take the time they need — the point is to stop charging them 25 times over for it.

The pauses you would never call pauses

The intuition is that cost comes from closing the laptop overnight. The data says otherwise. Pauses of five to ten minutes alone eat 8.0% of the Claude coding bill — more than every break longer than an hour combined, at 5.3%. Half of all pause losses fall within fifteen minutes of the last message, two-thirds within thirty.

Past thirty minutes both families' caches are gone and the curves converge: 7.8% of Claude spend, 8.5% of GPT spend. Between five and thirty minutes, Claude loses 15.2% and GPT 0.8% — a TTL difference, not a model difference: GPT-6.1 Sol held a ~96% hit rate until about 27 minutes, while Sonnet 5.5 missed 81.2% of the time, at identical $2/$10 per-million pricing. Per-pause cost scales with context, so it lands hardest where agents earn their keep: $0.86 on Opus 5.5 against $0.008 on GPT-6.1 Sol.

What the fixes actually return

Keep-alive pings. Resend the last request after 4.5 minutes idle with max_tokens at zero and streaming off, which reads the prefix and resets the timer. Modelled saving: 8% to 9% net, the largest of the four. It needs the stored request body and the same provider, region and credentials, breaks with extended thinking, structured outputs, forced tool choice or Message Batches, and loses money on 43% to 52% of long sessions individually — so cap pings by turn depth rather than pinging indefinitely.

Cold switch to one hour. A one-hour write costs 2x instead of 1.25x. Doing it from turn one raises cost for 87% to 89% of sessions, because about 76% of conversations finish inside five minutes — even though sessions over an hour are roughly 80% of spend. Waiting until the five-minute entry has lapsed and then sending with one-hour markers returned an estimated 5% to 7%.

Never upgrade a warm cache mid-session. Sending a one-hour marker against a warm five-minute cache read zero tokens and rewrote the whole prompt at 2.0x in Requesty's live tests on the Anthropic API and single-region Vertex. Bedrock behaved differently in all four runs, which makes it a trap rather than a feature.

Split the TTL by content. Static system prompt and tool schemas on one hour, messages on five minutes, from turn one. One-hour markers must precede five-minute ones or the request fails with HTTP 400.

Anthropic made this settable in Claude Code (v2.1.242+) via promptCacheTtl and subagentPromptCacheTtl; the default is already conditional on how you pay.

The checklist

  • Pull your usage logs and count continuing turns more than 300 seconds after the previous request where cache_read_input_tokens collapses and cache_creation_input_tokens spikes to full prompt size. That count is your pause bill, in tokens.
  • Give that number a FinOps line of its own, per team and per agent.
  • Upgrade to Claude Code v2.1.251+ and read /usage; export cache read and creation tokens per session over OpenTelemetry, so you see pauses rather than totals.
  • Pick the TTL per workload from pause patterns, not average session length: interactive review threads deserve an hour, CI subagents do not.
  • Apply the policy at turn one. Switching halfway through a warm conversation is the expensive mistake.

It is a timer, not exotic infrastructure, and it belongs in the budget next to everything else — especially once agent spend is a per-seat line item. If you are building agents with human approval steps, our engineering team reviews this cost model before teams scale seats, and the same harness discipline is what we teach in the FDE program.


Source: Requesty's analysis of 30 days of coding-agent traffic, reported by The New Stack. Figures are the study's own and are shares of coding-agent API spend in that window. Header image: "A sample Grafana dashboard" by Joel Kennedy, public domain, via Wikimedia Commons.