Dinoradar  /  Blog  /  Prompt caching
CostBy Updated July 20267 min read

How Claude Code prompt caching works

It's the biggest saver on your Claude Code bill, it runs automatically, and you almost certainly can't see it. Here's what caching does, how to keep it working for you, and how to measure it.

WRITE ONCE, READ MANY turn 1 cache write · ~1.25x turn 2 read · ~0.1x turn 3 read · ~0.1x turn 4 read · ~0.1x One expensive write pays for many cheap reads — that's the whole trick.

The short answer

  • What it is: Claude Code caches the stable prefix of your prompt so repeated context is re-served instead of reprocessed. It's automatic.
  • Why it saves: cache reads cost ~10% of full input price; a write costs ~1.25× but happens once.
  • Keep it hot: work steadily (entries expire after a few minutes idle) and don't reshuffle your context mid-session.
  • You can't see it by default: the savings are real but invisible in the terminal — you have to measure the token split.

Why caching exists at all

The Anthropic API is stateless: it has no memory between calls, so Claude Code re-sends the entire conversation — system prompt, loaded files, every earlier message — as input tokens on every single turn. On a long session that means paying for the same big context over and over.

Prompt caching is the fix. Instead of reprocessing that repeated prefix each time, Anthropic stores it and re-serves it from cache. You still send it; you just don't pay full price to have it processed again.

The three token types caching creates

Token typeWhen it happensRelative price
Normal inputNew text this turn
Cache writeStoring context the first time~1.25×
Cache readRe-serving stored context~0.1×

The economics are lopsided in your favor: you pay a small premium once to write, then a deep discount every turn after to read. The more turns a session runs on the same context, the more the math tilts toward you.

Where the big savings hide: long sessions on a large, stable context — a big file loaded, a detailed system prompt. That's exactly the setup where naive billing would be brutal, and caching is doing the most work. It can be the difference between a $30 day and a $12 one.

How to keep the cache hot

Caching is automatic, but a few habits keep it working:

  1. Work steadily. A cache entry expires after a short idle window (on the order of a few minutes by default). Keep going and it stays warm; step away for a while and the next turn pays to write it again.
  2. Keep stable context stable. The cache covers a prefix. Change something early — swap the loaded file, edit the system context — and everything after that point is invalidated and must be re-written. Rearranging your context mid-session quietly costs you.
  3. Front-load the stable stuff. Put the things that won't change (instructions, reference files) early and the things that do change late, so the cacheable prefix stays as long as possible.

You don't need to micromanage this — Claude Code handles the mechanics. But understanding it explains why a session where you kept momentum cost less than one where you kept reloading things. Caching is only one lever, too — there are other ways to reduce Claude Code costs.

The catch: it's invisible

Here's the frustrating part. All of this happens silently. Claude Code records cache-creation and cache-read token counts in its local transcripts, but nothing in the terminal totals up what caching saved you. Your cache hit rate — the share of prompt-side tokens served from cache — is one of the most useful numbers you have, and it's nowhere in view. (More on that in how to read your usage.)

This is exactly what Dinoradar surfaces. It reads those cache token counts from your local history and shows, per session and per week, how much prompt caching actually saved you — plus your cache hit rate over time, so you can tell a warm session from a cold one. Try it free →

Frequently asked

What is prompt caching in Claude Code?+

It stores the stable prefix of your prompt — system instructions, loaded files, earlier conversation — so the next turn re-serves it from cache instead of reprocessing at full price. Since Claude Code re-sends the whole conversation every turn, caching turns most of that repeated context into cheap reads. It's automatic.

How much does prompt caching save?+

Cache reads cost roughly a tenth of normal input tokens. A cache write costs a bit more than normal input (~1.25×), but you write once and read many times. On long sessions re-sending the same context, that can turn full-price input into ~10%-price reads — often a $30 day becoming a $12 one.

How do I keep the Claude Code cache hot?+

A cache entry expires after a short idle window (a few minutes by default), so working steadily keeps it warm. Long pauses let it expire and the next turn re-writes it. Keeping your stable context stable helps too — any change to the prefix invalidates the cache from that point on.

How can I see how much prompt caching saved me?+

Claude Code records cache-creation and cache-read counts in local transcripts, but the terminal never totals the savings. Dinoradar reads those counts and shows, per session and per period, how much caching saved you and your cache hit rate over time.

See what caching quietly saved you.

Dinoradar reads your local history and shows cache savings and hit rate over time — the number the terminal never tells you. Free forever · Pro $29 once.