Claude Code提示词与配置约 1 分钟

延长子代理缓存时长

Raise the subagent prompt cache TTL

要点

  1. 主代理的提示缓存有效期为 1 小时,子代理默认只有 5 分钟。
  2. 经常跑长时间子代理任务时,把子代理缓存时长调到 1 小时。
  3. 在 ~/.claude/settings.json 中加入 "subagentPromptCacheTtl": "1h"。

原帖开头

Claude Code users, change this setting if you use subagents. Claude has prompt caching with a 1-hour TTL, but that’s only for the main agent. Subagents get just 5 minutes by default. If you use long-running subagents, I recommend increasing their cache TTL to 1 hour. Just add …