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:- Frontend Agent
- Backend Agent
- Testing Agent
.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):Pattern 2: Feature-Based Split
Split by feature when multiple features are independent:Pattern 3: Layer-Based Split
Split by architectural layer:Pattern 4: Phase-Based Split
Split by development phase:Best Practices
Define Clear Boundaries
Define Clear Boundaries
Problem: Agents working on same files causes merge conflictsSolution:
- Assign non-overlapping file scopes
- Use file path prefixes (
src/frontend/**vssrc/backend/**) - Document agent responsibilities clearly
- Review task plan for potential conflicts before starting
Use Appropriate Models
Use Appropriate Models
Problem: Cost vs. quality trade-offs across agentsSolution:
- Use
opusfor complex implementation work - Use
sonnetfor testing and documentation - Use
haikufor simple, repetitive tasks - Match model to task complexity and importance
Coordinate Dependencies
Coordinate Dependencies
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
Monitor Progress
Monitor Progress
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
- Tasks.md
- Coordination Notes
Progress Tracking
Git Workflow with Agent Teams
Coordinate agents with Git best practices:Option 1: Feature Branches
Option 2: Shared Feature Branch
Option 3: Git Worktrees (Recommended)
Use Git worktrees for true isolation:Agent Team Patterns
Small Team (2-3 agents)
Best for: Medium features, clear domain splitLarge Team (4-6 agents)
Best for: Large features, multiple subsystemsSpecialized Team
Best for: Complex technical challengesTroubleshooting
Merge Conflicts
Merge Conflicts
Problem: Multiple agents modified the same filePrevention:
- Better task assignment (non-overlapping files)
- Use Git worktrees for isolation
- Define clear file ownership
- Review both changes
- Manually merge in coordinating agent
- Update task plan to prevent future conflicts
Dependency Deadlock
Dependency Deadlock
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)
- Identify blocking dependency
- Prioritize one agent to unblock
- Refactor to remove circular dependency
Inconsistent Quality
Inconsistent Quality
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
Related Patterns
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
