Defining Cache Breakpoints — Prompt Caching Framework
Defining Cache Breakpoints
Strategic Context Storage
Anthropic's Prompt Caching allows developers to persist large prefixes (like system instructions, tool definitions, or codebase files) in high-speed inference memory. You append a cache_control object set to {"type": "ephemeral"} (5-minute default TTL, or {"type": "ephemeral", "ttl": "1h"} for 1-hour extended retention) at specific breakpoints in your request.
The 4-Breakpoint Constraint
A single API request can contain a maximum of 4 explicit cache breakpoints. Typically, you cache your system prompt at breakpoint 1, tool definitions at breakpoint 2, and reference documents at breakpoint 3—keeping the heavy prefix warm while the final user turn stays dynamic.
Persist repeated system instructions in cache. Add a cache_control object with type 'ephemeral' to your system prompt content array.