Skip to main content

Overview

Agent Teams enable multiple Claude agents to work in parallel on the same codebase with shared task coordination. This pattern is ideal for complex projects that can be decomposed into independent workstreams.
Agent Teams is a Claude Code feature that orchestrates parallel agent execution with shared context and task management.

When to Use Agent Teams

Agent Teams shine when you have:

Parallelizable Work

Tasks that can be executed independently without blocking each other

Multiple Domains

Work spanning different areas (frontend + backend, multiple services)

Large Features

Complex features that benefit from specialized agent focus

Time Constraints

Deadlines that benefit from parallel execution

How Agent Teams Work

Key Characteristics

1

Shared Task List

All agents work from a coordinated task list, updating status as they progress
2

Parallel Execution

Multiple agents execute simultaneously, each with their own context and tools
3

Conflict Avoidance

Task assignment ensures agents work on non-conflicting files/modules
4

Progress Visibility

Shared task board shows real-time progress across all agents

Setting Up Agent Teams

1. Define Specialized Agents

Create agents with clear domains of responsibility:
.claude/agents/frontend-specialist.md

2. Create Task Plan

Break down work into parallelizable tasks:
tasks.md

3. Launch Agent Team

Send multiple Task tool calls in a single message to run agents in parallel. Sequential messages run agents one at a time.

Task Coordination Patterns

Pattern 1: Domain-Based Split

Split by technical domain (frontend/backend/infra):
Pros: Clear boundaries, minimal conflicts Cons: Can’t parallelize within a domain

Pattern 2: Feature-Based Split

Split by feature when multiple features are independent:
Pros: Full ownership per feature, can ship independently Cons: Requires truly independent features

Pattern 3: Layer-Based Split

Split by architectural layer:
Pros: Specialists can focus on their layer Cons: Requires careful interface coordination

Pattern 4: Phase-Based Split

Split by development phase:
Pros: Natural workflow progression Cons: Phases may need to be sequential

Best Practices

Problem: Agents working on same files causes merge conflictsSolution:
  • Assign non-overlapping file scopes
  • Use file path prefixes (src/frontend/** vs src/backend/**)
  • Document agent responsibilities clearly
  • Review task plan for potential conflicts before starting
Problem: Cost vs. quality trade-offs across agentsSolution:
  • Use opus for complex implementation work
  • Use sonnet for testing and documentation
  • Use haiku for simple, repetitive tasks
  • Match model to task complexity and importance
Problem: Agent B needs output from Agent ASolution:
  • Phase the work: finish A before starting B
  • Use interface contracts (API specs, type definitions)
  • Have agents work against mocked dependencies
  • Define clear handoff points in task plan
Problem: Hard to track status across multiple agentsSolution:
  • Use shared task list with checkboxes
  • Require agents to update task status
  • Set up notifications for task completion
  • Review consolidated progress regularly

Example: E-commerce Feature

Let’s implement a product review system using agent teams.

Task Breakdown

Progress Tracking

Git Workflow with Agent Teams

Coordinate agents with Git best practices:

Option 1: Feature Branches

Option 2: Shared Feature Branch

Use Git worktrees for true isolation:
See Git Worktrees for detailed workflow.

Agent Team Patterns

Small Team (2-3 agents)

Best for: Medium features, clear domain split

Large Team (4-6 agents)

Best for: Large features, multiple subsystems

Specialized Team

Best for: Complex technical challenges

Troubleshooting

Problem: Multiple agents modified the same filePrevention:
  • Better task assignment (non-overlapping files)
  • Use Git worktrees for isolation
  • Define clear file ownership
Resolution:
  • Review both changes
  • Manually merge in coordinating agent
  • Update task plan to prevent future conflicts
Problem: Agent A waiting for Agent B, Agent B waiting for Agent APrevention:
  • Map dependencies in task plan
  • Phase work (A completes before B starts)
  • Use interface contracts (work against mocks)
Resolution:
  • Identify blocking dependency
  • Prioritize one agent to unblock
  • Refactor to remove circular dependency
Problem: Some agents producing lower quality workSolutions:
  • Use same model for critical tasks (opus)
  • Add code review agent to validate
  • Provide clearer task specifications
  • Use skills to inject best practices

Advanced Techniques

Coordinator Agent

Use a meta-agent to orchestrate the team:
.claude/agents/team-coordinator.md

Dynamic Agent Assignment

Adjust agent assignments based on progress:

Skill Sharing Across Agents

Use shared skills for consistency:

Measuring Success

Velocity

Track tasks completed per hour across all agents

Parallelization

Measure time saved vs. sequential execution

Quality

Monitor test coverage and code review issues

Conflicts

Track merge conflicts and integration issues

Git Worktrees

Isolated development environments for parallel work

RPI Workflow

Structured workflow for feature development

Orchestration Workflow

Command → Agent → Skill pattern

Resources

Agent Teams Docs

Official Claude Code documentation

Sub-Agents Guide

Learn about agent configuration

Task Tool Reference

Task tool API documentation

Best Practices

Community best practices