AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Sep 29, 2026, 22:00 JST

Claude Code subagents hand off via files, not disallowedTools: Agent nesting

Claude Code subagents hand off via files, not disallowedTools: Agent nesting

3 Key Points

  1. What happened

    Per Claude Code's official docs, subagents can launch their own subagents via the Agent tool by default, nested up to three levels; the environment variable CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH changes that depth and setting it to 1 turns nesting off. The author's repo keeps six of seven agent definitions free of Agent in their tools allowlist and adds disallowedTools: Agent only to the all-tools-inheriting builder.

  2. Why it matters

    Subagents that omit tools inherit every main-conversation tool, so Agent stays usable unless disallowedTools: Agent is set — meaning the repo's no-mutual-calling setup is a chosen design, not a Claude Code constraint, and it appears to be what keeps a human-confirmable checkpoint at each stage.

  3. What to watch

    The file-based handoff adds instructions from the PM for every step and rules out parallel runs for speed, so it hinges on deciding the output directory layout up front. If that is skipped, the author warns you land back at scattered artifacts.

WHO IT HITSDevelopers and teams running multi-step Claude Code pipelines with several subagents are the ones who must decide whether to allow nesting or enforce file-based handoffs. The author's experience suggests the file route gives a reviewer a chance to catch conflicting figures before the next stage.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, in your inbox every morning.

Context & Analysis

The article builds on a previous post that fixed the main Claude Code session in the role of PM, and now describes how that PM passes artifacts between specialized subagents. Three delegation options are laid out — natural-language prompting, @-mention, and launching the whole session with --agent <name> — but all three are ways for the human or main session to invoke a subagent, not for one subagent to @-mention another. So the author weighed two rejected designs against the adopted one: allowing nested delegation, which makes it hard to place a checkpoint before the PM proceeds, and merging everything into one giant agent, which loses specialization and bloats instructions.

The adopted flow runs market-researcher to product-strategist to builder to content-writer, with qa-reviewer recording a verdict in reviews/<slug>.md before publication. Artifacts land in research/, plans/, samples/, and articles/ or books/ according to each agent definition's description. The concrete payoff is the discrepancy between a source article's titled 43% and the body-counted 68%, caught by the PM and written into the plan as a risk item. Exactly the kind of review the author says direct agent-to-agent calling would have skipped.

The trade-offs are acknowledged: more PM instructions per step, no real-time parallelism for speed, and a need to predefine the directory layout, without which the author warns you regress to scattered artifacts. Whether this matters to a given team likely hinges on how much traceability and mid-pipeline review they need versus raw throughput, and the practical test is whether the extra PM overhead is worth the corrected figures. The author says a forthcoming book will cover generalizing the file-handoff design and when to use other integration patterns.

FAQ
Can Claude Code subagents call other subagents?
Yes, by default a subagent can launch its own subagents through the Agent tool, nested up to three levels under the main conversation. Setting CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH to 1 turns nesting off entirely.
How does the author's repository stop subagents from calling each other?
Six of its seven .claude/agents definitions omit Agent from their tools allowlist, and the only definition that inherits all tools, builder, gets disallowedTools: Agent. The author stresses that omitting tools means inheriting every main-conversation tool, so a definition without an allowlist needs disallowedTools: Agent.
What did the file-based handoff catch that direct agent-to-agent calls would not?
In a market-researcher report, a cited statistic conflicted: the article title said 43% of paid books had zero likes while the body count showed 68%. The PM saw it and told the product-strategist to use the source title's number or mark it for confirmation.

AI news that matters for your work, delivered every morning.

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

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.

Questions and answers are published on this page.

Related Articles

Next articleGPT-6 Astra attacks likelier than older models: AISI