---
name: dispatch
description: |
  Send a BUILD into seclusion: launch a background worker in a mux-managed
  worktree to execute a dispatch-ready plan. Operator-typed — the go into
  seclusion for work that edits code and merges it is always the
  operator's. The worker stops on any decision the plan does not
  pre-answer; the operator answers at the console and the SAME worker
  resumes. Ends in a landing, never a conversation. For document
  production, use /dispatch-draft (model-invocable). Use when:
  "/dispatch", "dispatch this plan".
disable-model-invocation: true
argument-hint: "plan file — e.g., '.claude/plans/foo.md'"
related:
  - type: file
    path: cabinet/dispatch-contract.md
    role: "The single source: bar, stop rule, brief, decision-request and landing shapes"
  - type: skill
    name: dispatch-draft
    role: "The drafting flow, split out so it may be model-invoked; reuses Steps 3-6 here"
  - type: skill
    name: plan
    role: "Where the dispatch-readiness bar is applied (interview + Dispatch section)"
  - type: skill
    name: execute
    role: "The discipline the worker follows inside seclusion — unchanged"
  - type: skill
    name: qa-handoff
    role: "Merged work still lands through the qa-handoff path, unchanged"
---

# /dispatch — Send Work Into Seclusion

## Purpose

`/plan` and `/execute` describe HOW work is done. This skill decides WHERE
it runs: in front of the operator (as today) or in a sealed room. It owns
only the seam — the bar check, the room, the stop rule, park-and-resume,
and the landing. It never re-describes how to execute; the worker follows
the `/execute` discipline exactly as it would interactively.

**This skill is the BUILD flow only.** Document production lives in
`/dispatch-draft`, which is model-invocable because `/plan` must be able
to hand the drafting off at the interview/draft seam without the operator
typing anything. `disable-model-invocation` is a per-skill flag, so one
skill cannot be operator-typed for one flow and open for the other — that
split is the whole reason two skills exist. Steps 3-6 below are shared:
`/dispatch-draft` points at them rather than restating them, so they
change in exactly one place.

Design: `.claude/plans/console-dispatch.md` (CC source repo). Contract —
read it before every dispatch: `.claude/cabinet/dispatch-contract.md`.

## Step 0 — Operator-typed only, and preconditions

This skill is operator-typed (`disable-model-invocation: true`). If it was
not literally typed by the operator, refuse.

**The scope of that rule, narrowed by operator ruling 2026-08-23:** it
governs work that edits code and merges it — a blast radius the operator
must authorize each time. It does NOT govern document production, whose
blast radius is a document the operator still reads and approves, and
which they already requested by typing `/plan`. Applying one rule to both
flows is what made pilot run 1 write its plan inline: the console was the
only party who could see the handoff moment and the only party barred
from acting on it. If the request is drafting, do not refuse it — route
it to `/dispatch-draft`.

Preconditions, checked loudly (name what is missing; never degrade
silently):

- **mux present** (`command -v mux`): required — lanes are created through
  the mux worktree lifecycle, never bare isolation. Without mux, refuse
  and say why.
- **A clean dispatch base:** run `mux worktree preflight` for this
  project. A failing preflight blocks the dispatch (exit 1 = do not spawn
  lanes yet).
- **Permission posture:** workers cannot answer permission prompts in a
  sealed room. If the session is not running in a mode where the worker's
  edits and commands inside its own worktree proceed unprompted, tell the
  operator now and stop.

## Step 1 — Resolve the mode and the input

`/dispatch <plan-file>`: the argument names a plan in `.claude/plans/` (or
a pib action whose notes point at one). Read the plan in full.

If the argument names a topic to WRITE UP rather than a plan to execute,
that is the drafting flow — use `/dispatch-draft` instead of improvising
here.

## Step 2 — The bar check

Check the plan against the dispatch-readiness bar
(`dispatch-contract.md` §1): acceptance criteria, `## Decision Defaults`,
`## Non-Goals`, a `## Dispatch` section quoting the stop rule, worktree
needs. **Refuse a plan that fails the bar, naming each missing item** and
pointing at `/plan`'s dispatch-readiness step to supply it. A refused
plan stays an interactive lane — that is a normal outcome, not an error.

## Step 3 — Create the lane

Derive a short task slug from the plan/topic. Create the lane through the
mux lifecycle:

```bash
mux worktree create <project> <slug>
```

This runs provisioning (declared env files copied main → worktree),
identity setup, and the health check. A failed creation blocks the
dispatch — surface the error verbatim. Record the worktree's absolute
path; the worker needs it.

**Arm the Surface Area guard** (contract §2; act:48d6790a). The stop rule
for files is mechanical, not prose: a PreToolUse hook in the LANE — never
the main checkout — blocks Edit/Write to any path outside the plan's
`## Surface Area` and tells the worker to park. Write it into the lane's
`.claude/settings.local.json` (merge; the worktree copies main's file, so
never overwrite it), pointing at the plan path the brief names:

```bash
WT=<worktree absolute path>; PLAN=<plan path, repo-relative>
test -f "$WT/.claude/hooks/surface-area-guard.sh" \
  || { echo "surface-area-guard.sh is not installed — reinstall CC on main first"; exit 1; }
python3 - "$WT" "$PLAN" <<'PY'
import json, os, sys
wt, plan = sys.argv[1], sys.argv[2]
p = os.path.join(wt, '.claude', 'settings.local.json')
d = json.load(open(p)) if os.path.exists(p) else {}
cmd = f'"$CLAUDE_PROJECT_DIR"/.claude/hooks/surface-area-guard.sh --plan {plan}'
pre = d.setdefault('hooks', {}).setdefault('PreToolUse', [])
if not any(h.get('command') == cmd for e in pre for h in e.get('hooks', [])):
    pre.append({'matcher': 'Edit|Write|MultiEdit|NotebookEdit',
                'hooks': [{'type': 'command', 'command': cmd}]})
json.dump(d, open(p, 'w'), indent=2)
PY
```

For the drafting flow, `--allow <target path> --allow <index README>`
replaces `--plan` (there is no plan file). The guard is unregistered
everywhere else on purpose: it governs one worker in one worktree, and it
reads the lane's copy of the plan, so widening the list is a commit on
the lane branch. A missing hook file is a loud stop, never a silent
dispatch without the guard.

## Step 4 — Compose the brief and launch

Compose the worker brief exactly per `dispatch-contract.md` §3: worktree
path first, then the plan (or the drafting instructions + extracted
brainstorm decisions), the stop rule + routine-call floor verbatim, the
commit discipline, the ~2h timebox, and the landing duties (§5 shapes).
For the build flow the brief says: follow the `/execute` discipline —
spec read, breadcrumbs, AC verification, merge-first close-out is NOT the
worker's job (the console owns merge + qa-handoff at landing; the worker
stops at committed-and-pushed-to-branch). For the drafting flow: write
the document (soft-wrapped prose per the markdown rules), update the
directory's README index in the same change, commit, and land with the
DOCUMENT LANDING shape.

Launch ONE background worker (Agent tool, general-purpose) per lane with
that brief. Then update the desk status:
`~/.config/mux/status-set.sh active "dispatched: <slug>"`. Say one line
to the operator — "<slug> dispatched" — and stop talking. No narration
of the worker's progress exists anywhere; that is the point.

## Step 5 — Park and resume

When a worker returns:

- **A DECISION REQUEST** (contract §4): hold it in this conversation —
  NEVER the inbox. When the request reads "Surface Area is missing
  <file> because <reason>", the plan's list is the thing under decision:
  if the operator widens it, edit the plan's `## Surface Area` in the
  LANE's worktree (the guard reads that copy), commit on the lane branch,
  then resume — the worker's next write to that file passes. Flip status:
  `status-set.sh waiting "<the question, one line>"`. Present it to the
  operator in the register: where the thread stands, the question, the
  options, the recommendation. One decision at a time. On the answer,
  `SendMessage` to the SAME worker (never a fresh spawn — its context is
  the value), then `status-set.sh active "resumed: <slug>"`.
- **A LANDING** (contract §5): proceed to Step 6.
- **Anything else** (an error, a truncated run): report it plainly with
  the work state (branch, last commit) and offer re-dispatch from the
  surviving worktree. Never silently retry.

## Step 6 — Land

1. Relay the worker's landing to the operator VERBATIM in shape (the
   four-part work landing) — plain English, under the
   register's ceiling. During the pilot, always include the routine-calls
   enumeration (trust ratchet).
2. **Advance the thread cursor** in plain English via the watchtower
   runtime's thread helper (`updateThreadFile`,
   `~/.claude-cabinet/watchtower/watchtower-lib.mjs`). If watchtower is
   absent or the write fails, say so in the landing — degrade loudly.
3. **Merges:** if the lane's work should land on main now, run the merge
   from the console using `/qa-handoff`'s merge-now recipe and file the
   qa-handoff exactly as today. If the merge is gated, say what gates it.
4. Reset status: `status-set.sh done "<slug>: landed"` (or `active` if
   more lanes run).

## What this skill never does

- Dispatch a BUILD without the operator typing it.
- Refuse a DRAFTING request on operator-typed grounds — route it to
  `/dispatch-draft`.
- Bypass the mux worktree lifecycle (no bare `git worktree add`, no
  Agent-tool worktree isolation).
- File a decision request to the inbox.
- Summarize a landing into vagueness — the shapes in the contract are the
  floor, not a suggestion.
- Narrate a worker's progress.
