I analyzed 568 of my own Claude Code sessions — my cache re-sends 330K tokens every turn, and the math on it surprised me
I got curious about something I couldn't find a straight answer to: Claude Code's prompt cache has two TTL options — 5 minutes and 1 hour — and I had no idea which one I was actually running on, or whether it mattered. So I wrote a small CLI that reads my own local session transcripts and does the math.
I'm on a subscription plan, not the API, so there was nothing for me to "enable" — subscribers get the 1-hour cache automatically. But the tool still tells you what that's worth. Over the last 90 days, across 568 sessions and 40,977 turns, my 1-hour cache saved me ~$2,608 in API-list-rate-equivalent value versus what a 5-minute cache would have cost on the exact same usage. That's not a bill I paid — subscription pricing doesn't work that way — but it's the same tokens, priced the same way, so it's an honest apples-to-apples number for "how much cache TTL matters."
The number that actually reframed things for me: my average turn re-sends 330K tokens of conversation prefix. Multiply by 40,977 turns and my cache served 13.5 billion tokens of re-sent context in 90 days — work that would meter at roughly $84k of API-value uncached, and metered ~$16k with the cache. In the currency a subscriber actually feels: the same work on a 5-minute cache would have consumed ~10% more of my usage limit, and with no cache at all, ~5.2× — which is also the honest answer to "how does a fixed-price plan absorb this much usage." (One stated assumption behind the limit framing, documented in the repo's METHODOLOGY: subscription usage is metered cost-weighted at API-value rates. The tool never claims a % of the absolute limit — that formula isn't public.)
The tool also breaks down where the cache leaked — recoverable misses attributed to a specific cause, not just a vague "efficiency" number:
- Model switches invalidated 63.9M tokens of cache ($476.77)
- My single worst re-warm was a 712K-token miss that cost $8.16 in one turn
- My worst single day leaked $45.60
- Overall efficiency score: 98.5 / 100 (my R/C ratio — the share of cache-write tokens that fell in the "avoidable" bucket — was 14.2%, well under the 39.5% break-even where a 5-minute cache would actually start winning)
The break-even number is the part I actually think is interesting, independent of my own results: cache writes cost a markup over a normal input token (1.25x on the 5-minute TTL, 2x on the 1-hour TTL), reads cost a discount (0.1x). Work through that algebra and there's a single threshold — 39.47%, derived as (2 − 1.25) / (2 − 0.1) — where the two TTLs cost exactly the same for a given usage pattern. Below it, 5-minute wins. Above it, 1-hour wins. It's not a simulation or a guess, it's a threshold your own billed tokens either cross or don't.
If you're on the API (not a subscription), the same tool tells you which side of that line you're on and, if 1-hour would save you money, offers to flip the env flag for you — one confirmation, backs up your settings file first, and verifies afterward that the flag actually landed (there's a known intermittent issue where the flag doesn't always take effect immediately — linked in the repo — so the tool re-checks your actual transcripts rather than just trusting the setting).
It's free and MIT-licensed — an npx one-liner, zero dependencies, and it reads only token counts and timestamps out of your local transcripts — never your prompts or Claude's replies, never sends anything over the network. That was non-negotiable for me before I'd point it at my own history, so I built it that way and you can read the ~2,000 lines of TypeScript yourself if you want to check.
npx cache-refund
Sample output (this is --compact, my own numbers, captured tonight):
cache-refund - score 98.5/100 (excellent)
R/C = 14.2% recoverable (break-even 39.5%) - 1h is already yours OK
biggest miss: 712K-token re-warm - $8.16-eq in one turn
worst day: 2026-06-10 - $45.60-eq leaked
> Model switches invalidated 63.9M tokens of cache ($476.77-eq).
> Worst day: 2026-06-10 leaked $45.60-eq (7.0M tokens) to expired cache.
share: npx cache-refund card - #cacherefund
(The interactive run ends by dealing a shareable receipt card, and if you take the share prompt it generates the card as an image and puts it straight on your clipboard — the screenshots in the comments here are that.)
Repo: https://github.com/m8t-labs/cache-refund
Genuinely curious what other people's R/C ratios look like — if you're way above 39.5% and still on the 5-minute default, that's real money. And if you've hit a number that looks wrong, please tell me — there's a priority-lane issue template for exactly that, because I'd rather know than have a wrong number floating around.
Posted Jul 10, 2026, 7:34 PM UTC