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)→
More from coding & agent
- Developer builds a Tesla Roadster entirely in code with Opus 5.5, rendered in Three.js — majidmanzarpour · 2026-10-11
- Matthew Berman shares a Codex prompt that pings him every 3 hours about forgotten projects — MatthewBerman · 2026-10-11
- GitSwarm paper: multi-agent swarm compounds inference in a shared Git repo, solves all 30 IMOProofBench problems — NandoDF · 2026-10-11
- Agents don't know if you've got permission — the two-sided safety problem — aparnadhinak · 2026-10-11
- Sharp observation: every agent assumes its human has infinite attention — msg · 2026-10-11
- Lead bots can spawn new sub-bots, no manual creation needed — nateliason · 2026-10-11