Orca — Agent Orchestrator
One-time setup: see references/SETUP.md if orca is not already on your PATH.
You are the orchestrator. Use the
CLI below. You never need tmux knowledge.
Identify yourself
Before using Orca, determine which agent you are and jump to your section:
rules
Every
must include
so the daemon knows parent → child links and where to route notifications.
OpenClaw (L0 orchestrator):
- — OpenClaw is the only true L0 orchestrator. It lives outside tmux and receives notifications via .
cc / cx / cu (always in tmux):
- Check in your environment.
- If set: you are a worker —
--spawned-by "$ORCA_WORKER_NAME"
(the plain name from , e.g. , ), NOT the emoji label, NOT .
- If not set: you are the L0 orchestrator — . Orca auto-detects or generates your L0 pane name.
Workers spawning sub-workers:
- Same rule:
--spawned-by <your-worker-name>
from or .
OpenClaw (L0 orchestrator)
You are an OpenClaw agent — the
only true L0 orchestrator. Notifications go via
, not tmux. The user only sees results if you route them explicitly via
.
bash
orca spawn "fix the login bug" -b cc -d ~/proj --orchestrator openclaw \
--reply-channel slack --reply-to C0AGZA4178Q --reply-thread 1234567890.123456 \
--spawned-by openclaw
| Flag | Required? | Notes |
|---|
| Yes | |
| Yes | L0 orchestrator marker |
| Yes | , , , etc. |
| Yes | Channel ID or user ID for delivery |
| No | Thread ID for threaded replies (Slack) |
| No | OpenClaw session ID for scoped killall/gc |
| No | Not used — OpenClaw delivers via system events, not tmux panes |
Without and , will fail. Set
ORCA_ALLOW_OPENCLAW_WITHOUT_REPLY=1
only for automation.
When you receive the completion event:
- Run to review the output
- Summarize the results (include PR links if any)
- Send the summary via
openclaw message send --channel <ch> --target <target> --message <summary>
- Do NOT reply in-session — the user won't see that. Use .
Claude Code ( / )
You must be running inside a tmux pane. Orca auto-detects your tmux pane for notification delivery — this does not work outside tmux. If a human launched you as the orchestrator, they must have started your session inside a tmux window first.
Check
in your environment:
- If set: you are a worker —
--spawned-by "$ORCA_WORKER_NAME"
- If not set: you are the L0 orchestrator —
bash
# As a worker (ORCA_WORKER_NAME is set):
orca spawn "fix the login bug" -b cc -d ~/proj \
--orchestrator cc --spawned-by "$ORCA_WORKER_NAME"
# As L0 orchestrator (ORCA_WORKER_NAME is not set):
orca spawn "fix the login bug" -b cc -d ~/proj \
--orchestrator cc --spawned-by self
| Flag | Required? | Notes |
|---|
| Yes | Tells the daemon to send completions to your tmux pane |
| Yes | if set, or if L0 |
| No | Auto-detected from your current tmux pane — omit unless overriding |
| No | Auto-resolved from your parent's depth |
Codex ( / )
You must be running inside a tmux pane. If a human launched you as the orchestrator, they must have started your session inside a tmux window first.
Check
in your environment:
- If set: you are a worker —
--spawned-by "$ORCA_WORKER_NAME"
- If not set: you are the L0 orchestrator —
bash
# As a worker (ORCA_WORKER_NAME is set):
orca spawn "add unit tests" -b cx -d ~/proj \
--orchestrator cx --spawned-by "$ORCA_WORKER_NAME"
# As L0 orchestrator (ORCA_WORKER_NAME is not set):
orca spawn "add unit tests" -b cx -d ~/proj \
--orchestrator cx --spawned-by self
| Flag | Required? | Notes |
|---|
| Yes | |
| Yes | if set, or if L0 |
| No | Auto-detected |
Cursor ( / )
You must be running inside a tmux pane. If a human launched you as the orchestrator, they must have started your session inside a tmux window first.
Check
in your environment:
- If set: you are a worker —
--spawned-by "$ORCA_WORKER_NAME"
- If not set: you are the L0 orchestrator —
bash
# As a worker (ORCA_WORKER_NAME is set):
orca spawn "refactor auth" -b cu -d ~/proj \
--orchestrator cu --spawned-by "$ORCA_WORKER_NAME"
# As L0 orchestrator (ORCA_WORKER_NAME is not set):
orca spawn "refactor auth" -b cu -d ~/proj \
--orchestrator cu --spawned-by self
| Flag | Required? | Notes |
|---|
| Yes | |
| Yes | if set, or if L0 |
| No | Auto-detected |
Sub-workers (worker spawning further workers)
If you are a worker spawning sub-workers:
- Always pass
--spawned-by <your-worker-name>
— the plain name from or (e.g. , ), NOT the emoji label.
- Only OpenClaw uses . If you are a worker, you must use your own worker name.
- Orca fails closed if you omit or pass the wrong name.
bash
# Example: you are worker "fin" spawning sub-workers
orca spawn "sub-task A" -b cx -d ~/proj --orchestrator cc --spawned-by fin
orca spawn "sub-task B" -b cc -d ~/proj --orchestrator cc --spawned-by fin
Max depth is 3 (
). Max 10 running workers per orchestrator (
). At max depth, do the work yourself.
Headless / scripts (not interactive agents)
To use
, set
ORCA_ALLOW_SPAWN_WITHOUT_ORCHESTRATOR=1
.
CLI reference
bash
orca spawn "fix the login bug" -b cc -d ~/proj --orchestrator openclaw --spawned-by openclaw
orca spawn "add unit tests" -b cx -d ~/proj --base-branch develop --orchestrator cx --spawned-by fin
orca spawn "refactor auth" -b cu -d ~/proj --orchestrator cu --spawned-by ace
orca list # List all workers
orca status <name> # Detailed status (last output lines)
orca logs <name> # Full terminal output
orca steer <name> "also add tests" # Send follow-up to a running worker
orca kill <name> # Kill a single worker (warns if not yours)
orca killall --mine # Kill YOUR workers only (safe, auto-detects pane)
orca killall --force # Kill ALL workers globally (requires human approval!)
orca gc --mine # Clean up YOUR done/dead workers
orca gc --force # Clean up ALL done/dead workers (requires human approval!)
orca daemon start|stop|status # Daemon management (auto-starts on first spawn)
orca hooks install|uninstall # Install/remove lifecycle hooks for Claude Code & Codex
orca report -w <name> -e done # Report worker lifecycle event (used by hooks)
Backends
| Flag | Agent |
|---|
| Claude Code |
| Codex |
| Cursor Agent |
Cleanup responsibility
- Do NOT kill or gc workers automatically. The human decides when to kill/gc — they may want to inspect logs, review branches, or cherry-pick work first.
- If the human explicitly asks you to clean up, use (safe, scoped to your workers only).
Recovering work after /
When a worker is killed or garbage-collected, Orca auto-stashes uncommitted changes before removing the worktree. Stashes attach to the main repo, not the deleted worktree path.
From the
project root (
directory):
bash
git stash list # look for "orca-preserving <worker> …"
git stash show -p stash@{n} # inspect the diff
git stash pop # or: git stash apply stash@{n}
- Committed work on a branch is unaffected by stash; detached commits still need branches per normal Git rules.
- Pass to , , or to skip stashing (automation escape hatch).
- Debugging: has , , and entries; has lifecycle events; has terminal output; has daemon diagnostics.
DO
- Spawn workers for independent tasks that can run in parallel
- After spawning, stop and wait silently -- the daemon notifies you when workers finish
- Use / only when the user asks what's happening
- Do NOT kill or gc workers yourself — the human decides when to clean up
- Always pass with the correct value for your agent type
DON'T
- NEVER run , , or unless the human explicitly asks -- killing workers can destroy in-progress work and kill orchestrator panes
- Don't sleep or poll -- no , no loops, no periodic checks. Just stop and wait for the daemon notification.
- Don't use tmux commands directly -- always go through
- Don't spawn more than 4-5 workers at once unless explicitly asked
- Don't steer workers with huge messages -- spawn a fresh worker instead
- Don't spawn sub-workers if you're at max depth -- do the work yourself
- Don't stop the daemon () -- other orchestrators share it