/agent-traffic-control:pre-dispatch-agent-isolation-parameter-not-promptfrom agent-traffic-control
Telling an agent in its prompt it has "your own isolated worktree" creates nothing — isolation is the dispatch call's `isolation: "worktree"` parameter. Before fanning out agents that will commit, read the CALL back and make each prove where it landed. Prevention, not cleanup.
Ships in agent-traffic-control. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are about to fan out several agents that will each commit to their own branch. Your prompt template opens with "You are running in an isolated git worktree — changes you make here do NOT affect other agents", so you dispatch and move on.
That sentence creates nothing. The worktree is created by the dispatch tool's
isolation: "worktree" parameter. With the parameter unset, every agent runs in the same
checkout — and every one of them reports back as though it were isolated, because you told it
it was.
Nothing errors. Git does not complain that four agents share a working tree; that is a perfectly ordinary thing for a directory to be. The damage arrives as ordinary-looking results: a commit on the wrong branch, a branch that changes under a session mid-run, a test total that is off by one.
Why this specific mistake keeps happening: the isolation is a field in a tool call, and a field is very easy to describe in English and forget to set. The prompt is the part you write by hand and re-read; the parameters are the part you fill in once from a template. So the belief that the agents are isolated is strongest precisely when it is false.
Any one of these is enough — this is a cheap check, not a gated procedure:
git commit, git checkout, git rebase or git push.Not for: read-only agents that never write to the repo (a review pass, a grep audit).
Those have a different hazard — reading the wrong tree — which
subagent-read-stale-worktree-needs-head-pin covers.
Before you send the batch, look at each invocation's parameters and confirm
isolation: "worktree" is actually set on every call whose agent will write. Not the prompt
body — the parameters.
If your dispatch tool has no such parameter, the equivalent is to create the worktree
yourself and pass its absolute path in, then have the agent cd there as step one:
git worktree add /abs/path/outside/repo/agent-<n> -b <branch-for-agent-n> origin/main
superpowers:using-git-worktrees covers doing that safely. What does not work is any wording,
however emphatic, in the prompt.
Require this as the agent's first bash call, and require both values echoed back in its final report:
git rev-parse --show-toplevel # which checkout am I in?
git branch --show-current # on which branch?
Then read the reports as a set:
This costs one line per agent and turns a silent condition into a visible one.
A number that is TRUE of something, but not of the branch you are measuring. A total that
moves with no merge in between is a location question before it is a what-changed
question — run git rev-parse --show-toplevel in the agent that reported it before you go
hunting for the diff.
The reason this is the tell rather than an error message: in a shared checkout every number an agent reports is a real measurement of a real tree. It is just not a measurement of the tree that agent is supposed to be working on, and nothing about the number says so.
Before the batch runs, all of:
isolation: "worktree" (or an explicit, distinct
worktree path).git worktree list after dispatch shows one entry per writing agent, on distinct branches.After the first reports come back:
--show-toplevel values are all distinct, and none of them is the
orchestrator's own checkout.Four parallel implementation agents were launched with "You are in your OWN isolated git
worktree" in their prompts and the isolation parameter unset. All four shared one checkout.
What that produced, none of it an error:
pytest docs as 446 collected tests; on the branch
it was 445. The extra test was real — another agent had committed it into the shared tree
minutes earlier. Nothing errored, nothing conflicted, and 446 looked exactly like a number.Every one of those was recoverable, and each was recovered. The cost was the time, plus the period in which a wrong count was being reasoned about as a right one.
subagent-bash-cd-wrong-worktree). This is a
did-a-worktree-ever-exist question, and it is answered once, before dispatch.These three are recovery skills. Each fires on a symptom, which is to say each fires after the damage exists; that is why this one is filed separately.
concurrent-session-checkout-clobbers-shared-worktree
— a second session's git checkout flips the branch under your working tree and clobbers
uncommitted work. Detection and recovery, from the victim's side.subagent-bash-cd-wrong-worktree
— the commit-on-a-sibling-branch case seen from the other end: the reported SHA is real and
git branch --contains <sha> finds it on a branch that is not yours.isolate-subagent-verification-from-live-worktree
— the same reconciliation failure with a different cause: an agent in a dirty tree reports
the branch plus your uncommitted edits, as one number.Adjacent, and about the destructive-git side rather than the isolation side:
dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit
— it already names "give it its own worktree" as a remedy; this skill is the pre-flight that
checks you actually did.
These carry disable-model-invocation: true. They never appear in the skill
listing and the Skill tool refuses them, so the only way in is to open the file
with Read when one of these matches what you are looking at.
subagent-driven-branch-ref-froze-stranded-commits — "PR merged but half my work is missing" after one-subagent-per-task developmentsubagent-reports-complete-but-pr-unmerged — a subagent reported the task complete and the PR is still openmulti-agent-skill-silent-phase-compression — mandatory phases of a multi-agent skill silently vanished under context pressuremulti-phase-skill-disk-reading-strategy — late phases of a multi-phase skill fail silently because payloads went through the prompt, not diskThree more that belong to this same pre-dispatch window — what you can still decide about a brief before it is frozen, and what to do about the parts you got wrong:
workflow-agent-unreachable-mid-flight-check-output-not-brief — whether you can correct an agent later is decided by the dispatch mechanism: a subagent has an address, a workflow phase does notorchestrator-rule-too-strict-stalls-agent-silently — a guard scoped over the whole repo instead of one branch, so its precondition never holds and the agent waits correctly foreveragent-refusal-with-evidence-beats-literal-compliance — authorise the agent to refuse the letter of an instruction while meeting its intent, and require the measurement with the refusalWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
118 skills in this plugin
/agent-refusal-with-evidence-beats-literal-complianceA dispatched agent that does exactly what you asked can ship a defect you would
have stopped yourself, because it can see something at the worksite that you
could not see when you wrote the brief. Use when: (1) you are writing a brief
that prescribes a specific fix, threshold, wording or value rather than the
outcome you want; (2) an agent reports that it did not do what you asked and
you are deciding whether that is insubordination or judgement; (3) an agent
asserts "this is fine" or "not needed" with no measurement behind it; (4) you
are reviewing overnight output and want to know which decisions were checked
and which were assumed. Two halves, and both are needed: give the agent
explicit permission to satisfy the INTENT of an instruction while refusing its
letter, and REQUIRE the evidence with the refusal — what it built or measured,
what that showed, what it did instead. Evidence is the whole difference between
a refusal you can bank and one you have to re-litigate. Four agents correctly
declined an instruction in a single run; one built the suggested fix, measured
that it turned a silent safe refusal into a permanently red pipeline, and
reverted it unpushed.
/auto-merge-rearms-while-agent-live-kill-then-disarm-verifynpx claudepluginhub wan-huiyan/agent-traffic-control --plugin agent-traffic-control