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
- NVIDIA expands OpenShell for agent permissions; Anthropic, CrowdStrike, Palantir already using it — NVIDIAAI · 2026-12-02
- Anchor Browser lands in Hermes Agent: cloud browser handles logins without pasting passwords — ghumare64 · 2026-12-02
- Developer uses Neon to fix the weirdest bugs Opus left in centrifuge controllers — jonathanberte · 2026-12-02
- NVIDIA launches Nemotron 4, built for long-running coding agents that work for days — nvidia · 2026-12-02
- Solo filmmaker makes 3.5-min AI short film: 21 shots with Midjourney, Seedance 2.5 and ElevenLabs — DavidmComfort · 2026-12-02
- Claude Code + ARIA via MCP: debugging agent evals from 4/12 to 9/12 — CoreWeaveDevs · 2026-12-02