How to Enable Agent Teams in Claude Code (Experimental Feature)
Purpose
This post demonstrates how to enable Agent Teams in Claude Code, an experimental feature that allows multiple AI agents to work in parallel on complex tasks.
Environment
- Claude Code (Opus 4.6+)
- settings.json configuration file
- Operating System: Any (macOS, Linux, Windows)
The Problem
When I give Claude Code a complex refactoring task, it works through everything sequentially. Even with fast AI responses, large tasks take time because one agent handles everything alone.
A developer on Reddit reported that Claude Code spawned three specialized agents for a refactoring task:
- One agent worked on backend
- One agent worked on frontend
- One agent played code reviewer
They completed the work in 15 minutes. The terminal split into 3 panes showing all three agents working simultaneously. The agents communicated with each other, challenged approaches, and coordinated independently.
I wanted to try this feature.
How to Enable Agent Teams
First, I need to find my Claude Code settings.json file.
Here’s the default location:
# macOS~/Library/Application Support/Claude Code/settings.json
# Linux~/.config/Claude Code/settings.json
# Windows%APPDATA%/Claude Code/settings.jsonNow I read the current settings:
{ "env": {}}The env section is empty. I need to add the experimental flag:
{ "env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" }}I save the file and restart Claude Code.
What Happens Next?
Now when I give Claude a complex task, it automatically decides whether to spawn multiple agents.
Here’s an example prompt:
> "Refactor the user authentication module. Split validation logic into a separate service. Update the API endpoints to use the new service. Add error handling and logging."Claude spawns three agents:
# Terminal Pane 1: Backend Agent[Backend]: Analyzing authentication module structure...[Backend]: Extracting validation logic to UserServiceValidator[Backend]: Implementing validateCredentials() method
# Terminal Pane 2: Frontend Agent[Frontend]: Reviewing auth component integration[Frontend]: Updating API calls to match new endpoint structure[Frontend]: Adding loading states for validation
# Terminal Pane 3: Reviewer Agent[Reviewer]: Backend, ensure validation errors return proper status codes[Backend]: Updating to return 400 for validation failures[Reviewer]: Frontend, the error handling needs to match new API response format[Frontend]: Adjusting error parsing logicThe agents message each other directly. They coordinate without my intervention.
Why This Matters
I can think of several benefits:
-
Parallel Processing: Three agents working simultaneously finish faster than one agent working sequentially
-
Specialization: Each agent focuses on their expertise (backend, frontend, review)
-
Quality: The reviewer agent catches issues that backend/frontend agents might miss
-
Communication: Agents debate approaches and challenge each other’s decisions
The Reddit developer summed it well:
“I’ve coded for 6 years. First time I’ve genuinely felt like my job is shifting from ‘writes code’ to ‘directs AI team that writes code.’”
Common Mistakes
I tried this with a simple task first:
> "Add a console.log statement to this function"Claude didn’t spawn agents. It just made the change directly.
I think the key is complexity. Agent Teams activate for:
- Multi-file refactoring
- Architecture changes
- Feature implementation across backend/frontend
- Tasks requiring different expertise
Simple edits don’t trigger it.
Summary
In this post, I showed how to enable Agent Teams in Claude Code. The key point is adding the CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS environment variable to settings.json. Once enabled, Claude can spawn multiple specialized agents that communicate and work in parallel on complex tasks.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments