# fix\(server\): delegated Claude children follow your subagent cache TTL setting · PR \#22841 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/22841)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: fix/claude-delegate-5m-cache

Target branch: main

Head commit: 7ad8fdfbc6efc63ce88217c9d8a496ac314a6b25

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/22841)

[Commits](https://git.cafe/pingdotgg/t3code/pull/22841/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/22841/diffs?format=markdown)

## Description

---

Claude children started by `delegate_task` are their own SDK sessions, so Claude Code gives them the main-conversation prompt cache TTL (1h on a subscription). Native subagents follow `subagentPromptCacheTtl`. No Claude setting changed the TTL for delegated children alone. Users who wanted 5m children had to move every parent thread to 5m too. Closes #22749.

Delegated child threads now follow the user's Claude `subagentPromptCacheTtl`, read the same way Claude Code reads it: `CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL`, then the user, project, and local settings, with the instance's `CLAUDE_CONFIG_DIR` respected. T3 passes that value to the child as `CLAUDE_CODE_PROMPT_CACHE_TTL`. When the setting is unset, nothing changes and Anthropic's default applies. An explicit `CLAUDE_CODE_PROMPT_CACHE_TTL` on the provider instance still wins.

We did not force 5m. Our fleet logs show that 1h saves about 9.5% for long-running children ([data](https://github.com/pingdotgg/t3code/issues/22749#issuecomment-6315074430)), while short child loops do better on 5m.

Proof: a focused test covers child, root, fork, unset, and override cases. A Node check confirmed that the SDK's `resolveSettings` returns `subagentPromptCacheTtl` from project and user settings. `vp run check:changed` passes.

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

