Why does Claude Code lose its prompt cache?

Updated 25 November 2026

Claude Code sends your whole conversation with every request and reads most of it back from a prompt cache at a much lower rate. When that cache is lost, the next request reprocesses everything at full price. Two things cause it: a pause longer than the cache lifetime, and a few actions that change the start of the request.

How long does the cache last?

Five minutes or one hour after the last request that used it, and every hit resets the timer. By default the main conversation gets one hour on a Claude subscription within its included usage, and five minutes with an API key, a cloud provider or usage credits. Subagents and compaction requests get five minutes in most setups.

So the expensive moment is the first message after a break: back from lunch to a long session, and the whole history is read in again uncached.

Which actions reset the cache?

Which actions are safe?

Editing your files or CLAUDE.md, changing permission mode or output style, running skills and commands, /recap, /rewind and starting a subagent all keep the cache.

What helps?

How do I see how often it happens to me?

Inside a session, /usage shows the Prompt cache line with misses and whether the cache is warm. Across past sessions, Quotopsy counts each rebuild, says whether it followed an idle gap, and estimates what it cost:

npx quotopsy

The usage limit guide covers the other common causes.

Questions

How long does the Claude Code prompt cache last?

Five minutes or one hour after the last request that used it. On a Claude subscription within its included usage, the main conversation gets one hour by default; with an API key, a cloud provider or usage credits it gets five minutes. Each cache hit resets the timer.

Can I make the cache last longer?

Yes. Set promptCacheTtl to 1h in your settings (Claude Code 2.1.242 or later). The one-hour cache charges more for cache writes, so it pays off when you pause often and costs more when you never do.

Does editing CLAUDE.md break the cache?

No. Claude Code reads it at session start, so a mid-session edit keeps the cache and takes effect after /clear, /compact or a restart.

How do I see my cache misses?

Run /usage: the Prompt cache line shows hits, misses and whether the cache is warm, and from 2.1.260 a likely cause for the last miss. npx quotopsy counts rebuilds across past sessions and estimates what they cost.

Sources

Read on 25 November 2026. Quotopsy is an independent project, not made or endorsed by Anthropic.