/agent-traffic-control:isolate-subagent-verification-from-live-worktreefrom agent-traffic-control
A verification / gate-running subagent you dispatched into YOUR OWN worktree silently measures the branch PLUS your uncommitted edits, and reports the mixture as the branch's result. Nothing is clobbered and nothing errors — the suite really ran, the counts are real, they are just counts of a tree nobody will ever merge. Use when: (1) you dispatched an agent to "run the gates" / "verify main" / "check the suites" and pointed it at the directory you are still editing or committing in; (2) an agent reports a total that does not match the same command run before or after it (a task/decision/test count that moved with no merge between); (3) an agent reports the working tree as modified with files it did not write, or says HEAD advanced under it mid-run; (4) you are about to write "all suites green at <sha>" on evidence gathered while your own edits were unstaged. Fix: a verifying agent needs a checkout nobody else writes to — `git worktree add --detach /tmp/<name> <sha>` in the agent's own prompt, or finish and push your commits first. Distinct from dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit (the agent DESTROYS your edit), concurrent-session-checkout-clobbers-shared-worktree (someone else flips the branch), and subagent-read-stale-worktree-needs-head-pin (the agent reads the WRONG worktree — here it reads the RIGHT one, in a dirty state).
Trending skills
7-day visitors to each skill page
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, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You dispatch a subagent to verify a merge: "run the four suites and the validator against
main, report the numbers." You point it at the worktree you are working in, because that
is where the venv is symlinked and the tooling is set up.
Then you keep working — editing, staging, committing, merging PRs.
The agent's gate run measures the branch plus whatever is in your working tree at that instant. There is no clobber, no error, and nothing looks wrong: the suites really execute, the numbers it reports are real numbers, and it prints them with a commit SHA next to them. They are simply counts of a tree that exists only on your disk and will never be merged.
The report then becomes the session's evidence — pasted into a PR body, a handoff, a tracker
card — as "verified green at <sha>".
The sibling failures in this collection are loud once you look:
dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit — your edit vanishes.concurrent-session-checkout-clobbers-shared-worktree — the branch changes under you.subagent-read-stale-worktree-needs-head-pin — the agent's cited lines contradict yours.Here nothing contradicts anything. The only signal is a total that does not reconcile with the same command run at a different moment — and totals move for legitimate reasons all day in a repo with parallel sessions, so the delta reads as normal churn.
HEAD moved mid-run.git status in the agent's transcript is non-empty when you expected a clean tree.<sha>" using numbers gathered while you had
unstaged edits.A session merging a run of PRs dispatched a verification agent into its own worktree while it carried on drafting. The agent later reported:
CLAUDE.mdin the worktree showed as modified with 65 lines I did not write, and shortly after the worktree's detached HEAD advanced on its own. My first gate run was silently measuring main plus an uncommitted foreign change.
It caught this only because a validator count moved 150 → 152 between two runs it
expected to match — and it recovered by checking the commit out in a throwaway worktree and
re-measuring there. Had the counts happened to be stable across those two moments, the
contaminated numbers would have shipped as the session's verification evidence.
Give a verifying agent a checkout nobody else writes to. Put it in the agent's prompt, not in your own head:
# in the AGENT's prompt — its own tree, pinned to an explicit commit
git worktree add --detach /tmp/verify-<slug> <sha-or-origin/main>
cd /tmp/verify-<slug>
ln -sfn /path/to/repo/.venv .venv # or whatever the tooling needs
# ... run the gates here ...
git worktree remove --force /tmp/verify-<slug>
Then either of these, as the situation allows:
git rev-parse HEAD must equal it before any suite runs.Require the agent to prove the tree was clean. Its report must include git status --short
output (empty) and git rev-parse HEAD alongside every count. A number without those two is
not evidence about a branch — it is evidence about a moment on somebody's disk.
If you suspect a contaminated run, you do not need to reason about it — re-measure:
git worktree add --detach /tmp/recheck <sha>
cd /tmp/recheck && <the gate commands>
git worktree remove --force /tmp/recheck
If the numbers differ from the agent's, the agent's were of your working tree. Republish the clean ones and say which report was superseded — a corrected number in a PR body is cheap; a wrong one quoted onward by a tracker card is not.
dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit — the destructive cousin.subagent-read-stale-worktree-needs-head-pin — wrong worktree rather than dirty worktree.concurrent-session-checkout-clobbers-shared-worktree — the branch moves under you.worktree-outer-ls-mistaken-for-main-state — reading outside any worktree at all.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub wan-huiyan/agent-traffic-control --plugin agent-traffic-control118 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-verifyDisarming auto-merge on a PR whose agent is still running does not hold it —
the agent re-arms within minutes and the PR merges, because arming is a step in
the agent's brief and disarming is not an instruction to the agent at all. Use
when: (1) you want to STOP a pull request from merging that an agent opened and
armed, for review, for a rethink, or because it is landing into a queue you are
trying to drain; (2) a PR you disarmed merged anyway; (3) you are telling agents
which PRs are on hold and want the hold to be enforced rather than announced;
(4) you are about to run `gh pr merge --disable-auto` and have not decided what
to do about the agent. The order is KILL THE AGENT FIRST, THEN DISARM, THEN
VERIFY the disarm by reading `autoMergeRequest` back — a disarm you did not read
back is not a hold. The stronger form needs no ordering at all: convert the PR
to a draft with `gh pr ready --undo`. A draft cannot merge whatever any agent
does to it, so the hold survives an agent you missed, an agent that restarts,
and an agent you did not know about.
/batch-member-cites-a-path-only-a-non-member-addsYou wrote something correct that the default reader cannot reach: a batch member citing a
path only a NON-member adds, or a rule, ruling or ledger sitting on an unlanded branch.
/batch-merge-subject-is-not-evidence-a-member-landedYou are about to close, delete the branch of, or mark as landed a pull
request because a batch, roll-up or merge-train commit on the target branch
names it in the subject line, and because the member's own commits all
predate that merge by wall clock. Neither of those is evidence. A batch
branch is assembled at some moment BEFORE it merges, so anything the member
pushed after assembly is outside it, and the subject records INTENT at
assembly time rather than CONTENT at merge time. Use before closing a
member, when an ancestry check against a squashed batch says no, or when a
member's branch still shows commits ahead of the target. Compare file
content against the target branch instead, expecting exactly one legitimate
difference: the shared aggregate file every member appends to.
/check-a-stale-branch-is-not-undoing-newer-main-workA branch built on an out-of-date main is about to merge, or has merged, and may undo work
that landed since. Use when a green, conflict-free PR deletes files you never touched,
newer values or a whole redesign vanish after a sibling PR merged, rows of a shared ledger
(tracker, registry, CHANGELOG) disappear or revert, or when `git diff main...HEAD` or a
reviewer says your small PR touches dozens of files you did not change.
/ci-leg-skipping-moves-minutes-it-does-not-remove-themYou are about to propose, price or approve a CI cost saving that works by
making a job or matrix leg SKIP on pull requests — a path filter, a safe
list, a changed-files gate, an exemption list. Check first whether the
pipeline runs a complement or backstop on merge, on push, or nightly:
many do, and then the legs a pull request skipped are exactly the legs some
later run executes, so a branch that goes green once and merges bills the
same total either way and the wall clock does not move at all. Use when
pricing a filter change, when a percentage saving is quoted with no basis,
or when choosing between filtering legs and batching pull requests. The
question that separates money from bookkeeping is whether the change
removes RUNS or merely moves LEGS.