Back Home

AI coding tools

Claude Code 2.1.219 Enables Three-Level Subagent Trees and Adds a Strict Network Allowlist for the Sandbox

Anthropic has increased Claude Code’s default subagent nesting depth from one level to three and incorporated deeper agents’ output into structured streaming. The new version can also immediately reject network hosts that are not on the allowlist, making it easier for unattended agents to adopt a default-deny policy.

Qzekrom (screenshot) · Public domain · Image source
zh-Hant

Anthropic released Claude Code 2.1.219 on July 24. In addition to making Opus 5 the default Opus model, the more significant workflow change is that subagents can now spawn their own subagents, with a default maximum depth of three levels. The previous one-level limit was suitable only for a primary agent delegating work in parallel. The new structure allows intermediate agents to break down modules, testing, or research tasks themselves, creating a truly hierarchical execution tree. Existing automation that assumes every worker is a direct child of the primary agent can restore the flat model by setting `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=1`.

To prevent deeply nested agents from becoming unobservable black boxes, enabling `--forward-subagent-text` sends output from the second level and below to headless `stream-json`, correlated with the Agent `tool_use` ID that produced it. The release also reports MCP configurations that fail validation in initialization events, adds a working-directory registration hook, and introduces structured failure classifications for self-hosted runners. These changes make it easier for CI systems and external orchestrators to reconstruct agent trees and distinguish configuration errors from runner crashes.

On the security side, the release adds `sandbox.network.strictAllowlist`. When a sandboxed command attempts to connect to an unapproved host, the connection is rejected immediately instead of waiting for human confirmation. This is important for batch execution and unattended CI because interactive approvals can both stall workflows and cause approval fatigue. However, three-level nesting amplifies token usage, tool-call volume, and the cost of error propagation; the official guidance even recommends fewer than 15 agents by default for dynamic workflows. Engineering teams should track the total number of agents, permission inheritance at each level, cancellation propagation, and failure retries rather than looking only at whether an individual task completed.

Sources

  1. Release v2.1.219 · anthropics/claude-code
  2. Claude Code changelog