Does a break cost tokens? Claude Code’s prompt cache and your pauses
On a Claude subscription, no. Claude Code keeps your conversation’s prompt cache for an hour, so a five- or fifteen-minute break doesn’t cool it. With an API key, usage credits or a cloud provider, the cache lives five minutes, and the first message after a longer pause re-reads your whole context at the cache-write price. Here’s how the cache works, what a cold one costs, and what to do before you step away.
- How long the cache lives
- What the cache does
- What a cold cache costs
- What to do before a break
- What cools the cache without a break
- Check if your cache is warm
- Questions
How long the cache lives
Claude Code picks the cache lifetime, the TTL, for every request. By default:
| Requests | Claude subscription, within plan usage | API key, usage credits or cloud provider |
|---|---|---|
| Your conversation with Claude | 1 hour | 5 minutes |
| Subagents, workflows, compaction, session titles | 5 minutes (a few helper requests get 1 hour) | 5 minutes |
“The cache lives five minutes” is the most repeated line about Claude Code, and on a subscription it’s wrong. Five minutes is the API’s default. Claude Code asks for the one-hour TTL on a subscription for your main conversation. Two exceptions: subagents still get five minutes, and once you go over your plan’s limit and draw on usage credits, the main conversation drops to five minutes too, because the shorter cache is cheaper to write.
Each request that hits the cache resets the timer. The clock runs whenever no request goes out: you’re on a break, the session is waiting for your answer, or a long command is still running.
What the cache does
The model doesn’t remember anything between requests. Each time you send a message, Claude Code sends the whole context again: the system prompt and tools, your CLAUDE.md and memory, every earlier message and tool result, and your new message. The cache lets the API reuse what it already processed and work only on what changed.
It matches the start of the request exactly. Anything that changes early in the request, like the tool list or the model, makes everything after it uncached. Anything added at the end, like a new message or a file Claude reads, keeps the rest cached.
What a cold cache costs
When the cache has expired, the next request reprocesses the full context and writes it to the cache again. That turn is noticeably slower and more expensive. Afterwards the cache is warm again.
With an API key, here’s the difference for one session with 150,000 tokens of context on Opus 5.5, at Anthropic’s prices in November 2026:
| Your next message after… | The 150,000 tokens are billed as | Cost |
|---|---|---|
| A 3-minute pause (cache warm) | Cache reads, $0.20 per million | $0.03 |
| A 10-minute break (5-minute cache expired) | Cache writes, $5 per million | $0.75 |
One break, one session: 75 cents instead of 3 cents. With four sessions open and eight breaks a day, it adds up to a real line on the bill. Your new message and Claude’s answer cost the same either way.
On a subscription you don’t pay per token. Anthropic doesn’t publish how cached and uncached tokens weigh against plan limits; its documentation only says the turn after a miss is slower and more expensive. A break under an hour doesn’t cause a miss.
I take a short break between pomodoros with several sessions open, and on a subscription that’s free. The expensive case is lunch: an hour or more away from a long conversation.
What to do before a break
- Short break on a subscription: nothing. Five, fifteen, even thirty minutes stays inside the hour.
- A break longer than an hour, mid-task: run
/compactbefore you go. Compacting reads the conversation from the cache while it’s warm, so it costs a fraction of the context size. After the cache expires, the same/compactreprocesses everything uncached, which is why compacting an old session costs the most. (When to compact and when to clear.) - Done with the task? Start the next one with
/clearor a new session after the break. There’s no cache worth keeping. - On an API key and you break often: set
"promptCacheTtl": "1h"in your settings, orCLAUDE_CODE_PROMPT_CACHE_TTL=1h. The trade-off: one-hour cache writes cost 2× the input price instead of 1.25×, so it pays off only if you actually leave sessions idle for more than five minutes. For subagents there’s a separatesubagentPromptCacheTtl. Both need Claude Code 2.1.242 or later. - Claude Code may compact for you. When a long conversation on the one-hour cache sits idle, Claude Code can compact it on its own.
"idleCompaction": falseturns that off.
You’ll also find scripts that ping a session every few minutes to keep its cache warm. Each ping is a request that reads your whole context. On a subscription they save nothing within the hour, and every ping is one more request against your plan.
What cools the cache without a break
Some actions in the middle of a task cost one slow, uncached turn, even if you never left the desk:
- Switching models with
/model. Each model has its own cache. Claude Code asks you to confirm while the cache is warm. - Changing effort level, on most models. On Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1 with an API key or a subscription, the cache now survives it.
- Turning fast mode on or off. Fast and standard speed keep separate caches.
- Compacting, by design: the history is replaced by a shorter summary.
- Upgrading Claude Code. The first session after an update builds its cache from the top.
Editing files, editing CLAUDE.md, changing permission mode, running skills and spawning subagents keep the cache. So does /rewind, which jumps back to a point that is already cached. Pick the model and effort at the start of a session, and save /compact for natural breaks.
Check if your cache is warm
/usageshows a Prompt cache (main) line after the first response: the hit ratio, the number of misses, whether the cache is warm right now, and often the likely cause of the last miss. It needs Claude Code 2.1.251 or later.- Your status line can show the same numbers: the script gets them in a
prompt_cacheobject, next to the token counts (set up a status line). - Which TTL you get: run
claude -p "hello" --output-format jsonand look atusage.cache_creation. One-hour writes show up asephemeral_1h_input_tokens, five-minute ones asephemeral_5m_input_tokens.
Where Meowdoro fits
We built Meowdoro, a focus timer around the MacBook notch for people who work with Claude Code and Codex. Each session gets a ring that shows how full its context is. When one is filling up, the break card says so, which is the cheap moment for /compact: the cache is still warm and you’re about to step away anyway. Meowdoro doesn’t warm the cache and never sends anything to your agents. Rest is free on a subscription; Meowdoro just tells you when to take it. Try it and tell us what’s missing.
Questions
How long does Claude Code’s prompt cache last?
One hour for your main conversation on a Claude subscription within plan usage. Five minutes with an API key, usage credits or a cloud provider, and for subagents everywhere. Each request that hits the cache resets the timer.
Does taking a break cost tokens in Claude Code?
On a subscription, not if the break is under an hour. With an API key, a break longer than five minutes means your next message re-writes the whole context to the cache: for 150,000 tokens on Opus 5.5, about $0.75 instead of $0.03.
Should I set promptCacheTtl to 1h?
On a subscription you already get an hour. With an API key it helps if you often leave sessions idle for more than five minutes; it costs more if you work in short, continuous bursts, because one-hour cache writes are priced at 2× the input price instead of 1.25×.
Does /compact reset the cache?
It replaces the conversation history, so that part of the cache is rebuilt from the shorter summary. Compacting while the cache is warm is cheap; compacting after it expired reprocesses the whole conversation.
Why is my first message after a break so slow?
The cache expired, so Claude Code reprocessed your full context. The next turns are fast again.
Related guides
How the cache works and the TTL defaults: the Claude Code documentation on prompt caching, read on November 9, 2026. Prices and multipliers: the Claude API documentation on prompt caching, read on November 9, 2026; the example counts only the 150,000 tokens of existing context.