Key points
- Cache lasts up to 1 hour; needs a manual cache breakpoint.
- Requires longhand text blocks (
cache_control: ephemeral); shorthand strings can't cache. - Everything up to and including the breakpoint is cached; any earlier change invalidates it.
- Order matters: tools → system prompt → messages. Max 4 breakpoints; min 1024 tokens.
- Usage fields:
cache_creation_input_tokens(first write) vscache_read_input_tokens(reads).
Related
Sources
- 2026-06-28-claude-course
Compiled from
wiki/study/claude-course/Prompt-Caching.md · git is the source of truth