name: oa-orchestration-delegate description: "CLI reference for oa delegate — automatic orchestrator+workers spawning. Use when a task needs hierarchical decomposition with an orchestrator managing parallel workers. Activates for: oa delegate, delegate task, orchestrator, max-workers, --orchestrator-model." user-invocable: false disable-model-invocation: true allowed-tools: Bash(oa *)
Critical Rules
- ALWAYS use
oa delegateinstead ofoa runwhen the task needs autonomous decomposition — the orchestrator handles subtask breakdown so you don't have to (D-051). - NEVER skip
--modelfor workers — without it the default may change between oa-cli versions; always specifyclaude/sonnet,claude/opus, orclaude/haiku. - NEVER use
oa delegatefrom inside another agent — nested spawning creates invisible agents outsideoa status(L-009).
Decision Tree
Task needs execution?
├── Single isolated task, you define the scope → oa run
├── Multi-step pipeline, you define the steps → oa pipeline
└── Complex task, let AI decompose it → oa delegate
Use oa delegate when the decomposition itself is non-trivial and you want an orchestrator agent to analyze, break down, and coordinate workers automatically.
Instructions
- Run
oa startand verify session withoa statusbefore delegating. - Choose worker model (
--model) and orchestrator model (--orchestrator-model). - Set
--max-workersto control concurrency (default: 5). - Run
oa delegate "<task>"— the orchestrator spawns and manages workers. - Monitor with
oa statusand collect results viaoa collect <name>.
Patterns
Pattern 1: Minimal delegate
oa delegate "Analyze all Python files in /project and write a report" \
--name analysis-orchestrator \
--model claude/sonnet \
--orchestrator-model claude/opus
Pattern 2: Full flag reference
oa delegate "task description"
--name base-name # base name for the orchestrator agent
--model claude/sonnet # REQUIRED: model for worker agents
--orchestrator-model claude/opus # orchestrator model (default: claude/opus)
--max-workers 5 # max concurrent workers per batch (default: 5)
Pattern 3: Controlled batch size
oa delegate "Process 20 documents in /data/" \
--name doc-processor \
--model claude/haiku \
--orchestrator-model claude/sonnet \
--max-workers 3
Anti-Patterns
- Bad:
oa delegate "small single-step task"— orchestrator overhead not justified for simple work; useoa runinstead. - Bad:
oa delegate "task" --model claude— bare model name may change; always specifyclaude/sonnet,claude/haiku, orclaude/opus. - Bad: Calling
oa delegateinside an agent prompt — spawns invisible nested agents; delegate only from the orchestrator session.
References
- Related: oa-orchestration-spawn, oa-orchestration-pipeline, oa-state-lifecycle