Claude Code v2.1.172: sub-agents up to 5 levels deep and a series of fixes
The new Claude Code v2.1.172 update introduces the ability for sub-agents to call their own sub-agents up to 5 levels deep, improved Amazon Bedrock integration, a plugin marketplace search bar, and an OTEL model attribute — along with more than twenty bug fixes.
This article was generated using artificial intelligence from primary sources.
What is new in Claude Code v2.1.172?
Anthropic released Claude Code v2.1.172 on June 10, 2026 — a new version of the terminal and development environment for collaborating with Claude AI models. This update brings several significant new capabilities and more than twenty bug fixes, some of which resolved serious issues affecting longer sessions and multi-agent workflows.
Nested sub-agents: up to 5 levels deep
The most important new capability is sub-agent nesting. Sub-agents, which until now could call tools and execute tasks, can now spawn their own sub-agents — up to 5 levels deep. This means it is possible to build hierarchical multi-agent systems where a parent agent delegates sub-tasks to agents that themselves further delegate to specialized sub-agents.
This capability is especially useful for complex development tasks such as simultaneous testing, code review, and deployment — each step can have its own specialized agent running in parallel.
Improved Amazon Bedrock integration
Users running Claude Code via Amazon Bedrock (AWS’s managed service for AI models) will get a better region configuration experience. Previously the tool required the AWS_REGION environment variable to be explicitly set; it now reads the AWS region from ~/.aws configuration files when the environment variable is not set — matching the AWS SDK behavior that developers already know well.
The /status command now shows which source the active region comes from, eliminating ambiguity when diagnosing configuration issues.
Plugin marketplace search and OTEL metrics
A search bar for browsing the plugin marketplace via the /plugin command has been added — a practical addition that speeds up finding desired extensions in the growing catalog.
For users tracking OpenTelemetry (OTEL) metrics, a model attribute has been added to the claude_code.lines_of_code.count metric, making it possible to track code-writing activity by model.
Critical bugs fixed
Stuck sessions with 1M context
Sessions using the 1M context window without available usage credits could get permanently stuck. This was a serious problem because there was no automatic way out of such a state — the session simply stopped responding. Such sessions are now automatically compacted below the standard context limit, allowing work to continue.
Security issue: reading another directory’s project settings
Background agents could read the project settings of a different directory (.mcp.json approvals, trust configuration) when launched on a pre-warmed worker. This was a potential security and isolation flaw in multi-agent environments that has now been fixed.
Additional fixes and improvements
Version v2.1.172 also brings a number of additional fixes that improve the day-to-day experience:
availableModelsrestrictions are now properly enforced on sub-agent model overrides, the model picker when launching agents, and the advisor model — previously these restrictions could be bypassedWebFetchwildcard rules such asdomain:*.example.compreviously did not match subdomains in allow, deny, and ask positions; these have been fixed, as have mid-pattern wildcards in file permission rules (e.g.Read(secrets-*/config.json)) that were being rejected at startup- Fixed a bug where the /model picker on Bedrock displayed models not supported by the provider, and selection would silently change the session model and highlight multiple rows simultaneously
- Fixed duplication of the 1M-context suffix (e.g.
[1M][1m]) whenANTHROPIC_DEFAULT_OPUS_MODELalready includes one - Fixed an issue with the
opusplanmodel setting not activating the 1M context in plan mode for eligible users - Fixed a bug where the up arrow in prompt history displayed prompts from the main agent while a sub-agent chat tab was open
Performance and optimizations
Along with bug fixes, the update brings several performance improvements: CPU usage at idle has been reduced by eliminating unnecessary terminal re-rendering (the /goal status chip no longer refreshes the terminal 5 times per second while the tool is inactive). Long conversations are now processed faster thanks to the removal of redundant message normalization.
Frequently Asked Questions
- How many nesting levels of sub-agents does Claude Code v2.1.172 support?
- Sub-agents can now call their own sub-agents up to a maximum of 5 nesting levels, enabling more complex multi-agent workflows.
- What was fixed regarding 1M-context sessions that were getting stuck?
- Sessions using the 1M context without available usage credits could get permanently stuck — they are now automatically compacted below the standard context limit.
- How does Claude Code v2.1.172 improve Amazon Bedrock integration?
- The Bedrock integration now reads the AWS region from ~/.aws configuration files when the AWS_REGION environment variable is not set, aligning with AWS SDK precedence; /status shows the source of the active region.
📬 AI news in your inbox
A daily digest built your way — pick topics, sources and cadence. One-click unsubscribe.