Answer: Claude Code's prompt cache TTL is either five minutes or one hour, and you can choose the TTL yourself using settings or environment variables that take `5m` or `1h`. Status: Confirmed Entry: tool/claude-code/features/cache-lifetime-ttl Revision: 4 Digest: sha256:03b30d5b08f8f709 (changes whenever the content changes) Timeline: Created: 2026-11-13T02:28:05Z Last changed: 2026-11-20T12:24:19Z (Minimum version: — → v2.1.242) Last verified: 2026-11-20T12:24:19Z Next check: 2026-11-21T12:24:19Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Main conversation TTL control | promptCacheTtl | [1] | 2026-11-20 Everything else TTL control | subagentPromptCacheTtl | [1] | 2026-11-20 Accepted values | 5m | [1] | 2026-11-20 Minimum version | v2.1.242 | [1] | 2026-11-20 Sources: [1] Anthropic. "How Claude Code uses prompt caching". https://code.claude.com/docs/en/prompt-caching.md Role: primary. Accessed: 2026-11-20T12:24:19Z Quote: "the [`promptCacheTtl`](https://code.claude.com/docs/en/settings-reference#promptcachettl) setting, or the `CLAUDE_CODE_PROMPT_CACHE_TTL` [environment variable]" (Supports: Main conversation TTL control) Quote: "the [`subagentPromptCacheTtl`](https://code.claude.com/docs/en/settings-reference#subagentpromptcachettl) setting, or the `CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL` environment variable" (Supports: Everything else TTL control) Quote: "Each control takes `5m` or `1h`, and Claude Code ignores any other value." (Supports: Accepted values) Quote: "Both settings and both environment variables require Claude Code v2.1.242 or later." (Supports: Minimum version) Published: 2026-11-20T02:58:36Z Snapshot SHA-256: 6dd7b7540098e8cdfaa2d530c1a887d120f5e095624e8cac5e3821cf54736a54 (captured 2026-11-20T12:24:17Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:24:19Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:24:19Z Last attempt: 2026-11-20T12:24:19Z Notes and limitations: Extracted automatically from a single official source (section "Cache lifetime"). Related: https://latestn.com/tool/claude-code/features/capabilities What can Claude Code do, like building features, fixing bugs, and automating tasks? https://latestn.com/tool/claude-code/features/check-plugin-usage How do I check whether a Claude Code plugin is still being used? https://latestn.com/tool/claude-code/features/checkpoint-limitations What changes does Claude Code checkpointing not track or restore? https://latestn.com/tool/claude-code/features/branch-session How do I branch a Claude Code session to try a different approach? https://latestn.com/tool/claude-code/features/browse-install-anthropic-marketplaces Where can I browse and install plugins from Anthropic's official and community marketplaces in Claude Code? https://latestn.com/tool/claude-code/features/built-in-output-styles What built-in output styles does Claude Code offer? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T12:24:19Z | changed | Minimum version: — → v2.1.242 | [1] 2026-11-20T12:24:19Z | changed | Accepted values: — → 5m | [1] 2026-11-20T12:24:19Z | changed | Default main conversation TTL (API key/credits): Five minutes → — | [1] 2026-11-20T12:24:19Z | changed | Default main conversation TTL (subscription): One hour → — | [1] 2026-11-20T12:24:19Z | changed | Minimum version for TTL controls: v2.1.242 → — | [1] 2026-11-20T12:24:19Z | changed | Accepted TTL values: 5m → — | [1] 2026-11-18T12:19:30Z | changed | Default main conversation TTL (API key/credits): — → Five minutes | [1] 2026-11-18T12:19:30Z | changed | Minimum version for TTL controls: — → v2.1.242 | [1] 2026-11-18T12:19:30Z | changed | Everything else TTL control: — → subagentPromptCacheTtl | [1] 2026-11-18T12:19:30Z | changed | Minimum version: v2.1.242 → — | [1] 2026-11-18T12:19:30Z | changed | Accepted TTL values: 5m` or `1h → 5m | [1] 2026-11-13T12:13:40Z | changed | Default main conversation TTL (subscription): — → One hour | [1] 2026-11-13T12:13:40Z | changed | Accepted TTL values: 5m → 5m` or `1h | [1] 2026-11-13T12:13:40Z | changed | Long TTL: one-hour TTL → — | [1] 2026-11-13T12:13:40Z | changed | Short TTL: five-minute TTL → — | [1] 2026-11-13T02:28:05Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/features/cache-lifetime-ttl/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/features/cache-lifetime-ttl POST: https://latestn.com/dispute/tool/claude-code/features/cache-lifetime-ttl with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/features/cache-lifetime-ttl?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How long does Claude Code's prompt cache last and can I choose the TTL? Revision 4, last verified 2026-11-20T12:24:19Z. https://latestn.com/tool/claude-code/features/cache-lifetime-ttl (accessed 2026-11-21T09:54:05Z). @misc{LatestN_tool_claude_code_features_cache_lifetime_ttl_r4, title = {How long does Claude Code's prompt cache last and can I choose the TTL?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/features/cache-lifetime-ttl}}, note = {Revision 4; digest sha256:03b30d5b08f8f709; last verified 2026-11-20T12:24:19Z; accessed 2026-11-21T09:54:05Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/features/cache-lifetime-ttl