All skills
Skillintermediate

šŸ¦‘ Orchestrator-Workers

<div align="center">

Claude Code Knowledge Pack7/10/2026

Overview

<div align="center">

šŸ  Home › Workflows › šŸ¦‘ Orchestrator-Workers

← 03 Parallelization ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā—ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā” 05 Evaluator-Optimizer →

</div>

šŸ¦‘ Orchestrator-Workers

TL;DR: A central LLM dynamically breaks down tasks, delegates to specialized worker LLMs, and synthesizes results. Different experts collaborate on the same problem.


Diagram

%%{init: {'theme': 'base', 'themeVariables': {'lineColor': '#64748b'}}}%%
flowchart TB
    classDef user fill:#6366f1,stroke:#4f46e5,stroke-width:2px,color:#ffffff
    classDef main fill:#8b5cf6,stroke:#7c3aed,stroke-width:2px,color:#ffffff
    classDef subagent fill:#ec4899,stroke:#db2777,stroke-width:2px,color:#ffffff

    INPUT["šŸ™‹ā€ā™€ļøšŸ“„ Review this PR"]:::user --> ORCH["šŸ” Main Agent"]:::main

    ORCH -->|"šŸ”šŸŖŗ Check vulns"| W1["šŸ¦šŸ”’ Security Expert"]:::subagent
    ORCH -->|"šŸ”šŸŖŗ Check perf"| W2["🐦⚔ Performance Expert"]:::subagent
    ORCH -->|"šŸ”šŸŖŗ Check style"| W3["šŸ¦šŸŽØ Style Expert"]:::subagent

    W1 -->|"šŸ¦šŸ“¤ 2 SQLi found"| SYNTH["šŸ”šŸŒ€ Synthesize"]:::main
    W2 -->|"šŸ¦šŸ“¤ O(n²) loop"| SYNTH
    W3 -->|"šŸ¦šŸ“¤ 3 violations"| SYNTH

    SYNTH -->|"šŸ”šŸ“¤"| OUTPUT["šŸ’ā€ā™€ļøšŸ“¤ Final Report"]:::user

Key Insight

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│  šŸ¦‘ ORCHESTRATOR-WORKERS: Different specialists                             │
ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
│                                                                             │
│  Each 🐦 subagent has a DIFFERENT expertise and does a DIFFERENT task.      │
│                                                                             │
│  Key difference from šŸ›¤ļø Parallelization: subtasks aren't pre-defined,       │
│  but determined by the orchestrator based on the specific input.            │
│                                                                             │
│  Analogy: Hospital team → Different experts collaborate                     │
│           (Chef + Pastry + Sommelier, not 3 cooks making same recipe)       │
│                                                                             │
│  Compare:                                                                   │
│  - šŸ›¤ļø Parallelization: Same worker + Different data (assembly line)        │
│  - šŸ¦‘ Orchestration: Different workers + Same data (expert team)            │
│                                                                             │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Characteristics

PropertyValue
ComplexityHigh
ParallelismHigh
Human-LoopOptional
IterationAs needed

When to Use

Well-suited for complex tasks where you can't predict the subtasks needed. The key difference from parallelization is its flexibility — subtasks aren't pre-defined, but determined by the orchestrator based on the specific input.

Use CaseOrchestration
Coding productsMake complex changes to multiple files dynamically
Search tasksGather and analyze from multiple sources
PR ReviewSecurity + Performance + Style experts

šŸ” Main Agent Responsibilities

ResponsibilityDescription
DecompositionBreak complex task into subtasks
AssignmentRoute subtasks to appropriate 🐦 subagents
MonitoringTrack 🐦 subagent progress
SynthesisCombine results into coherent output

🐦 Subagent Definition Example

# .claude/agents/code-reviewer.md

---
name: code-reviewer
description: Reviews code for quality, security, and best practices.
tools: Read, Grep, Glob
model: sonnet
permissionMode: plan
---

You are a senior code reviewer with expertise in security, performance, and maintainability.

## Review Checklist

1. **Security** - SQL injection, XSS, secrets exposure, auth bypasses
2. **Performance** - O(n²) loops, memory leaks, unnecessary computations
3. **Code Quality** - DRY violations, dead code, unclear naming
4. **Best Practices** - Error handling, logging, testing coverage

## Output Format

### āŒ CRITICAL (must fix before merge)
- [file:line] Issue description

### āš ļø WARNING (should address)
- [file:line] Issue description

### ā„¹ļø SUGGESTIONS (nice to have)
- [file:line] Issue description

Full Orchestration Example

# šŸ” Main Agent orchestrates PR review with specialists

# Step 1: Decompose - identify what experts are needed
changed_files = get_pr_diff()  # ["auth.py", "api.py", "styles.css"]

# Step 2: Assign - spawn appropriate specialists
Task(
    subagent_type="security-reviewer",
    prompt=f"Review these files for security: {changed_files}"
)

Task(
    subagent_type="performance-reviewer",
    prompt=f"Review these files for performance: {changed_files}"
)

Task(
    subagent_type="style-reviewer",
    prompt=f"Review these files for style/quality: {changed_files}"
)

# Step 3: Monitor - wait for all subagents to complete
# (handled automatically by Task tool)

# Step 4: Synthesize - combine into final report
"""
## PR Review: #123 - Add user authentication

### Security Review (🐦 security-reviewer)
āŒ CRITICAL: SQL injection in auth.py:45

### Performance Review (🐦 performance-reviewer)
āš ļø WARNING: O(n²) loop in api.py:78

### Final Verdict: āŒ CHANGES REQUESTED
"""

Critical Rules

RuleExplanation
No nested subagents🐦 Subagents cannot spawn other 🐦 subagents
Isolated contextEach 🐦 subagent starts fresh, no shared memory
Report to orchestratorResults flow back to šŸ” Main Agent only

When NOT to Use

  • Simple tasks not worth decomposition overhead
  • Workers need heavy inter-communication

<div align="center">

← 03 Parallelization ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā—ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā” 05 Evaluator-Optimizer →

</div>