Repository navigation
Parallel Work
Since 1.10.0. Several agents implement steps of one plan at the same time — subagents inside your tool, a second session, another tool or model, or an agent in a git worktree. No server, no mediator, no lock file coordinates this. One rule does:
The main session is the only writer of the plan,
.memory-bank/activeContext.mdand git history. A worker writes only its own step's files and one return note.
The plan cannot be edited by two agents, because only one ever edits it. That is the whole conflict protection; everything below is how to use it.
Working alone on a small feature? Answer in sequence when the agent asks — or skip this page: a plan without a
‖stage never raises the topic.
Each worker starts cold: it loads the constitution, reads the plan step and the spec criteria, and only then writes code. On a small feature that overhead eats the gain — in our own measurement four workers on a 15-criteria change finished no sooner than one agent working in sequence. Parallel work pays when the slices are large and separate: different modules, different files, each a real piece of work on its own.
Rule of thumb: if two developers could build the slices on two machines without phoning each other, an agent pair can too.
/sdd-plan checks every plan for independent steps — you do not have to ask. The result
shows in the plan's ## Stages section, closed by one line that says what the check found:
## Stages
1. T-001 — shared types and the route table
2. T-002 ‖ T-003 — independent: separate files
3. T-004 — wiring, docs sync and final gates
Parallel: stage 2.A plan with nothing to run side by side says No parallel stage: and why. Want the work
shaped for more of it? Say so when you plan:
/sdd-plan Cut it for parallel work.
The planner then moves shared pieces into their own step where that makes two slices independent. It does not mark a pair that fails the test below, even when asked — it names what stands in the way.
→ means in this order. ‖ means independent — and the plan has to earn that sign. Each
‖ step carries a Files: line naming every file it may touch, and its own test file:
### T-002 — Export a bill as CSV
- **Covers:** AC-004, AC-005
- **Do:** `toCsv` with header row, one line per person, quoting
- **Files:** `src/csv.js`, `tests/csv.test.js`
- **Verify:** `node --test tests/csv.test.js`
- [ ] **Verified (T-002):** —
- **Notes:** —Read the Files: lines when you review the plan. Two steps that name the same file are not
independent — a router, an index.js, package.json. The fix is a sequential step before the
parallel stage (create the shared piece) or after it (wire the results together), as in the
example above. Separate files are not enough either: a step whose check passes only once the
other step is finished builds on it, and the planner writes →. No ‖ in your plan? Then
the work did not split cleanly, and in sequence is the right call.
Say Implement. as usual. When the plan has a ‖ stage, the agent asks once — at the start,
at the latest before the first such stage — and keeps your answer for the plan's later ‖
stages. It says what each way changes and recommends one:
| You answer | What happens | What changes for you | Pick it when |
|---|---|---|---|
| in sequence | the main session works the steps one after another | nothing — the default | the steps are small, or you want to watch each one |
| subagents | the main session starts up to three sdd-implementer workers itself and waits for them |
workers cannot ask you: test reviews happen before they start, and you cannot steer in between | you stay in one tool and want it hands-off |
| other agents | the main session prints one start line per step and waits until you say they are back | you paste the lines yourself; for a worktree the tree is committed first | you want a second tool, another model, a colleague's session or a worktree |
Either parallel way, the quality gates run once, on the combined result, before any step is ticked. A tool without subagents simply works in sequence. Nothing breaks; you lose nothing but the speed-up.
Nothing to set up — .claude/agents/sdd-implementer.md ships with the template. Answer
subagents; the main session delegates each step with the plan path and the step ID. To put
the workers on a cheaper or faster model, add one line to the agent file's frontmatter:
model: sonnet/sdd-featherspec-update preserves that line.
The twin .github/agents/sdd-implementer.agent.md ships too. What to check depends on the
harness your session runs on:
- Copilot (the Agents window, Copilot CLI sessions): nothing — delegation is built in.
-
Local (the classic chat agent): the subagent tool (Run Subagent,
agent/runSubagent) is enabled in the chat's tools picker, and you are in Agent mode with the SpecDrivenAgent persona, as for every/sdd-*command.
Status in 1.10.0: the subagent route has been run end to end in Claude Code (two workers on one stage). In VS Code with GitHub Copilot it has not been exercised yet — the agent file and the rules are the same, so it should behave alike; if it does not, the other agents route below works in every tool, and an issue helps.
Answer subagents. VS Code shows each worker's activity separately, so you can follow its
tool calls. sdd-implementer does not appear in the agent picker on purpose
(user-invocable: false) — it is a worker, not a persona. A model: line in the agent file
works here as well.
Answer other agents. The main session prints one line per step:
Implement T-002 of .specs/active/0007-export.plan.md as a parallel worker.
Implement T-003 of .specs/active/0007-export.plan.md as a parallel worker.
Open a second session — Claude Code in another terminal, a new session in VS Code, any tool
that reads AGENTS.md — in the same folder, and paste one line. The worker reads
the parallel-work rule, implements its step and finishes with a return note. When all workers
are done, go back to the main session and say so:
They are back.
Paste the line — do not paraphrase it.
as a parallel workeris what tells the second session to leave the plan alone. Started with "do T-004 and T-005 of the plan" it takes itself for the main session: it ticks steps and rewritesactiveContext.md, and the plan has two writers. If you do start one in your own words, say that another session is working on the plan.
This is how you mix tools and models on one plan: the main session in Claude Code, a worker in Copilot with a different model, or the other way round. The protocol is files in the repository; no tool has to know the other exists.
A worktree gives each worker its own checkout, so even builds and test runs cannot disturb each
other. VS Code creates one for you when you start a session with New Worktree; on the
command line it is git worktree add. Three things differ from the shared folder:
-
Commit first. A worktree holds committed files only — no uncommitted work, and no ignored files such as
node_modules. Before it prints the start lines, the main session proposes the commit that brings the tree level (commits are Ask-first) and names it as the stage base. Create the worktree from that commit:git worktree add ../myapp-T-002 -b parallel/T-002
A worktree created earlier does not catch up on its own — merge the stage base into it, or create a new one.
-
Install what is ignored. The worker asks before it installs dependencies in its fresh checkout.
-
Merge back. Paste the start line in the worktree session. When the worker is done it proposes one commit on its branch — its step's files plus the return note. Merge that branch into the main checkout (VS Code: Merge Changes in the session's changes view; otherwise
git merge), then tell the main session they are back; it reads the notes from the merged tree.
Claude Code's own isolation: worktree option for subagents branches from your default branch,
not from your current commit — a plan that lives only on your feature branch is invisible
there. Create the worktree yourself as shown.
A worker's last act is its return note, .memory-bank/activeContext.<spec>-<step>.md:
# Return note — 0007 · T-002
- **Status:** DONE
- **Files:** src/csv.js, tests/csv.test.js
- **Verified:** 2026-11-14 · node --test tests/csv.test.js · red (toCsv missing) → 6 passed
- **Notes:** quoting follows RFC 4180; no deviation from `Do:`A return note lying in .memory-bank/ means: parallel work came back and is not integrated
yet. /sdd-overview reports every one it finds, and /sdd-lifecycle will not move a spec to
done/ past one.
Back in the main session, integration is four checks, in this order:
-
Only the announced files changed — the union of the steps'
Files:lines plus the notes, and every worker stayed within its own step'sFiles:line. Anything else is a finding the agent raises before going on. -
Every
Verify:is run again by the main session, then the quality gates on the combined tree. A worker's "passed" is a claim until the main session has seen it pass. This is where your Quality gate agreement is met in a parallel stage: once, on the combined result, before any of its steps is ticked — the agent says so when it asks how to run the stage. -
Then the bookkeeping: the steps are ticked with their
Verified:results, notes are carried into the plan, traceability andactiveContext.mdare synced. - The return notes are deleted — the one deletion the constitution exempts from Ask-first.
You get the usual stage report and one commit proposal for the whole stage.
| A worker does | A worker never does |
|---|---|
| implement exactly its one step — test first, unless confirmed tests were handed to it | touch a file outside its Files: line |
run its own Verify:
|
run the full quality gate (others share the tree) |
| write one return note | edit the plan or any other Memory Bank file, tick a box |
report BLOCKED with the question |
commit, branch, push — or guess past a question |
Your TDD agreement still holds. A subagent cannot stop and ask you to review a test. So with the default TDD working mode the main session writes the stage's tests first, gets your confirmation, and delegates only the implementation — the confirmed tests are named as off-limits to the workers. A worker in its own session (the other agents route) can ask its user: the test review simply happens there.
-
A worker reports
BLOCKED. Its note names the question or the Ask-first action it could not take. The main session stops and tells you; the other workers' results stand. Answer, then let the main session finish that step itself or start the worker again — the blocked note stays until the step is finished and is then integrated and deleted like the others. - A worker says its checkout lacks the earlier steps. Its worktree was created before the main tree was committed. Commit in the main session, merge that commit into the worktree and tell the worker to go on. It will not rebuild the missing steps and will not write into the main folder — either would give the plan a second author.
-
Two sessions wrote the plan. A second session was started without the worker line, or
the plan was re-cut in a side session while the main one was working. Stop the side
session and tell the main one; it reconciles plan and
activeContext.mdfrom the code. Re-cut stages only in the main session, at a stage end. - Two workers needed the same file. The first integration check catches it. Let the main session resolve it in sequence, and move the shared piece into its own step next time.
-
A session died mid-stage. Start a new one with
/sdd-plan. Leftover return notes are integrated first; the ticks and the code lead over any stale handoff line. - A worker ticked the plan anyway. Tell the main session; it reconciles from the code — the constitution's rule is that on divergence the code is the truth.
- Specs and Plans → Stages for the plan layout
-
Commands →
/sdd-planfor planning and resuming -
Memory Bank for
activeContext.mdand its transient guests - Interop Matrix for what each tool reads