Claude Code Prompt Cache: Triggers for Invalidation and TTL Configuration
·2026.11.01 11:58
Key point
Model switching and MCP server additions invalidate the cache, while file edits and subagents do not, with a default TTL of one hour for subscriptions.
Details
- Model switching, effort level changes, fast mode toggles, and MCP server additions without tool search break the prompt cache by changing the system prompt or model context.
- File edits, permission mode changes (except plan mode with opusplan), skills, commands, output style changes, and subagent spawning do not break the cache.
- Default TTL is one hour for subscriptions but only five minutes for API keys or cloud providers; the 1h write cost only pays off if breaks exceed five minutes.
- Use /usage (v2.1.251+) to check hit rates and miss causes, or run claude -p with --output-format json twice to compare cache_creation_input_tokens and cache_read_input_tokens.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.