Skill v1.0.0
currentAutomated scan100/100name: muster description: Dispatch unattended Claude worker sessions over ACP, then watch them, answer their permission questions, follow up, collect their reports, and clean up. Use when the user asks to dispatch a worker, run a ticket in the background, or delegate work to a headless worker, and unasked when you are about to hand off a milestone that changes code in a repository and has a checkable done condition. Not for read-only lookups or research, which stay in an Agent subagent. metadata: version: "1.0.0"
Muster: coordinate unattended workers
Each worker is a Claude session in its own clone of the repository (called the worktree below, under the run directory), on branch muster/NAME. Muster fetches that branch back into the repository at the end of every turn, so git log muster/NAME works from the repository. The clone keeps the repository's local core.hooksPath, so the repository's hooks run on the worker's commits. NAME must not already be a branch in the repository; a taken name is refused. NAME is the run name you choose; it must match ^[a-z0-9][a-z0-9-]{0,39}$.
Requires Bun, Node 22 or later, and git. run starts each worker through the ACP adapter @agentclientprotocol/claude-agent-acp, which bunx fetches from registry.npmjs.org at the version pinned in src/launch.ts; the adapter declares Node 22 or later, and bunx runs it under node. Check with bun --version and node --version before the first dispatch.
Dispatch
Dispatch blocks until the worker's first turn ends, so start it with Bash(run_in_background: true). The client exits with the turn: the worker's background processes end with it, and nothing waits for a follow-up. --model takes one of these values; pick by the shape of the ticket, and go one step up when in doubt:
--model | --effort | Model | Fits a ticket that | |
|---|---|---|---|---|
haiku | medium | Haiku 5.5 | answers a known question from the code or docs, or makes a mechanical change checked against a stated red/green test | |
sonnet | medium | Sonnet 5.5 | implements a pinned contract | |
sonnet | high | Sonnet 5.5 | runs many easy checks across a wide scope, or explores from a known starting point | |
opus | high | Opus 5.5 | hinges on one hard judgment | |
opus | xhigh | Opus 5.5 | enters unknown territory, plans, or verifies another worker's output | |
fable | high | Fable 5.1 | stays hard after an opus attempt failed for lack of judgment, not for missing context |
The model sets the ceiling of what the worker can judge correctly; effort sets how far it searches and checks within it. A worker that is confidently wrong needs a stronger model; one that stops short or skips a check needs more effort first. Never use low with haiku or sonnet.
Use these aliases, not full IDs: the adapter offers the newest models only under them, a full ID such as claude-opus-5 is an older generation, and the session's own ID such as claude-opus-5-5 is refused. default is refused too. --effort is optional; without it the worker runs at the adapter's default for that model (high for haiku in a real run). An effort the chosen model does not offer is refused. A refused model or effort's report lists every offered value with its display name.
bun ${CLAUDE_PLUGIN_ROOT}/src/muster.ts run --name NAME --model MODEL [--effort EFFORT] [--unfenced] [--issue URL] --repo /abs/path/to/repo --ticket "TICKET TEXT"
Use --ticket-file PATH instead of --ticket for a long ticket. Add --issue URL to tie the run to the work item it serves, such as an obsidian:// link to its pm card; muster stores the value in meta.json without reading it, and /muster-runs groups runs by it. Use --base REF to start from a ref other than HEAD. The worker's Bash runs inside the OS sandbox; add --unfenced to run it outside, for a ticket whose checks the sandbox cannot run, such as a suite that starts its own sandbox-exec; see Confinement. The first stdout line is RUNDIR=<path>; keep that path for collect. The last stdout line, printed as the turn ends, is the line status NAME prints at that moment, so the exit of the background run task tells you the outcome and you need no status call after it.
Wait
A finished turn is reported by the exit of the background run or followup task: its last line is the status line, whose state= tells you what to do next. You need watch only to be told about a question while the turn is still running, since the turn then waits on you. Start it through Bash(run_in_background: true), in the same message as run if you like (it waits up to 30 seconds for the run to appear, as run creates it only after cloning the repository); it prints one line per state change and exits when the run needs you or ends. Monitor can stream the same output when it is available.
With Claude Code 2.1.304 or later, a band above the prompt lists the in-flight runs of this repository, each with a glyph for its state, its title and its task-list progress as a five-cell bar then done/total (# N tool calls when it has no plan); its header counts running, question, idle and finished runs, and shows N to collect beside them while finished runs wait for collection.
/muster-runs opens a pane that lists every run of this repository until it is cleaned, finished ones included, grouped by --issue; a run that exited without a report shows its exit reason there. The pane draws each issue as a tree, one branch per run, led by the same state glyph (… starting, ● running, ? question, ○ idle, √ done, × blocked, ◊ malformed, ■ exited), and its header counts the running, question, idle, done and blocked runs by glyph. In the pane the arrows and Enter fold an issue or show a run's report line, BLOCKED reason, open questions with their paths, where its latest plan stands, its last three messages, and any refused permission. On the terminal an issue that is an http(s):// or obsidian:// link has an open Button. The pane only shows; answering and following up stay with the coordinator. Its hand-off Button puts muster run NAME (STATE, issue URL): in the prompt for the person to finish, so a prompt that opens that way is about run NAME: read its status before acting on what follows.
bun ${CLAUDE_PLUGIN_ROOT}/src/muster.ts watch NAME
It exits on question, idle, done, blocked, malformed, or dead. To read the state once, run:
bun ${CLAUDE_PLUGIN_ROOT}/src/muster.ts status NAME
The status line carries deps=<copied>/<total> when the run records its dependency directories: how many of the directories holding a lockfile were copied into the worker's worktree, out of how many hold one. deps=0/0 means none holds a lockfile.
Once a run has exited, the last fields of its status line are exit-reason=<reason> and, when the exit had a detail, exit-detail= followed by the detail as a JSON-quoted string. They appear whatever REPORT.md says: a turn that ended normally shows exit-reason=turn-ended, a done run included. A run whose turn is still in progress carries neither.
Answer
When the state is question, decide and answer it. The only decisions are allow and deny; a decision covers that one request.
bun ${CLAUDE_PLUGIN_ROOT}/src/muster.ts answer NAME allow
Add --n N when more than one question is pending. Then wait again. A question left unanswered for 30 minutes ends the run. Muster writes REPORT.md only when a turn ends, and the turn the timeout cuts short never ends on its own, so muster writes a BLOCKED report with question-timeout as the reason and the run ends blocked. Set MUSTER_QUESTION_TIMEOUT_MS in the environment of muster run or muster followup to change the limit for that turn.
Follow up
Once the turn has ended (done, blocked, malformed, idle, or dead), you can send the worker its next instruction. followup starts a new client that resumes the worker's session, so the worker remembers the earlier turns, and runs one turn with the same model, effort, fence and tools as the run. Like run, it blocks until that turn ends and prints the status line as its last stdout line, so start it with Bash(run_in_background: true); its exit reports the outcome, and watch is needed only for a question mid-turn:
bun ${CLAUDE_PLUGIN_ROOT}/src/muster.ts followup NAME "NEXT INSTRUCTION"
Use followup NAME --file PATH for longer text. followup removes the previous REPORT.md before the turn starts; the new turn writes the next one. While a client for NAME is still running (a turn in progress, or another followup starting), followup refuses with a client is still running and exits 1 without starting anything; wait for the turn to end and send it again. It also refuses a run whose session was never opened (no session to resume), such as one whose handshake failed.
state=idle means the turn ended without a final message, so there is no report; its status line ends with exit-reason=turn-ended. Send a follow-up, or review git log <baseSha>..muster/NAME and go to Cleanup.
Collect
Muster writes <RUNDIR>/REPORT.md itself from the worker's final message of each turn; the worker writes no file outside its worktree. The first line of that message, DONE or BLOCKED, decides the state, and a first line that is anything else makes the run malformed; the lines after it hold what the commits do not show. Each follow-up turn replaces the report.
When the state is done, read the report and the worker's commits from the repository. A report state appears only after the branch fetch-back has finished; a fetch-error= field on the status line means it failed and the branch may be missing:
cat "<RUNDIR>/REPORT.md"git log <baseSha>..<head sha>
The status line of a done run carries head=<sha>, the commit the branch pointed at when the run became done. Review and merge that sha, not the branch name: a command the worker left running can still rewrite muster/NAME afterwards. <baseSha> is baseSha in <RUNDIR>/meta.json, so the commits you review are the ones you merge. The status line of a done run also carries deps= as described under Wait.
If the state is blocked or malformed, read REPORT.md the same way before deciding what to do.
If the state is dead, the muster run process is gone without finishing the run, or phase.json is missing, is not a JSON object, or holds a phase value muster does not recognise (all three show reason=phase-unreadable). Read REPORT.md if it exists. The branch holds at most what the last turn's end fetched back; later commits exist only in <RUNDIR>/worktree. Before Cleanup, fetch them into the repository with the same fetch muster runs, where /abs/path/to/repo is the --repo path (repoRoot in <RUNDIR>/meta.json):
git -C /abs/path/to/repo -c fetch.fsckObjects=true fetch -q --no-tags --no-recurse-submodules "<RUNDIR>/worktree" +refs/heads/muster/NAME:refs/heads/muster/NAME
Inspect
Report to the person from status lines and REPORT.md, as a manager reports on their own team; never put a worker's transcript in front of them unasked. Open the worker's session only when the person asks to see it, or when the report and status cannot explain what went wrong (an unclear BLOCKED reason, malformed, dead, the same question coming back), and then say why you are pulling them one level down.
The worker is an ordinary Claude Code session. Once status shows session=<id>, the person can open it from the worktree in a terminal of their own (with Rex, a new tab or pane) — <RUNDIR>/worktree is the worker's worktree:
cd "<RUNDIR>/worktree" && claude --resume <id> --fork-session
--fork-session gives them a copy, so the worker's own transcript is left alone; while the run is in flight that copy is a snapshot taken when it opened. Without --fork-session the person takes over that session, which is only safe after the run has exited. Either way the session they open runs with their own permissions, outside the fence.
Stop
Stop is for a turn in progress: it asks the worker to end the turn; it does not end it at once. The background run or followup task exits when the turn has ended, with the status line as its last line. A run whose turn has already ended needs no stop; stop reports it as already exited.
bun ${CLAUDE_PLUGIN_ROOT}/src/muster.ts stop NAME
Cleanup
As soon as the run's turn has ended, a done run included, remove its run directory with clean; this deletes the worktree, the event log and the report. Branch muster/NAME stays in the repository, so git log <baseSha>..<head sha> still works. Read the report first. clean prints removed <RUNDIR> base=<baseSha> head=<head> (head=unknown when the run recorded none), so keep that line for the review.
bun ${CLAUDE_PLUGIN_ROOT}/src/muster.ts clean NAME
clean removes the run directory only when the worker is not running (phase.json says exited, or the recorded pid is gone, which status shows as dead) and the repository already holds everything in the clone: the commit muster/NAME points at in <RUNDIR>/worktree must be the commit, or an ancestor of the commit, that muster/NAME points at in the repository. fetched and fetchError in phase.json play no part. Otherwise it refuses, removes nothing and exits non-zero: no run directory for NAME, a turn still in progress (wait for it to end, or stop it), meta.json unreadable, or the branch not fetched back. For the last, fetch the branch by hand with the command in Collect, then run clean again.
Confinement
A worker does not get the main session's permissions.
- With
--unfencedthe worker is isolated by its own clone of the repository and nothing else, and Bash is not confined. Bash can read credential stores, reach any host, push with your credentials and write anywhere you can. Test suites that rungit initwork, and a repository or run directory under the temp directories is accepted. File tools are still path-fenced, the tool allowlist and the web fetch host allowlist below still apply. - By default Bash runs inside Claude Code's OS sandbox. Writes are confined to the worker's worktree, the temp directory the sandbox sets as
TMPDIR, the per-user temp directory that Applemktempwrites to (getconf DARWIN_USER_TEMP_DIR), both kept writable for test fixtures, and<RUNDIR>/cache, wherenpm_config_cacheandBUN_INSTALL_CACHE_DIRpoint so package installs work. The adapter itself is installed into<RUNDIR>/launch, which the worker cannot write, because each turn starts it again outside the sandbox. Reads are not confined except for credential stores, which the sandbox denies:~/.npmrc,~/.config/gh,~/.git-credentials,~/.config/git/credentials,~/.netrc,~/.aws,~/.docker/config.json,~/.ssh,~/.pi,~/.config/gcloud,~/.kube,~/.cargo/credentials.toml,~/.pypirc,~/Library/Keychains. The list is best-effort: it does not follow symlink targets or env overrides such asXDG_CONFIG_HOME. A fencedmuster runrefuses a--repoorMUSTER_HOMEunder/tmp,/private/tmpor$TMPDIR, because the sandbox leaves those writable and a worker could then write the repository's refs or answer its own questions. The sandbox protects.git/hooksand.git/configunder the worktree, sogit initthere fails with exit 128; a test suite that builds its fixture repositories undermktemp -druns fenced. A suite that starts its ownsandbox-execcannot, because Seatbelt refuses a nested sandbox (exit 71); pi-dispatch's suite is one. - The worker's tools are a fixed list (Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, ToolSearch, TodoWrite, TaskCreate, TaskUpdate, TaskList), with claude.ai connectors off.
- File tools are fenced by path, judged on each path's realpath. A request inside the worktree passes, except inside the worktree's
.gitor.claudedirectory, which becomes aquestionfor you. Outside the worktree a file tool gets only what fenced Bash can already do, so these pass without aquestion: a read (not a search, whose pattern or glob can reach past its path) that reaches no credential store listed above (a path inside a store, or above one such as~or~/.config, asks), and an edit whose paths are all inside the per-user temp directory and none under the muster runs directory. Any other file request outside the worktree becomes aquestion: an edit anywhere else, including any run's directory, and every move or delete. With--unfencedthe same rules apply, though there Bash is not confined at all. - Web fetches, and Bash network access unless
--unfenced, are limited to the default hosts:registry.npmjs.org. github.com is off the list because a worker can read your git credentials and would otherwise be able to push as you. Hosts listed inMUSTER_ALLOW_HOSTSare added to them, set in the environment ofmuster run:
MUSTER_ALLOW_HOSTS=pypi.org,files.pythonhosted.org bun ${CLAUDE_PLUGIN_ROOT}/src/muster.ts run --name NAME --model MODEL --repo /abs/path/to/repo --ticket "TICKET TEXT"
muster runrecords the resulting list asallowedHostsinmeta.json, and everyfollowupturn uses that list;MUSTER_ALLOW_HOSTSin the environment offollowuphas no effect. An invalid entry makesmuster runrefuse with exit 2.
- A request for any other host, a web fetch outside the list, and every web search is refused without a
question. A worker that cannot proceed ends the runBLOCKED, and its report names the host. - The worker runs the model you named, in default permission mode, and loads no user or project settings.