/agent-traffic-control:worktree-write-abs-path-lands-in-parent-checkoutfrom agent-traffic-control
In a git worktree session, a Write/Edit whose absolute path points at the MAIN-REPO ROOT (the parent checkout) silently creates the file in that parent checkout's working tree — on whatever branch it has checked out — NOT in your worktree on your feature branch. The file then doesn't appear in `git status` on your branch and `ls`/Read inside the worktree can't find it. Use when: (1) the environment's "Primary working directory" is a worktree at `<repo>/.claude/worktrees/<name>/`, (2) you're about to Write or Edit a file by ABSOLUTE path (handoff doc, generated artifact, new source file), (3) you habitually type the repo's canonical root path (`/.../<repo>/docs/...`) instead of the worktree path (`/.../<repo>/.claude/worktrees/<name>/docs/...`), (4) a later step reports "file does not exist" / a commit is missing files you "just wrote" / `git status` is unexpectedly clean. Trap: the main repo root is a real, writable checkout; writing there succeeds silently and pollutes the parent's working tree (often on a stale sibling branch). Mitigation: in a worktree, pass RELATIVE paths to Write/Edit (cwd is already the worktree), or ensure every absolute path carries the `.claude/worktrees/<name>/` segment; after writing, `ls` the file back via a relative path to confirm it's in the worktree. See also: worktree-outer-ls-mistaken-for-main-state (the read-side sibling), main-bash-cwd-persists-nested-worktree, subagent-bash-cd-wrong-worktree.
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're working in a git worktree (<repo>/.claude/worktrees/<name>/) on a feature
branch. You Write or Edit a file using an absolute path rooted at the repo's
canonical location — /Users/.../<repo>/docs/foo.md — out of habit. The Write
succeeds: that path is the parent checkout's working tree, which is a real,
writable git working directory. So the file lands there, on whatever branch the
parent checkout currently has (often a stale sibling worktree's branch), NOT in
your worktree.
Symptoms: the file you "just wrote" is absent from git status / git add on your
branch; ls/Read inside the worktree reports "does not exist"; a commit silently
omits the files. The write isn't lost — it's in the wrong tree.
<repo>/.claude/worktrees/<name>/..claude/worktrees/<name>/ segment).git status, a
commit missing files, or a script (e.g. a label-audit) that can't find a doc you
just created.docs/handoffs/foo.md resolves correctly./Users/.../<repo>/.claude/worktrees/<name>/docs/handoffs/foo.md — never the
bare /Users/.../<repo>/docs/....ls -la docs/handoffs/foo.md via a
RELATIVE path from the worktree. If it's missing there, it landed in the parent.mv /<repo>/docs/foo.md docs/foo.md (parent →
worktree). The parent's working tree returns to clean since the file was
untracked there.ls the file via a relative path from the worktree root — it exists.git status --short on your branch shows the file as a new/modified path.git status is clean (no stray untracked files left).S107c: wrote two handoff docs to /Users/.../the-causal-impact-repo/docs/handoffs/
(main repo root) while the active worktree was
/Users/.../the-causal-impact-repo/.claude/worktrees/channel-split/. The Writes
succeeded but the files were invisible to git status on the docs branch and to
ls in the worktree. Caught only because the session-handoff label-audit reported
"file does not exist". mv'd both into the worktree; parent tree (on a stale
docs/s110-... branch) returned to clean.
cd — the parent root is off-limits as a
write destination, not only as a working directory.worktree-outer-ls-mistaken-for-main-state (running ls/find
on the outer dir and mistaking its branch's files for main's). Same root
confusion (parent checkout ≠ your worktree), opposite operation.What SKILL.md sets; muted values are Claude Code's defaults
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.