# Claude's 5-minute cache timer quietly eats 23% of your coding bill

Original title: Claude's 5-minute timer is 23% of your coding bill

> Hacker News story 50717029 · language: en · submitted 2026-12-01
> Web version: https://zeli.app/story/50717029
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 454 · by [danvdb](<https://news.ycombinator.com/user?id=danvdb>) · 💬 202
[original](<https://www.requesty.ai/blog/claude-5-minute-prompt-cache>) · [HN discussion](<https://news.ycombinator.com/item?id=50717029>)

## Summary

A 30-day analysis of coding-agent traffic across Claude Code, OpenCode, Codex, Pi, and Kilo found that 23.1% of Claude's total bill went to rebuilding prompt caches that expired during developer breaks, versus 9.3% on GPT models. Both labs charge identical per-token cache multipliers, so the gap comes entirely from default TTL: Claude expires caches after 5 minutes, GPT after 30. Breaks of 5 to 30 minutes cost Claude 15.2% of the bill and GPT just 0.8%.

## Key quote

> On Claude, pauses between 5 and 10 minutes eat 8.0% of the entire coding bill. That single five-minute slice costs more than every break over an hour combined.

## HN discussion (202 comments)

### [Wowfunhappy](<https://news.ycombinator.com/item?id=50719224>)

> I find it really weird that Anthropic uses only a five minute cache on the API. Even in the course of active work, many commands—compiling, running tests, etc—take longer than five minutes to complete.
>
> I of course don't know what it costs Anthropic to keep the cache warm—but since their subscription plans use one hour, Anthropic must have concluded a longer cache is more economical for most users. And there's a big difference between one hour and five minutes.

### [Aurornis](<https://news.ycombinator.com/item?id=50719487>)

> On a subscription plan (not API requests) Claude Code defaults to 1-hour cache duration for the main conversation and 5 minutes for subagents.
>
> So if you're not paying API rates, you need not worry. You can force the main conversation or subagents to either 5 minute or 1 hour in the Claude settings file if you would like.
>
> If you are paying API rates, paying close attention to caching is important. 1 hour is best for sessions where you have to think a lot, examine output, or wait for long builds because 5 minute interruptions are very common. The price premium for 1-hour TTL isn't that high over 5-minute, so I use it by default.
>
> It's also good to get in the habit of doing /compact when you know you might be AFK for more than the cache TTL. Doing the /compact on a long context conversation after the cache has expired is much more expensive.

### [whatifitoldyou](<https://news.ycombinator.com/item?id=50719137>)

> Is there a pi plugin for resetting the keepalive? Sounds simple enough. From the article:
>
> What is a keep-alive ping for prompt caching?
>
> \-
>
> You send the last request again with max_tokens set to 0 about every 4.5 minutes. The API reads the cached prefix, returns no output tokens and restarts the cache timer. In our replay, keep-alive pings capped by session depth cut a Claude coding bill by about 8 to 9% net.

### [compiler-guy](<https://news.ycombinator.com/item?id=50719425>)

> Everything old is new again. Something similar was a time honored technique for getting an OS scheduler to keep a long-running task at interactive priority by writing a character to the console every so often, so it looked like an interactive process.
>
> How to defeat these countermeasures used to be covered in os courses. I suspect the llm vendors will adopt similar techniques.
>
> https://algomaster.io/learn/operating-systems/multilevel-que...

### [8cvor6j844qw_d6](<https://news.ycombinator.com/item?id=50718740>)

> If I'm not mistaken, on subscription plans your main agent defaults to 1 hour cache with subagents spawned by the main session on 5 minute cache timer.
>
> Best ensure your subagents avoid getting blocked if there's any wait or command that takes more than 5 minute.

### [jueyi4](<https://news.ycombinator.com/item?id=50722014>)

> I prefer 1 hour because I think it is more effecient

### [bensyverson](<https://news.ycombinator.com/item?id=50718286>)

> Isn't Claude Code on a 1hr cache?

### [shllg](<https://news.ycombinator.com/item?id=50721422>)

> I wrote an article about claude subscription vs. API usage on that 5min ttl topic a couple of days ago: https://hillig.dev/blog/2026/11/one-hour-prompt-cache

---

## Cite

- Page: https://zeli.app/story/50717029
- Date: 2026-12-01
- Source: requesty.ai (https://www.requesty.ai/blog/claude-5-minute-prompt-cache)
- Hacker News: https://news.ycombinator.com/item?id=50717029

## Other languages

- zh: https://zeli.app/zh/story/50717029 · markdown: https://zeli.app/zh/story/50717029.md
- ja: https://zeli.app/ja/story/50717029 · markdown: https://zeli.app/ja/story/50717029.md
- ko: https://zeli.app/ko/story/50717029 · markdown: https://zeli.app/ko/story/50717029.md
- de: https://zeli.app/de/story/50717029 · markdown: https://zeli.app/de/story/50717029.md
- es: https://zeli.app/es/story/50717029 · markdown: https://zeli.app/es/story/50717029.md
- ru: https://zeli.app/ru/story/50717029 · markdown: https://zeli.app/ru/story/50717029.md
