Claude Code v2.1.172: AI agents can now create their own sub-agents, 5 levels deep
The headline change in this release is that sub-agents — the helper AIs Claude Code spawns during complex tasks — can now create their own sub-agents, up to five layers deep. This means Claude can break a large job into smaller pieces and handle them in parallel without you micromanaging each step. A wave of stability fixes also ships alongside this feature.
Until now, Claude Code could spin up a helper AI to tackle part of a task, but that helper couldn't delegate further. With this update, the chain can go five levels deep: an agent spawns a sub-agent, which spawns its own sub-agent, and so on. In practice, a single instruction like 'refactor this entire codebase' could trigger Claude to divide the work automatically and run many sub-tasks at the same time — a meaningful leap for solo developers building complex automation.
The bug-fix list is equally practical. A nasty issue where sessions using the 1-million-token context window would freeze permanently after running out of credits is now resolved — the session compacts itself back to a normal size instead of getting stuck. Repeated error messages about unprocessable images are gone, background agents no longer accidentally read settings from a different project folder, and Amazon Bedrock users no longer need to manually set the AWS_REGION environment variable if their local AWS config file already has it.
Key points
- Sub-agents can now spawn their own sub-agents up to 5 levels deep — enables truly autonomous, multi-step automation
- Sessions that hit the 1M-token limit no longer freeze permanently; they auto-compact instead
- Amazon Bedrock now auto-reads the AWS region from your local ~/.aws config file — no extra env variable needed
- A search bar was added to the /plugin marketplace screen, making it easier to find plugins
- Fixed a security bug where background agents could read another project's settings by mistake
Quick term guide
- sub-agent
- A smaller AI agent that handles one specific part of a larger task, running separately from the main agent.
- codebase
- The full set of files and code that make an app or product work.
- developers
- Developers are people who build software, apps, or websites.
- automation
- A way to make repeated work happen without doing every step by hand.
- context window
- The amount of text an AI tool can remember and use in one chat.
- Amazon Bedrock
- Amazon Bedrock is an Amazon service for using different AI models through one platform.
- config file
- A file that tells a tool how to behave.
- autonomous
- The ability of an AI to complete tasks or make decisions without constant human guidance.