Search the documentation
5 pages for claude_code_max_subagent_spawn_depth.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
prompting-claude-opus-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-opus-5
…Claude Code or the Claude Agent SDK, the deterministic caps are the `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH` and `CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS` environment variables and the SDK's `max_budget_u…
Subagents in the SDK
Claude Code CLI · in the page
agent-sdk/subagents
…------------------------------------------------- | | Depth | [`CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`](/docs/en/env-vars) | `3` layers of subagents below your main agent. `1` stops your subage…
Claude Code changelog
Claude Code CLI · in the page
changelog
…hanged subagents to no longer spawn nested subagents by default; set `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH` to allow deeper nesting * Fixed `--max-budget-usd` not stopping background subagents: once…
Environment variables
Claude Code CLI · in the page
env-vars
…| | `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH` | Number of [subagent layers](/docs/en/sub-agents#let-subagents-spawn-their…
Create custom subagents
Claude Code CLI · in the page
sub-agents
…-level subagent's summary returns to you. To change the limit, set [`CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`](/docs/en/env-vars) to the number of subagent layers you want below your main conversation.…