ENABLE_PROMPT_CACHING_1H is a 📝Claude Code environment variable that extends the prompt-cache lifetime from the default five minutes to one hour, keeping cached context warm across longer gaps between turns.
Prompt caching stores a reusable prefix of a request — system instructions, tool definitions, and prior context — so repeated calls skip reprocessing it, cutting both latency and cost. By default the cached prefix expires after five minutes of inactivity; 📝Anthropic also offers an extended one-hour cache at additional cost. Setting ENABLE_PROMPT_CACHING_1H=1 tells Claude Code to request the one-hour time-to-live in place of the standard five minutes.
The variable sits alongside related controls. DISABLE_PROMPT_CACHING turns caching off entirely, while FORCE_PROMPT_CACHING_5M=1 pins the five-minute TTL and overrides the one-hour setting — useful when debugging or comparing cache behavior. All three can live in the env block of 📝settings.json (Claude Code) to set a caching policy for every session, or in managed settings to enforce one across an organization.
Whether the longer TTL is worth enabling depends on billing. On metered API usage the one-hour cache can cut costs by up to 90% and latency by up to 85% on long prompts, since cache reads bill at a fraction of base input tokens. On a subscription plan the gain is mostly latency rather than cost — and any workflow that touches the model more than once an hour already keeps the default five-minute cache warm.
I weighed this for an hourly agent loop, where a 60-minute gap is exactly what the one-hour cache is built to bridge. On a subscription plan the cache mostly buys latency rather than dollars — so I run hourly and don't chase it.
