Use when running plan tasks one at a time with a review after each sensitive or Full task — for tasks with dependencies, sensitive code, or shared files.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Dispatching Subagents?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/felipemelendez-dispatching-subagents)
---
name: dispatching-subagents
description: Use when running plan tasks one at a time with a review after each sensitive or Full task — for tasks with dependencies, sensitive code, or shared files.
---
# Dispatching subagents (sequential)
Run one task to completion before the next; review a sensitive or Full task's diff before moving on. This is also the safe default whenever writers would share a checkout — one writer at a time cannot race or clobber. Reach for `dispatching-parallel-agents` only when the writers are isolated in separate worktrees or the fan-out is read-only. When in doubt, stay here: sequential never loses work.
Not for: 3+ independent tasks with no shared files (parallel wins), work small enough to inline or finish yourself in a few tool calls (a subagent is a fresh context that must rediscover what you already know), re-checking your own diff (the reviewers here read *another* agent's work with no memory of writing it — a subagent re-reading yours is self-critique with extra steps), or a problem you don't yet understand.
## State
The plan file is the only task state: flip each task's `### N. <name> - [ ]` heading checkbox to `- [x]` on completion — the heading checkbox only; sub-step boxes are progress notes and counting them corrupts the resume count. Record enough per task that a fresh controller after `/clear` knows where an unfinished task resumes ("fix round 2, one finding open", not just a tick). After compaction, trust the plan file and `git log` over your recollection — a controller that lost its place and re-dispatched a completed sequence is the most expensive failure available to you.
## Per task
1. **Dispatch `orch-implementer`** with `templates/implementer-prompt.md`. The working-directory slot declares the isolation mode: a worktree path, or the exact line `shared checkout; controller-partitioned file ownership` plus the task's exclusive files, or the exact line `main checkout — you are the only writer` for a solo sequential task. An envelope declaring none of them, and naming no sibling writer, dispatches a writer that works in the checkout it was started in and says so in its Status block; one that names a sibling writer without a mode fails closed (BLOCKED). Paste the task text, its `Path:` line, files in scope, Verify command, and the relevant `## Conventions` and `## Decisions` sections of ./CLAUDE.md — content, not file paths. Leave the agent's declared model and effort alone unless the task gives you a reason (see Model and effort).
2. **Route the Status.** Note the agentId from the spawn result — resume addresses agents by ID; names collide on serial reuse.
- `DONE` / `DONE_WITH_CONCERNS` → record any concerns, go to review.
- `BLOCKED` → the recovery tree below.
- `NEEDS_CONTEXT` → answer the `Ask:` via `SendMessage` to that agentId. The agent resumes with everything it already read and reasoned; a cold re-dispatch pays to re-derive all of it. The resume returns in the background — never spawn a duplicate while waiting.
- `PARTIAL` → its Stop-if fired. Record `Progress:`, then resume with unblocking guidance (the partial work and context survive) — unless the transcript shows repeated failed attempts, in which case re-dispatch fresh with `Progress:`/`Remaining:` pasted into the new envelope: a context polluted by failures hurts more than a cold start costs.
3. **Review the task** when the plan marks it sensitive (security, a public contract, a hub file) or its `Path:` is Full or the user asked for per-task review; a routine task is covered by the whole-branch review at landing (landing rule 6), so skip to step 4. The per-task review is `requesting-code-review`: `orch-review.py` with `--base` at the commit before this task's first commit, so the review covers the whole task. Not `HEAD~1`: a task is often several commits, and `HEAD~1` silently reviews only the last one. Standard is the default; use `--path full` when the task is Full work. Reassess the path when scope grows or a round finds something consequential; a reviewer may raise it, never lower it. The reviewers work in their own clones and never see the implementer's report. Besides correctness they ask: Is this the simplest correct version? (`skills/requesting-code-review/references/design-simplicity.md`); the implementer envelope tells the writer so. Verdict routing: `READY` → proceed; `NOT-READY` → the fix loop; `READY-WITH-FIXES` → handle the mild findings in one commit (fix, or record why not), run the checks, read the diff, record each disposition and note the deferred ones in the plan file, proceed (mild findings never start another round); `NOT-READY` whose every blocking finding is recorded `refuted`, `settled`, `follow-up` or `dropped` → the same; `INCOMPLETE` → fix the cause it names and run the review again.
4. **Tick and continue.** Flip the task's plan heading checkbox, start the next task without asking the user.
## BLOCKED recovery
Route by what the `Need:` line says — don't try branches in order:
1. **Missing context** (file content, decision, convention) → `SendMessage` it to the blocked agent's agentId. Resume, don't re-dispatch: the agent kept its full history and continues from the exact point it stopped; redo-from-zero is itself a step-repetition failure. Fall back to a fresh dispatch (context pasted into the envelope) only if the resume errors or the agent is gone.
2. **Waiting on a sibling task** → dispatch the sibling first; once DONE, re-dispatch the blocked task *fresh* with the sibling's output pasted. Fresh on purpose: the sibling's output changes the task's ground truth, and the blocked agent's stale assumptions would fight it.
3. **Too large / ambiguous** → decompose into 2–3 smaller tasks, update the plan file, dispatch fresh — decomposition redefines the work.
4. **Can't reason about it** → re-dispatch on a more capable model. Necessarily fresh: `SendMessage` has no model parameter.
5. **Genuinely needs the user** (only the stop cases in `using-orchestrator`'s "Proceed by default") → put the question, complete on its own, in a PR comment, label it `needs-person`, set this task aside and go on with tasks that do not depend on it (landing rule 10).
## The fix loop
Bounded by progress and by two failed rounds (`finishing-a-branch`'s `references/landing-rules.md`, rule 6; which findings cost a round: `requesting-code-review`'s `references/realistic-findings.md`). A round is one fix and one re-review of it. It made progress when the re-review found a new reproduced finding, or a blocking finding's failing check now passes; a round with neither is a stall. The failure the stall rule prevents is a single contested finding looping until the context runs out — and the cure was never a bigger budget, it was a disposition for what survives. A reproduced finding is fixed whatever the round.
- Rounds 1 and 2, and any later round while the fixes hold: resume the same implementer by agentId with the open findings pasted verbatim — it keeps the files it read and the reasoning it formed.
- After two rounds that still fail on the same change: no third patch. The implementer takes the approach from a named prior-art source, or the simplest alternative the reviewer named; if neither is possible, report the task blocked with the finding, the two failed fixes and the decision needed (`references/realistic-findings.md`).
Re-review only the fix: run the review with `--base` at the head the previous review saw, not the task base. A small fix gets a Standard re-review, not a Full one (landing rule 6's small-fix clause): when each finding has a regression test that failed before and passes after, the change touches only the findings' lines and their tests with no new function, option, field, file or behaviour, and the production diff is under twenty lines, run `orch-review.py run --path standard --base <the head the previous review saw>` (one independent built-in reviewer, no refuter), read the whole diff yourself and run each test without the fix to see it fail; its findings are handled like any other, and you record each finding `fixed` with its test and one outcome line naming the clause. A catastrophic or security-lens fix (authentication, secrets, tokens, payments) always gets the Full re-review. An open finding is addressed only when the specific defect is gone — its failing check now passes — not when a fix was attempted. New breakage introduced by the fix diff joins the open list; a reproduced, blocking defect the reviewer finds on untouched code is fixed before landing (landing rule 6); any other finding on untouched code is recorded but does not extend the loop — fresh material on old code is how a bounded loop becomes an unbounded one. A finding that reopens a decision the spec lists under `## Settled`, with no new argument against its reason, is recorded `settled` and does not extend the loop either (never a reproduced, catastrophic or unranked one); a decision you rule a second time goes into `## Settled`, with its reason, in the file the review reads as `--spec`, before the next review. A review that returns only mild findings ends the loop (step 3).
At a stall, stop dispatching and adjudicate. Every still-open finding gets one written disposition in the plan file: `parked — contested — ruling: <why the code stands>` when the finding is wrong or arguable and you can say why; `parked — real, not load-bearing — ruling: deferred` when it's real but unreproduced and nothing later builds on it (a reproduced finding is fixed, never parked); or `BLOCKED` when it's real *and* load-bearing (a later task depends on it, or it exposes a plan defect) — write the finding, the plan text it collides with and the fix history in a PR comment, label it `needs-person`, set aside the tasks that depend on it, and go on with the rest (landing rule 10). Adjudicate only at a stall — adjudicating early to end a loop is pre-judging with a different name — and never drop a finding silently; the written line per finding is the point of this section.
**Never fix a finding yourself in the controller session.** Your context is for coordination, and a controller fix skips review entirely.
## After the last task
Fetch and merge `origin/<base>` into the branch, run the checks, then one whole-branch review (`--base origin/<base>`; no remote: the local `<base>`, no fetch). Each round is one fix wave, not one fixer per finding: a single implementer with the complete open list (per-finding fixers each rebuild the same context and re-run the same suite — a cost exceeding the tasks themselves), then one scoped re-review of the fix diff. Rounds continue while they make progress, as above; at a stall, anything still open gets a disposition: `fixed`, `refuted`, `settled`, `follow-up` for an unreproduced serious finding, or the adjudication table above. Never land over a reproduced defect, and never rerun a review hoping for a different answer. Then `finishing-a-branch`, in this session (`finishing-a-branch`'s `references/landing-rules.md`, rules 2, 6 and 7).
## Continuous execution
Run the whole set without pausing. Stop only when every task is done or set aside: a task that is BLOCKED after the recovery tree, or whose `no` verdict adjudicates to BLOCKED, is labelled `needs-person` and set aside while the rest continue. If you find yourself wanting to ask "should I proceed?" — the answer is yes.
## Model and effort
Agents ship with role-appropriate models (see `docs/anthropic-ecosystem.md`); effort deliberately inherits the session preference. Override only when a dispatch gives you a reason, on the axis that matches the failure: the agent didn't *know* enough → raise the model; it didn't *try* hard enough (skipped a file, didn't run the tests, stopped early) → raise the effort. The Agent tool takes a per-invocation `model` but no `effort`, so a one-off effort change routes through `ultrathink` in the prompt. Never dispatch a reviewer on a weaker model than the implementer it reviews.
## Dispatch hygiene
Paste what the task needs — its text, interfaces, conventions, decisions, and the plan's global constraints — and nothing else. Don't accumulate: pasting "state after tasks 1–3" into task 4, and 1–4 into task 5, ends with an envelope that is mostly history the implementer cannot act on.
## Output shape
After the task set completes:
```
Found:
- Dispatched <N> tasks sequentially
- DONE: <list of task numbers>
- DONE_WITH_CONCERNS: <list, with one-line concerns>
- BLOCKED: <list, if any, with Need:>
Concerns:
- <one-line per recorded concern>
Verify:
- <combined test command> → <line>
Next:
- /llm-orchestrator:verify, the whole-branch review, then /llm-orchestrator:finish in this session
```