Robert Youssef's banner
Robert Youssef's profile picture

Robert Youssef

@rryssf • 40,696 subscribers

Building @godofprompt & @prompt_copilot Agentic Memory and Context Engineering

Shorts

People losing so much tokens and have no idea about this: Subagent caches expire in five minutes. In Claude Code, a subagent that sits idle longer than 5 minutes loses its prompt cache. The next call rewrites the whole context from scratch and burns several times more tokens than a cache hit would. Anthropic's guide covers a single setting that stretches that window to an hour: "subagentPromptCacheTtl": "1h" The trade-off is in the write price. Each write to the 1-hour cache costs more than a write to the 5-minute one. You stop paying for a full rewrite every time a subagent pauses, though. For workflows with long gaps between subagent calls, the savings reportedly reach up to 25% of total token spend. Those savings depend heavily on how you work. If your subagents finish fast and rarely sit idle past five minutes, you pay the pricier write for nothing and your bill goes up. Check your own usage before you switch. A comparison script exists that estimates whether the 1-hour TTL saves you money or costs you more on your actual sessions. If your pauses stay under five minutes, keep the default.

People losing so much tokens and have no idea about this: Subagent caches expire in five minutes. In Claude Code, a subagent that sits idle longer than 5 minutes loses its prompt cache. The next call rewrites the whole context from scratch and burns several times more tokens than a cache hit would. Anthropic's guide covers a single setting that stretches that window to an hour: "subagentPromptCacheTtl": "1h" The trade-off is in the write price. Each write to the 1-hour cache costs more than a write to the 5-minute one. You stop paying for a full rewrite every time a subagent pauses, though. For workflows with long gaps between subagent calls, the savings reportedly reach up to 25% of total token spend. Those savings depend heavily on how you work. If your subagents finish fast and rarely sit idle past five minutes, you pay the pricier write for nothing and your bill goes up. Check your own usage before you switch. A comparison script exists that estimates whether the 1-hour TTL saves you money or costs you more on your actual sessions. If your pauses stay under five minutes, keep the default.

37,734 görüntüleme