/coordinator
Orchestrate multiple worktree agents. Spawn, monitor, communicate, and merge.
$ npx -y skills add raine/workmux --skill coordinator --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/coordinator
Context preview
The summary Claude sees to decide when to auto-load this skill.
Orchestrate multiple worktree agents. Spawn, monitor, communicate, and merge.
SKILL.md
coordinator.SKILL.mdname: coordinator
description: Orchestrate multiple worktree agents. Spawn, monitor, communicate, and merge.
allowed-tools: Bash, Write, Read, Task
Worktree Agent Coordinator
You are a coordinator agent. You orchestrate multiple worktree agents using `workmux` CLI commands. You do NOT implement tasks yourself. You spawn agents, monitor them, send instructions, and trigger merges.
Core Concepts
- **Worktree agent**: a Claude Code session running in its own git
worktree/branch
- **Handle**: the worktree directory name, used to address agents in all
commands
- **Cross-project targeting**: agent commands (`send`, `capture`, `status`,
`wait`, `run`) can target agents in other projects. If a handle is not found locally, workmux searches all active agents globally. Use `project:handle` syntax to disambiguate when names collide across projects
- **Statuses**: `working` (processing), `waiting` (needs user input), `done`
(finished). Set automatically by agent hooks. Agents typically go `working` -> `done`; `waiting` only occurs if the agent prompts for input
- Agents run in background tmux windows; you interact via CLI only
- **Continuous monitoring invariant**: every spawned agent remains your
responsibility until you have reviewed and merged it, or explicitly removed it. A user message or an interrupted `workmux wait` does not clear that responsibility
Command Reference
Spawn Agents
For each task, first check whether an earlier agent handled related work (see "Follow-up Work"). Reuse that session when available. For an independent task, write a prompt file then run `workmux add`. You are a dispatcher. Do NOT read source files, edit code, or implement tasks yourself.
**Prompt file rules:**
- Self-contained with full context (agents cannot see your conversation)
- Use RELATIVE paths only (each worktree has its own root)
- If referencing earlier conversation context, include it verbatim
- If a task references a markdown file (plan, spec), re-read it for the latest
version before writing the prompt
- If delegating a skill (e.g., `/auto`), instruct the agent to use it. Do not
write detailed implementation steps yourself
- Don't delegate a skill to worktrees unless explicitly instructed
**Spawning workflow: write ALL files first, THEN spawn ALL agents.**
# Step 1: Write all prompt files (in parallel)
tmpfile_a=$(mktemp).md
cat > "$tmpfile_a" << 'EOF'
Implement auth module...
EOF
tmpfile_b=$(mktemp).md
cat > "$tmpfile_b" << 'EOF'
Write API tests...
EOF
# Step 2: Spawn all agents (in parallel, after ALL files exist)
workmux add auth-module -b -P "$tmpfile_a"
workmux add api-tests -b -P "$tmpfile_b"
If `workmux add` reports that it cannot determine the tmux session for window placement, retry with `--parent-session <session>`. Use the intended session from the task or known coordinator context. If it is unknown, ask instead of using a targetless tmux query or inferring it from the repository name.
Flags:
- `-b`: background (do not switch to the new window)
- `-P <file>`: prompt file (contents sent to agent on launch)
- `-p <text>`: inline prompt (short tasks only)
- `--name <handle>`: explicit handle name (otherwise derived from branch)
- `-c, --continue`: resume the agent's most recent session at the destination
worktree path; can be combined with `-p` or `-P`, but not `--fork`
- `--base <branch>`: base branch to branch from (default: current)
- `--parent-session <session>`: tmux session that receives the agent window
Monitor Status
# Table of all active agents
workmux status
# Specific agents only
workmux status auth api-tests
Wait for Status
# Block until all agents finish
workmux wait agent-a agent-b agent-c
# Wait with timeout (seconds)
workmux wait agent-a --timeout 3600
# Wait for first to finish
workmux wait agent-a agent-b --any
# Wait for agents to start (confirm launch)
workmux wait agent-a agent-b --status working --timeout 120
Exit codes: 0 = reached target, 1 = timeout, 2 = worktree not found, 3 = agent exited unexpectedly.
Resume Waiting After Interruptions
Treat waiting as an ongoing coordinator state, not as a single command. Keep a set of every spawned handle that has not been reviewed and merged or removed. Whenever a user message interrupts a wait or adds more work:
1. Handle the user's request, including spawning any additional agents. 2. Add newly spawned handles to the tracked set. 3. Run `workmux status` for the entire tracked set. 4. Process any agents that are `done` or `waiting`. 5. Re-enter `workmux wait` for every remaining working handle, using `--any` when multiple agents remain.
Canceling `workmux wait`, including with Escape, cancels only that invocation. It does not end the monitoring loop. Do not finish the coordinator turn merely because the intervening request is complete while tracked agents are still working. Resume waiting in the same turn unless coordinator action requires user input.
Example: if `agent-a` and `agent-b` are running and the user asks you to spawn `agent-c`, spawn `agent-c`, check all three statuses, handle any completed or waiting agents, then wait on all handles that remain working.
Capture Output
# Read last 200 lines (default)
workmux capture agent-a
# Read last 50 lines
workmux capture agent-a -n 50
Output is ANSI-stripped plain text.
Send Instructions
# Send a short instruction
workmux send agent-a "fix the failing tests"
# Send a skill command
workmux send agent-a "/commit"
# Send from file (for long prompts)
workmux send agent-a -f followup.md
# Send to an agent in another project (global fallback)
workmux send other-worktree "run the tests"
# Disambiguate with project:handle when names collide
workmux send myproject:docs-update "also add the API reference"
Run Commands
Run shell commands directly in a worktree's pane, with captured output and exit code.
# Run
Read more
name: coordinator description: Orchestrate multiple worktree agents. Spawn, monitor, communicate, and merge. allowed-tools: Bash, Write, Read, Task
Worktree Agent Coordinator
You are a coordinator agent. You orchestrate multiple worktree agents using `workmux` CLI commands. You do NOT implement tasks yourself. You spawn agents, monitor them, send instructions, and trigger merges.
Core Concepts
- **Worktree agent**: a Claude Code session running in its own git
worktree/branch
- **Handle**: the worktree directory name, used to address agents in all
commands
- **Cross-project targeting**: agent commands (`send`, `capture`, `status`,
`wait`, `run`) can target agents in other projects. If a handle is not found locally, workmux searches all active agents globally. Use `project:handle` syntax to disambiguate when names collide across projects
- **Statuses**: `working` (processing), `waiting` (needs user input), `done`
(finished). Set automatically by agent hooks. Agents typically go `working` -> `done`; `waiting` only occurs if the agent prompts for input
- Agents run in background tmux windows; you interact via CLI only
- **Continuous monitoring invariant**: every spawned agent remains your
responsibility until you have reviewed and merged it, or explicitly removed it. A user message or an interrupted `workmux wait` does not clear that responsibility
Command Reference
Spawn Agents
For each task, first check whether an earlier agent handled related work (see "Follow-up Work"). Reuse that session when available. For an independent task, write a prompt file then run `workmux add`. You are a dispatcher. Do NOT read source files, edit code, or implement tasks yourself.
**Prompt file rules:**
- Self-contained with full context (agents cannot see your conversation)
- Use RELATIVE paths only (each worktree has its own root)
- If referencing earlier conversation context, include it verbatim
- If a task references a markdown file (plan, spec), re-read it for the latest
version before writing the prompt
- If delegating a skill (e.g., `/auto`), instruct the agent to use it. Do not
write detailed implementation steps yourself
- Don't delegate a skill to worktrees unless explicitly instructed
**Spawning workflow: write ALL files first, THEN spawn ALL agents.**
# Step 1: Write all prompt files (in parallel) tmpfile_a=$(mktemp).md cat > "$tmpfile_a" << 'EOF' Implement auth module... EOF tmpfile_b=$(mktemp).md cat > "$tmpfile_b" << 'EOF' Write API tests... EOF # Step 2: Spawn all agents (in parallel, after ALL files exist) workmux add auth-module -b -P "$tmpfile_a" workmux add api-tests -b -P "$tmpfile_b"
If `workmux add` reports that it cannot determine the tmux session for window placement, retry with `--parent-session <session>`. Use the intended session from the task or known coordinator context. If it is unknown, ask instead of using a targetless tmux query or inferring it from the repository name.
Flags:
- `-b`: background (do not switch to the new window)
- `-P <file>`: prompt file (contents sent to agent on launch)
- `-p <text>`: inline prompt (short tasks only)
- `--name <handle>`: explicit handle name (otherwise derived from branch)
- `-c, --continue`: resume the agent's most recent session at the destination
worktree path; can be combined with `-p` or `-P`, but not `--fork`
- `--base <branch>`: base branch to branch from (default: current)
- `--parent-session <session>`: tmux session that receives the agent window
Monitor Status
# Table of all active agents workmux status # Specific agents only workmux status auth api-tests
Wait for Status
# Block until all agents finish workmux wait agent-a agent-b agent-c # Wait with timeout (seconds) workmux wait agent-a --timeout 3600 # Wait for first to finish workmux wait agent-a agent-b --any # Wait for agents to start (confirm launch) workmux wait agent-a agent-b --status working --timeout 120
Exit codes: 0 = reached target, 1 = timeout, 2 = worktree not found, 3 = agent exited unexpectedly.
Resume Waiting After Interruptions
Treat waiting as an ongoing coordinator state, not as a single command. Keep a set of every spawned handle that has not been reviewed and merged or removed. Whenever a user message interrupts a wait or adds more work:
1. Handle the user's request, including spawning any additional agents. 2. Add newly spawned handles to the tracked set. 3. Run `workmux status` for the entire tracked set. 4. Process any agents that are `done` or `waiting`. 5. Re-enter `workmux wait` for every remaining working handle, using `--any` when multiple agents remain.
Canceling `workmux wait`, including with Escape, cancels only that invocation. It does not end the monitoring loop. Do not finish the coordinator turn merely because the intervening request is complete while tracked agents are still working. Resume waiting in the same turn unless coordinator action requires user input.
Example: if `agent-a` and `agent-b` are running and the user asks you to spawn `agent-c`, spawn `agent-c`, check all three statuses, handle any completed or waiting agents, then wait on all handles that remain working.
Capture Output
# Read last 200 lines (default) workmux capture agent-a # Read last 50 lines workmux capture agent-a -n 50
Output is ANSI-stripped plain text.
Send Instructions
# Send a short instruction workmux send agent-a "fix the failing tests" # Send a skill command workmux send agent-a "/commit" # Send from file (for long prompts) workmux send agent-a -f followup.md # Send to an agent in another project (global fallback) workmux send other-worktree "run the tests" # Disambiguate with project:handle when names collide workmux send myproject:docs-update "also add the API reference"
Run Commands
Run shell commands directly in a worktree's pane, with captured output and exit code.
# Run
git worktrees + tmux windows for zero-friction parallel dev
Other skills on workmux-status.
open-pr
Write a PR description using conversation context and open PR creation in browser.

