Multi-Agent Workflows with Claude Code: The Complete Guide
Orchestrate multiple Claude Code agents in parallel for complex projects with Loki Mode and Gastown.
A single Claude Code agent is powerful. Multiple orchestrated agents? That's a complete development team. This guide explores multi-agent orchestration patterns.
Why Multi-Agent?
Modern projects involve parallelizable tasks:
- Frontend and backend simultaneously
- Tests and documentation in parallel
- Refactoring multiple independent modules
A single agent handles these sequentially. Multiple agents handle them in parallel.
Orchestration Skills
Loki Mode — The Autonomous Approach
Score: 85/100 | The most ambitious
Loki Mode takes a PRD (Product Requirements Document) and deploys the product with minimal intervention. It:
- Analyzes the PRD and breaks it into tasks
- Creates specialized agents
- Coordinates execution
- Manages task dependencies
- Deploys the result
When to use: Greenfield projects, prototypes, hackathons.
Prerequisite: The --dangerously-skip-permissions flag is required (Loki Mode needs full autonomy).
Gastown — The Modular Orchestrator
Score: 75/100 | The most flexible
Gastown uses unique vocabulary (convoys, polecats, rigs) to coordinate agents:
- Convoys: Groups of related tasks
- Polecats: Specialized agents
- Rigs: Environment configurations
- Beads: Atomic work units
When to use: Complex existing projects requiring fine-grained orchestration.
Orchestration Patterns
Pattern 1: Fan-Out / Fan-In
Orchestrator
├── Frontend Agent (React components)
├── Backend Agent (API endpoints)
├── Test Agent (E2E + unit)
└── Docs Agent (README + API docs)
Each agent works independently, the orchestrator aggregates results.
Pattern 2: Sequential Pipeline
Analysis Agent → Implementation Agent → Review Agent → Deploy Agent
Each agent passes context to the next.
Pattern 3: Specialization
"Senior Dev" Agent (architecture, code review)
"Junior Dev" Agent (implementation, tests)
"DevOps" Agent (CI/CD, deployment)
"PM" Agent (specs, documentation)
Each agent has different roles and skills.
Putting It in Practice
Step 1: Identify Parallelizable Tasks
Find tasks without mutual dependencies. Example for a CRUD feature:
- ✅ Parallelizable: DB schema + UI components + tests
- ❌ Sequential: DB migration → API endpoint → frontend integration
Step 2: Configure Agents
Each agent needs:
- An isolated working directory (git worktree)
- Appropriate skills for its task
- Clear context (what to do, boundaries)
Step 3: Manage Conflicts
The main multi-agent risk: merge conflicts.
Solutions:
- Separate working directories (worktrees)
- Split by file/module (no overlap)
- Frequent merges to main branch
Limitations and Cautions
- Cost: Each agent consumes tokens. 4 agents = ~4x the cost.
- Complexity: Orchestration adds complexity. Don't multi-agent a simple project.
- Conflicts: Agents can produce incompatible code. Reviews are essential.
- Debugging: Tracing a bug across multiple agents is harder.
When to Use Multi-Agent?
| Situation | Approach |
|---|---|
| Simple feature | 1 agent is enough |
| Complex feature, independent modules | Multi-agent |
| Quick prototype | Loki Mode |
| Existing project, large refactoring | Gastown |
| Team wanting to standardize | Skills + 1 agent |
Conclusion
Multi-agent is a force multiplier, not a silver bullet. Use it when tasks are truly parallelizable and the time savings justify the added complexity.