Claude prompt caching: automatic cache_control and explicit breakpoints
Answer: There are two ways to enable prompt caching with the Claude API:
- Automatic caching (recommended): one
cache_controlfield at the top level of the request, for examplecache_control={"type": "ephemeral"}. The system places the cache breakpoint on the last cacheable block. - Explicit cache breakpoints: place
cache_controlon individual content blocks for fine-grained control.
Behaviour
- The first call writes to the cache, so timing is similar to the baseline; the second call reuses the cached prefix.
- In a multi-turn conversation the breakpoint automatically moves forward as the conversation grows.
- Explicit breakpoints help to cache a system prompt independently from message content. You can combine both approaches.
- Usage reports
cache_creation_input_tokensandcache_read_input_tokens.
Limits of prefix caching in general
The vLLM docs note that prefix caching gives no gain when new queries do not share the same prefix with existing queries.
See also
Claims
- id: C1 claim: Automatic caching uses one top-level field. source: S1 evidence: "Add a single
cache_controlfield at the top level of your request."
- id: C2 claim: Breakpoint moves forward over turns. source: S1 evidence: "The cache breakpoint automatically moves forward as the conversation grows"
- id: C3 claim: No gain without a shared prefix. source: S2 evidence: "new queries do not share the same prefix with any of existing queries"
Sources
- [S1] Prompt caching. anthropics/claude-cookbooks (GitHub). https://github.com/anthropics/claude-cookbooks/blob/main/misc/prompt_caching.ipynb . License: MIT. Accessed 2026-11-16.
- [S2] Automatic prefix caching (vLLM docs). vllm-project/vllm (GitHub). https://github.com/vllm-project/vllm/blob/main/docs/features/automatic_prefix_caching.md . License: Apache-2.0. Accessed 2026-11-16.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: anthropics/claude-cookbooks (GitHub), Prompt caching, MIT (https://raw.githubusercontent.com/anthropics/claude-cookbooks/main/LICENSE). Copyright (c) 2023 Anthropic; vllm-project/vllm (GitHub), Automatic prefix caching (vLLM docs), Apache-2.0 (https://raw.githubusercontent.com/vllm-project/vllm/main/LICENSE). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: anthropics/claude-cookbooks (GitHub), Prompt caching, MIT (https://raw.githubusercontent.com/anthropics/claude-cookbooks/main/LICENSE). Copyright (c) 2023 Anthropic; vllm-project/vllm (GitHub), Automatic prefix caching (vLLM docs), Apache-2.0 (https://raw.githubusercontent.com/vllm-project/vllm/main/LICENSE).
Cite this
iinventedlight. 2026. "Claude prompt caching: automatic cache_control and explicit breakpoints." iinventedlight Library, iil:note:yncbxkmc, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-caching-anthropic-cache-control/. License: CC-BY-4.0.
@misc{iil_note_yncbxkmc,
author = {{iinventedlight}},
title = {{Claude prompt caching: automatic cache\_control and explicit breakpoints}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-16},
url = {https://iinventedlight.com/library/notes/ao-caching-anthropic-cache-control/},
note = {Permanent ID iil:note:yncbxkmc. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-caching-anthropic-cache-control.md.