- In short
- Prompt caching reuses a stable prompt prefix so repeated requests avoid reprocessing it, cutting cost and latency. Cache checkpointing marks reusable boundaries within a long, growing context. Caching optimizes cost and latency, not output quality, and it only pays off when the cached prefix stays stable.
Reuse the work you already paid for
Caching is the most direct lever for cutting cost on a Claude application, and it works by not paying twice for the same computation. When a request comes in, the model processes the entire input before generating a reply, and that processing is where much of the input cost comes from. Prompt caching reuses a stable prompt prefix so repeated requests avoid reprocessing it. If the front portion of your input is identical across many calls - a long system prompt, a set of instructions, a reference document, a tool schema - caching lets the model reuse the processing it already did on that prefix instead of redoing it every time.
This only makes sense as an optimisation once you can see where your input tokens go, which is why token usage tracking is the hard prerequisite. A feature whose cost is dominated by a large, repeated input is a prime caching candidate, and it is exactly the kind of feature a per-feature cost model flags. Caching turns that repeated, already-tracked input from a cost you pay on every call into one you largely pay once.
- Prompt caching and cache checkpointing
- Prompt caching reuses a stable prompt prefix that has already been processed so repeated requests skip reprocessing those tokens, cutting cost and latency. Cache checkpointing marks reusable boundaries within a long, growing context so the stable part up to a checkpoint can be reused while new content is appended after it. Both optimise cost and latency, not output quality.
The prefix has to be stable
The entire mechanism hinges on one condition: the cached part must be a stable prefix. Caching works from the front of the input forward, reusing processing up to the point where the input first differs from what was cached. The moment something changes before that boundary, the cache no longer matches and cannot be reused from that point on. This is why the structure of your prompt, not just its content, decides whether caching pays off.
The practical rule that follows is about ordering. Put the stable, reused material at the front - system prompt, fixed instructions, reference documents, tool definitions - and put the variable, per-request material after it, such as the specific user message or the changing query. Structured that way, the large stable prefix is reused on every call and only the small variable tail is processed fresh. Invert that ordering, and you get the first exam trap: volatile content sitting inside the prefix invalidates the cache on every request, so you get no hits and pay full price while thinking you optimised. The deeper mechanics of how the boundary is declared and matched are covered in prompt caching mechanics; this knowledge point is about using caching as a cost lever and structuring content so it actually hits.
Checkpointing a growing context
A single stable prefix is the simple case, but many real applications have a context that grows over time - a long agent session, an extended conversation, a document being built up turn by turn. For these, cache checkpointing marks reusable boundaries within a long, growing context. Instead of one fixed prefix, you place checkpoints at points that will stay stable, so that everything up to a checkpoint can be reused while new content is appended after it. As the context grows, earlier portions remain cached and only the newly added material needs fresh processing.
Checkpointing matters because without it a growing context would defeat caching entirely: every new turn changes the end of the input, and if you had no intermediate boundaries you would only ever cache a shrinking useful fraction. By marking boundaries at stable points, checkpointing keeps the large, settled early portion of a long context reusable across many turns. It is the same principle as the stable-prefix rule applied repeatedly along a context that is being extended rather than replaced, and it is what makes caching effective for long-running sessions rather than only for single-shot prompts with a fixed preamble.
Caching changes cost, not answers
The second thing the knowledge point insists on is a boundary of a different kind: caching optimizes cost and latency, not output quality. A cache hit means the model reused already-processed tokens to reach the same result faster and cheaper. It does not, and cannot, change what the model would have said. The response is identical to the uncached one; only the cost and latency of producing it fall. This is the property that makes caching safe to apply liberally, because unlike moving to a smaller tier, it never risks the quality floor from quality, latency, and cost tradeoffs.
It is also the source of the second exam trap: expecting caching to change the model's answers rather than the cost of producing them. Candidates sometimes reason as if a cache stores answers and serves them back, so that caching would make responses more consistent or somehow "better". That is not what prompt caching is. It caches the processing of the input prefix, not the output, so it has no effect on the content of the reply. Keeping these two axes straight - caching moves cost and latency, never quality - is central to answering questions on this knowledge point correctly.
Misconception
Prompt caching makes the model's answers more consistent or higher quality.
What's actually true
Misconception
Turning on caching always reduces cost, regardless of how the prompt is structured.
What's actually true
Worked example
A support assistant sends Claude a 6,000-token knowledge base plus fixed instructions on every request, followed by the customer's question. To save money the team enables prompt caching, but their bill barely changes and cache hits are near zero. They also hoped caching would make answers more consistent.
Diagnose the miss against the stable-prefix rule. Caching only reuses a prefix that is byte-for-byte stable across requests, and the team almost certainly has volatile content sitting inside that prefix - a timestamp, a request ID, a per-customer greeting, or the customer's question placed before the knowledge base rather than after it. Any of these changes the front of the input on every call, so the cache boundary is invalidated immediately and no reuse happens. That is the first trap: they enabled the feature but structured the prompt so it can never hit.
The fix is to reorder. The 6,000-token knowledge base and the fixed instructions are the stable material, so they belong at the very front as the cached prefix, with nothing variable interleaved among them. The customer's question and any per-request metadata go after that prefix. Now the large, expensive knowledge base is processed once and reused on subsequent calls, and only the short variable tail is processed fresh each time. Because their tracked usage showed input cost dominated by that repeated knowledge base, this reordering is exactly where the cost model said the savings were.
Their second hope is a misconception to correct directly. Caching will make the responses cheaper and faster to produce, but it will not make them more consistent, because it does not cache or alter the output at all - it reuses input processing and returns the same answer the model would have given anyway. If they want more consistent answers, that is a prompting or model-configuration question, not a caching one. Separating those two axes, cost-and-latency versus quality, is the apply-level judgement this knowledge point is testing.
Putting it to work
Caching is the concrete optimisation that closes task statement 5.4. It depends on token usage tracking to reveal the large, repeated inputs worth caching, it is the lever a cost model most often points to, and it complements the tier and option choices in quality, latency, and cost tradeoffs by cutting cost without touching the quality floor. For the underlying mechanics of declaring and matching cache boundaries, prompt caching mechanics goes deeper.
To apply it under exam pressure, hold two rules. First, caching only helps when the cached prefix is stable, so structure prompts with the fixed material at the front and all volatile content after it, and use checkpoints to keep a growing context reusable. Second, caching moves cost and latency, never output quality, so any answer that expects caching to change what the model says is wrong. Get those two straight and both traps the exam plants become easy to see.
A team enables prompt caching to cut the cost of a feature that sends a large fixed instruction block on every call. Cache hit rates stay near zero. Investigation shows each request begins with a unique request ID and the current timestamp, followed by the fixed instructions. What is the correct fix?
People also ask
How does prompt caching reduce cost?
What is cache checkpointing?
Why is my prompt cache not getting hits?
Watch and learn
Official Anthropic Academy lessons first, then hand-picked walkthroughs. Videos load only when you press play.
No videos curated for this concept yet
We are still curating the best official and community videos for this topic.
References & primary sources
Master this concept with Archie
Practice it inside an adaptive study session. Archie, your Socratic AI tutor, tracks your mastery with Bayesian Knowledge Tracing and schedules the perfect next review.