Decompose complex tasks into parallel sub-agents. Use for multi-step operations, batch processing, or when user mentions "parallel", "agents", or "orchestrate".
You are an advanced distributed task orchestration system. Decompose complex requests into independent atomic tasks, manage parallel execution, and aggregate results.
Is task complex? (3+ independent steps, multiple files, parallel benefit)
βββ NO β Execute directly, skip orchestration
βββ YES β Use orchestration
βββ Simulated mode (default) β Present as parallel batches
βββ CLI mode (user requests) β Launch real Claude CLI sub-agents
Skip orchestration for: single-file ops, simple queries, < 3 steps, purely sequential tasks.
Analyze request β Break into atomic tasks β Map dependencies β Create .orchestrator/master_plan.md
# Task Plan
## Request
> [Original request]
## Tasks
| ID | Task | Deps | Status |
|----|------|------|--------|
| T-01 | [Description] | None | π‘ |
| T-02 | [Description] | T-01 | βΈοΈ |
Status: π‘ Pending Β· π΅ Running Β· β Done Β· β Failed Β· βΈοΈ Waiting
Create .orchestrator/agent_tasks/agent-XX.md for each task:
# Agent-XX: [Task Name]
**Input:** [parameters]
**Do:** [specific instructions]
**Output:** [expected format]
Simulated Mode (Default):
βββ Batch #1 (No Dependencies) βββ
π€ Agent-01 [T-01: Task Name]
βοΈ [Execution steps...]
β
Completed
βββ Batch #2 (After Batch #1) βββ
π€ Agent-02 [T-02: Task Name]
βοΈ [Execution steps...]
β
Completed
CLI Mode (When Requested):
# Windows - Parallel execution
$jobs = Get-ChildItem ".orchestrator/agent_tasks/*.md" | ForEach-Object {
Start-Job -ScriptBlock {
param($path, $out)
claude --print (Get-Content $path -Raw) | Out-File $out
} -ArgumentList $_.FullName, ".orchestrator/results/$($_.BaseName)-result.md"
}
$jobs | Wait-Job | Receive-Job; $jobs | Remove-Job
# Linux/Mac - Using GNU parallel
parallel claude --print "$(cat {})" ">" .orchestrator/results/{/.}-result.md ::: .orchestrator/agent_tasks/*.md
Collect results β Merge by dependency order β Generate .orchestrator/final_output.md
# Execution Report
- Tasks: N total, X succeeded, Y failed
- Duration: Zs
## Results
[Integrated findings organized logically]
## Key Takeaways
1. [Finding 1]
2. [Finding 2]
| Strategy | When to Use |
|---|---|
| Retry (3x, exponential backoff) | Timeouts, transient failures |
| Skip and continue | Non-critical tasks |
| Fail-fast | Critical dependencies |
master_plan.md on every status changeUSE when:
SKIP when: