Claude Code subagent cache expires after 5 minutes by default; set 1-hour TTL to cut costs

daniel_mac8 · x · 2026-10-10

Boris Cherny (Anthropic) explained why Claude Code's subagent prompt cache TTL defaults to 5 minutes: the API mostly serves Agent SDK-style workloads where a 1-hour TTL would raise average costs, so 5 minutes is the safe choice, while interactive usage defaults to 1 hour because it's cheaper on average.

@danielmac8 flagged this as a hidden cost trap for developers orchestrating subagents: if a subagent sits idle for more than 5 minutes, you lose cache pricing and pay full cost on re-computation. The fix is setting "subagentPromptCacheTtl": 60 for a 1-hour TTL. Cherny added that defaults work for most people, so anyone changing it should test and measure.

Related event: Claude Code Subagent Cache Lasts Just 5 Minutes, Costing Users(4 posts)→

Original post →

More from coding & agent

coding & agent channel →