Answer: To request a 1-hour TTL on cache writes, set the ENABLE_PROMPT_CACHING_1H environment variable, either exported in your shell or container environment or passed through options.env. Status: Confirmed Entry: tool/claude-code/pricing-and-limits/extend-prompt-cache-ttl Revision: 2 Digest: sha256:537469a8d9b2cb7d (changes whenever the content changes) Timeline: Created: 2026-11-13T03:02:40Z Last changed: 2026-11-18T12:12:17Z (Subagent TTL control: — → CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL) Last verified: 2026-11-20T12:16:26Z Next check: 2026-11-21T12:16:26Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Environment variable | ENABLE_PROMPT_CACHING_1H | [1] | 2026-11-20 TTL requested | 1-hour | [1] | 2026-11-20 Default TTL | 5-minute | [1] | 2026-11-20 Main conversation TTL control | CLAUDE_CODE_PROMPT_CACHE_TTL | [1] | 2026-11-20 Subagent TTL control | CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL | [1] | 2026-11-20 Sources: [1] Anthropic. "Track cost and usage". https://code.claude.com/docs/en/agent-sdk/cost-tracking.md Role: primary. Accessed: 2026-11-20T12:16:26Z Quote: "To request a 1-hour TTL on cache writes, set the [`ENABLE_PROMPT_CACHING_1H`]" (Supports: Environment variable) Quote: "To request a 1-hour TTL on cache writes" (Supports: TTL requested) Quote: "Cache entries for your own turns use a 5-minute TTL by default" (Supports: Default TTL) Quote: "Main conversation: the `CLAUDE_CODE_PROMPT_CACHE_TTL`" (Supports: Main conversation TTL control) Quote: "Everything else: the `CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL` environment variable" (Supports: Subagent TTL control) Published: 2026-11-20T02:52:51Z Snapshot SHA-256: 33162fd50e80cef6285d81742eaf4629de96a5a4354ab5f2e147dfb8a83af0d7 (captured 2026-11-17T12:20:22Z) 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]. On this check the text of [1] was unchanged since 2026-11-17T12:20:22Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:16:26Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:16:26Z Last attempt: 2026-11-20T12:16:26Z Notes and limitations: Extracted automatically from a single official source (section "Extend the prompt cache TTL to one hour"). Related: https://latestn.com/tool/claude-code/pricing-and-limits/fast-mode-cost How does fast mode affect cost in Claude Code? https://latestn.com/tool/claude-code/pricing-and-limits/gateway-cost-attribution How do I attribute Claude apps gateway spend per developer or per team on AWS? https://latestn.com/tool/claude-code/pricing-and-limits/gateway-pricing-markup How do I mark up prices and send rates to signed-in clients in the Claude apps gateway? https://latestn.com/tool/claude-code/pricing-and-limits/claude-tag-billing-and-limits How are Claude Tag usage and spend limits billed? https://latestn.com/tool/claude-code/pricing-and-limits/cloud-session-resource-and-time-limits What are the resource and time limits for Claude Code cloud sessions? https://latestn.com/tool/claude-code/pricing-and-limits/code-review-billing How is Claude Code Review billed and what drives its cost? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T12:12:17Z | changed | Subagent TTL control: — → CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL | [1] 2026-11-18T12:12:17Z | changed | Main conversation TTL control: — → CLAUDE_CODE_PROMPT_CACHE_TTL | [1] 2026-11-18T12:12:17Z | changed | Default TTL: — → 5-minute | [1] 2026-11-18T12:12:17Z | changed | Environment variable: — → ENABLE_PROMPT_CACHING_1H | [1] 2026-11-18T12:12:17Z | changed | subagent TTL control: CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL → — | [1] 2026-11-18T12:12:17Z | changed | main conversation setting: promptCacheTtl → — | [1] 2026-11-18T12:12:17Z | changed | main conversation TTL control: CLAUDE_CODE_PROMPT_CACHE_TTL → — | [1] 2026-11-18T12:12:17Z | changed | default TTL: 5-minute → — | [1] 2026-11-18T12:12:17Z | changed | environment variable: ENABLE_PROMPT_CACHING_1H → — | [1] 2026-11-13T03:02:40Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/pricing-and-limits/extend-prompt-cache-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/pricing-and-limits/extend-prompt-cache-ttl POST: https://latestn.com/dispute/tool/claude-code/pricing-and-limits/extend-prompt-cache-ttl with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/pricing-and-limits/extend-prompt-cache-ttl?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I extend the prompt cache TTL to one hour in the Claude Agent SDK? Revision 2, last verified 2026-11-20T12:16:26Z. https://latestn.com/tool/claude-code/pricing-and-limits/extend-prompt-cache-ttl (accessed 2026-11-21T10:02:14Z). @misc{LatestN_tool_claude_code_pricing_and_limits_extend_prompt_cache_ttl_r2, title = {How do I extend the prompt cache TTL to one hour in the Claude Agent SDK?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/pricing-and-limits/extend-prompt-cache-ttl}}, note = {Revision 2; digest sha256:537469a8d9b2cb7d; last verified 2026-11-20T12:16:26Z; accessed 2026-11-21T10:02:14Z} } 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/pricing-and-limits/extend-prompt-cache-ttl