Claude Code's Agent Teams Are Insane - Multiple AI Agents Coding Together in Real Time

By Cole Medin

Share:

Agent Teams in Claude Code: A Deep Dive

Key Concepts:

  • Agent Teams: A new experimental feature in Claude Code allowing multiple agents to collaborate on a single task, sharing a task list and communicating with each other.
  • Sub Agents: A previous method of parallel processing in Claude Code, characterized by context isolation and lack of direct communication between agents.
  • Token Usage: A measure of the computational cost of using Claude, heavily impacted by the complexity and collaboration within agent teams.
  • Contract-First Spawning: A methodology for orchestrating agent team tasks, prioritizing sequential dependencies to improve efficiency and reliability.
  • T-Mux/iTerm2: Terminal applications required for visualizing and interacting with multiple agents in split-pane mode.
  • AI Validation Pyramid: A framework for incorporating AI into software development, layering validation checks from automated to human review.

1. Introduction & Demonstration of Agent Teams

The video showcases the new “Agent Teams” feature within Claude Code, demonstrating four instances of Claude Code working concurrently on a code review. This is achieved through the feature’s ability to spin up multiple terminals (using T-Mux) and create collaborating agents. The presenter highlights the novelty of this approach, emphasizing that unlike previous multi-terminal setups, Agent Teams facilitate genuine collaboration – agents communicate and coordinate tasks, rather than operating in isolation. A key example is agents stating intentions like, “Let me complete this before you work on this,” demonstrating shared task management.

2. Agent Teams vs. Sub Agents: A Comparative Analysis

A significant portion of the video focuses on differentiating Agent Teams from the existing “Sub Agents” functionality.

  • Sub Agents: Operate in isolation, focusing on individual tasks and providing only a summary output to the primary agent. This is efficient in terms of token usage but lacks coordination, making them suitable for research-focused tasks.
  • Agent Teams: Enable collaboration through a shared task list and direct communication. This is ideal for implementation tasks where coordination is crucial (e.g., backend changes requiring frontend updates). However, this collaboration comes at a higher token cost (estimated 2-4x higher than sub agents or standard Claude usage).

The presenter advocates for a combined approach: using Sub Agents for initial research and planning, then leveraging Agent Teams for the actual implementation phase.

3. Setting Up Agent Teams

The video provides a step-by-step guide to enabling Agent Teams:

  1. Enable the Experimental Feature: This is done either by setting an environment variable (CLOUD_CODE_EXPERIMENTAL_AGENT_TEAMS=true) or adding it to the settings.json configuration file for Claude Code. The feature can be enabled globally or project-specifically.
  2. Install a Supported Terminal Application: T-Mux (recommended) or iTerm 2 are required to visualize the split-pane terminals. Installation instructions are provided in the accompanying resource. Windows users require WSL (Windows Subsystem for Linux).
  3. Initiate an Agent Team: Simply requesting Claude to create an agent team triggers the feature. For example, “Have one agent focus on security, one on code quality, and the other on documentation.”

4. Anthropic’s Advanced Use Cases & Token Considerations

The presenter highlights Anthropic’s demonstration of Agent Teams’ capabilities: building an entire C compiler using 16 agents at a cost of $20,000 in API costs. While substantial, this is presented as significantly cheaper than hiring a development team for the same task (estimated hundreds of thousands of dollars). However, the presenter reiterates that Agent Teams are “very tokenheavy,” a significant drawback to consider. Anthropic’s research showed that a single agent, even a powerful one like Opus 4.6, could not have completed the compiler project.

5. Addressing Agent Team Limitations: The Custom Skill & Contract-First Spawning

The presenter acknowledges that Claude Code isn’t inherently proficient at utilizing Agent Teams effectively. To address this, they developed a custom skill (a command) designed to improve team creation and task management. Two key issues are addressed:

  • Hallucinations & Specificity: Claude sometimes creates illogical teams or struggles with terminal management if not given precise instructions.
  • Parallelism Issues: Agents may not truly run in parallel, leading to inefficiencies (e.g., backend agent building on an outdated database schema).

The solution implemented is “Contract-First Spawning”: a process where agents establish foundational elements (like a database schema) before parallelizing tasks. This ensures dependencies are met and reduces wasted effort. The skill provides instructions for Claude on team composition, terminal management, and the contract-first approach. The command is run using /build with agent team [path to plan] [number of agents].

6. The AI Validation Pyramid & Sonar Summit

The presenter briefly discusses their upcoming presentation at the Sonar Summit, focusing on the “AI Validation Pyramid.” This framework advocates for a layered approach to AI-assisted coding:

  • Foundation (AI): Automated checks like type checking, linting, and initial testing.
  • Control (Human): Human review of critical layers, ensuring quality and security.

The presenter emphasizes the importance of building “self-validation and guardrails” into AI coding systems to address rising review times and security vulnerabilities.

7. Notable Quotes

  • “I really feel like I am peering into the future of agentic development.” – Expressing excitement about the potential of Agent Teams.
  • “Sub agents are generally used for focused tasks usually something like research… Agent teams is a lot better for implementation.” – Summarizing the appropriate use cases for each feature.
  • “It takes a lot of tokens to set up this task list, maintain that collaboration and the communication between the lead agent and all of the other agents in the team.” – Highlighting the cost implications of Agent Teams.

8. Conclusion

Agent Teams represent a significant advancement in AI-assisted coding, enabling true collaboration between multiple agents. While powerful, the feature is still experimental and requires careful consideration of token costs and potential limitations. The presenter’s custom skill and “Contract-First Spawning” methodology offer practical solutions for maximizing the effectiveness of Agent Teams, paving the way for more efficient and reliable AI-driven development workflows. The key takeaway is that a strategic combination of Sub Agents (for research) and Agent Teams (for implementation) offers the most promising approach to leveraging AI in software development.

Chat with this Video

AI-Powered

Load the transcript when you're ready to chat so the initial page stays lighter.

Related Videos

Ready to summarize another video?

Summarize YouTube Video