
What happened
In Claude Code 2.1.285, a chain of four layers stopped at max_depth=3 and spawned_by_subagents=2, meaning grandchildren and great-grandchildren ran; setting CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH to 1, 2, 3, 4, or 5 matched the requested tier in all 13 runs.
Why it matters
Since 3 is the default and not a ceiling, teams building multi-step agent workflows seem unable to rely on the default depth staying put.
What to watch
When the depth limit is hit, the run stops quietly — refused.depth_limit stayed 0 across all 39 runs, so the blockage shows up as 'no grandchild,' not as an error. Make depth explicit rather than trusting the default.
WHO IT HITSDevelopers and teams who build multi-step agent workflows in Claude Code and rely on subagents to delegate tasks. Because the default effective depth shifted from 1 to 3 within a single session, workflows that depend on the default depth look unreliable, and those who need a fixed depth may need the environment variable set explicitly.
Summaries like this, in your inbox every morning.
The test used a four-layer chain in which each layer was told to delegate to the next, and the last layer was told to answer itself. The JSON output's subagent_stats field, rather than the AI's narration, provided the count: spawned=3, max_depth=3, spawned_by_subagents=2, completed=3, failed=0, with by_type showing layer1, layer2, and layer3. The prepared layer4 did not appear. This pattern held across three runs with no byte-level differences, which is why the author concluded that grandchildren were reached but a fourth layer was not.
Setting the environment variable changed the picture. With values 1, 2, 3, 4, and 5, all 13 runs matched the requested depth, and the author notes that raising the value also takes effect, so 3 is not a ceiling. A related observation concerns visibility: refused.depth_limit was 0 in all 39 runs, and a subagent at the nesting limit is normally not offered the tool itself. The search for a grandchild that is not running therefore returns no error, which the author says caused confusion.
The most difficult part was the first four runs, which stalled at one tier despite the same settings later reaching three. A remote feature flag name, maxSubagentSpawnDepthFromGrowthBook, appeared in the executable alongside other remotely fixed values, but the flag's value is not externally visible, so the cause remains unverifiable. Hooks also could not distinguish child from grandchild: across 175 logged lines, no key contained depth or parent information. For practitioners, the practical reading is that depth-sensitive designs may be safer with an explicit environment variable rather than relying on the default.
Pick your industry and the AI tools you use, and get news related to your work every day.
Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →
Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.
ElevenLabs completed a $300 million employee tender at a $22 billion valuation, and co-founder Mati Staniszews…

On October 15, OpenAI announced the Rosalind Academic Plan, giving approved US university labs free access to…

A Qiita article compared automated red-teaming methods for LLM apps — GCG, PAIR, and TAP — using mock implemen…

Liquid AI released d1-ultra on October 15, 2026, an upgraded open-weights decision model that averaged 76.7 ac…

Circlia started a proof-of-concept for TASTE SIGNAL: visitors to Holland Village Cafe FUKUOKA taste cookies an…

In a webinar hosted by French Mathematical Society president Isabelle Gallagher, Fields Medal winner Hugo Dumi…
