Get More Out of Claude by Hitting the Cache
With Opus 5.5, a Claude cache miss costs up to 40 times a cache hit: $4 per million input tokens, versus $0.20 per million tokens for a cache read.
By Dillip Chowdary โข Oct 20, 2026 โข Source: dgrcode.com
The source is an explainer of Claude's prompt cache, not a launch note. I'll stick to its names, prices, and token math and check the length before the final piece.An idle Claude session can miss the prompt cache, and a short prompt then burns heavy usage. dgrcode.com's report, dated October 13, 2026, prices an Opus 5.5 miss at up to 40 times a hit: $4 per million input tokens, $0.20 per million on a cache read, and a 1-hour write at twice the input price.
It is for Claude Code and other harness users who resend the system prompt, AGENTS.md content, and skills each turn. It compares /loop with /compact by context size and by how long the pause lasts.
Get More Out of Claude by Hitting the Cache: what actually changed
The cache is temporary storage for a previous prompt's result, and the stored value is an intermediate KV representation. A harness such as Claude Code sends the prompt to Opus with the system prompt, AGENTS.md content, skills, and other context. Claude processes the whole prompt, stores the result, and replies. The next turn sends that context again. Claude reuses the stored result, processes only the new information, and stores the new result. The post calls this a huge performance improvement that still takes limited space.
If Claude has not heard back for some time, it removes that result to free space for others. The next message processes the whole context again. That is a cache miss. A cache hit reuses a result still stored. Models list input and output prices per million tokens, plus cache-read and cache-write prices. Opus 5.5 charges $4 per million input tokens, $0.20 per million for a cache read (20 times cheaper), and 2 times the input price for a 1-hour cache write.
Get More Out of Claude by Hitting the Cache: how it works

If previous tokens are P and new tokens are N, a hit costs P/20 + 2N base input tokens and a miss costs 2(P+N). The ratio is 40(P+N)/(P+40N). Larger P and smaller N push a miss toward 40 times. Claude Code's cache lasts 1 hour after the last write or read. Other harnesses may differ. Sending "wait, I'm still working on this" before expiry keeps it. That line is about 10 tokens, but the previous response and user and system markers can write more than 100 tokens.
Against a miss, that write saves close to 40 times, and at 100,000 tokens the saving is 38.5 times. The first hour costs 2 times base tokens. Each extra hour of hits adds 0.05 times: 1 hour is 2 times, 2 hours are 2.05 times, and 3 hours are 2.1 times, a cost asymmetry. /loop sends a scheduled message. It is not free, yet about 40 loops equal one miss. Cron has no easy "every 50 minutes", so :00 and :30 gives 40 iterations in 20 hours.
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
Get More Out of Claude by Hitting the Cache: why it matters now
In a realistic example with 300,000 tokens of context and a new 1,000-token message, a hit reads 300,000 tokens at 1/20 of base price and writes 1,000 at 2 times: 15,000 + 2,000 = 17,000 base input tokens. A miss writes 301,000 tokens at 2 times, or 602,000 base input tokens, more than 35 times the hit. A larger context and a smaller new message are what push a miss toward the Opus 5.5 ceiling of 40 times in that ratio.
The compaction instruction reads 300,000 cached tokens (15,000 base) and writes about 2,000 tokens at 2 times (4,000), for 19,000. Opus 5.5 prices output at 5 times base input. The author's summaries usually stay under 30,000 tokens, equal to 150,000 base input tokens, and that leg is usually the expensive one. The next write covers the 30,000-token summary, about 30,000 tokens of system prompt and tools, and 1,000 new tokens at 2 times: 122,000. Total 291,000 is about half of 602,000 and far above 17,000.
Get More Out of Claude by Hitting the Cache: who is affected
Claude Code defaults to a 1-hour cache from the last write or read. Other harnesses may use another duration, and /compact's cost follows the harness that sends the instruction. On Claude Code that instruction is about 2,000 tokens. The current context hits the cache, 20 times cheaper than base tokens, while the 2,000 tokens are new. The docs do not make clear whether they skip the write. /context shows the size. System prompt and tools might add 30,000 tokens, and the summary can drop details that later matter.
Rule of thumb: compact on a big context or a long pause, otherwise loop. About 600,000 tokens is big, and 8 hours or more is long. Under 100,000 tokens, managing the cache is overcomplicating things, so it can expire. Over 600,000 tokens, compact, because one would be due soon anyway. Two hours or less means /loop. Sixteen hours or more means /compact. From 8 to 16 hours, compact above 200,000 tokens and loop below that. Under 300,000 tokens after that, loop. At 4 hours or longer, compact.
Get More Out of Claude by Hitting the Cache: what to watch
The 2-to-4-hour range is a gray area. Much longer work in the same session favors /compact. Only a few prompts left to finish favors /loop. The chart compares cache expiry, a looped wait message, and compaction as cumulative base input tokens for the pause and the first 10 messages after it. The sample uses a 300,000-token context, 2,000-token messages, a 4-hour pause equal to 8 loop iterations, and a 30,000-token summary. A flow diagram credited to Claude maps /loop against /compact.
After compacting, each later message reads about 60,000 cached tokens instead of 300,000 and costs about 5,000 base input tokens instead of 17,000. After enough messages, compacting pays for itself. Timing depends on context size, summary size, and how long a loop would run. The author first saw the 40-times gap as hidden treasure in the /loop strategy, then set /loop beside /compact. /loop stays the pick for a long lunch or an errand. A big context points to /compact.
Developer Action Items
- โ Verify the claim on the official Claude / Opus page (or HN Claude/Codex/Fable), not from this recap alone.
- โ Name the surface that moved โ API, policy, model, hardware, or commercial terms โ before you Slack the thread.
- โ Assign one owner a day to read the primary material and decide: this-sprint, this-quarter, or noise.
- โ Do not change production on day-one coverage. Watch the vendor changelog and one independent write-up first.
Get More Out of Claude by Hitting the Cache FAQ
How much more does an Opus 5.5 cache miss cost than a cache hit?
Up to 40 times. Opus 5.5 costs $4 per million input tokens and $0.20 per million on a cache read, which is 20 times cheaper, while a 1-hour cache write costs twice the normal input price.
What is a Claude cache hit versus a cache miss?
A hit reuses the stored KV result and processes only the new tokens. A miss means Claude removed that result, so the whole context is processed again.
How long does the Claude Code prompt cache last?
One hour after the last write or read, by default. Other harnesses may use a different duration. A line such as "wait, I'm still working on this" can refresh the cache before it expires.
How many Claude Code /loop runs equal one cache miss?
About 40. A ping of about 10 tokens can still write more than 100 tokens. Cron has no simple "every 50 minutes", so running at :00 and :30 gives 40 iterations in 20 hours.
When should Claude Code use /compact instead of /loop?
Compact near 600,000 tokens, or when a pause lasts about 8 hours or more. Under 100,000 tokens, let the cache expire. A pause of 2 hours or less favors /loop, and 16 hours or more favors /compact.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement