⌨️CLAUDE_CODE_PROMPT_CACHE_TTL
Also known as CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL
It sets the cache time for the main chat: 5m or 1h.
Think of it like
It is like you choose how long the shop keeps your bag at the desk.
Example
Jack's main chat sits idle for long spells, but his subagents finish fast. He gives the main chat 1h and the subagents 5m.
Why it matters
The main chat and the helpers have different gaps between calls, so one time does not fit both.
Definition
Example code
bash
export CLAUDE_CODE_PROMPT_CACHE_TTL=1h
export CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL=5m
claudeCommon mistake
Key takeaways
- 15m or 1h. Nothing else.
- 2Main and subagent. Two variables.
- 3Beats the 1h switch. But not the force.