/agent-traffic-control:reland-work-that-missed-a-squash-mergefrom agent-traffic-control
A PR was squash-merged but some of your work never reached main. Use when a fixed bug is back after the merge, `git status` still shows files you edited during the review pass, the squash commit's size matches only your first commit, you pushed follow-up commits and found the PR already merged, or you wrote a new commit on the merged branch and need it on main.
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.
Merged from: working-tree-edits-stranded-on-squash-merge, pr-followup-commit-stranded-after-squash.
A squash merge captures exactly what was committed and pushed to the branch at the moment of
merge. Not what is in your working tree, and not what you push afterwards. The mental model
"squash collapses everything that ever lived on the branch" is wrong. Nothing errors, the PR shows
MERGED, and main is incomplete. Three ways work gets left behind:
You iterate on a PR during an acceptance pass. The user reports a bug; you fix it with the Edit or
Write tool; the live server or preview picks it up; the user confirms; you move on. Later you fix
another bug with git add <that_file> + git commit, and squash-merge. The user reloads: "the bug
is back". Edit and Write change the working tree but do not stage, so only the file you added went
into the commit. After the merge, git status in the worktree shows M <file_you_edited> and the
squash on the base branch has the old content.
The Edit/Write tools are deliberately non-staging, so the user can stage the way they would in any workflow; the gap is in the workflow, not the tool. Scratch edits made only to show a preview and then consciously discarded are fine; the trap is edits you think shipped.
You pushed commit 1, opened the PR, then pushed commits 2, 3, ... in response to feedback. The user merged while only commit 1 (or the first few) was on the branch, possibly during one of your iterations. GitHub does not re-apply a closed branch's later commits onto main. Signs:
gh pr view N --json state returns MERGED;git show <merge-commit> --stat has insertion counts matching only your first commits;gh pr view N --json commits lists fewer commits than the closed branch holds (do not use git log origin/main..<branch>: after any squash it lists every commit, landed or not);You finish, the squash lands, then you write a new commit (for example a session-handoff doc
referencing the merged PR) on top of the old local branch and want it on the base branch
(main, release-uk). Recovery is the same as Variant 2, but one tempting command is dangerous:
Do not use git rebase --onto origin/<base> <pre-squash-branch> <followup-branch> across a
squash-merged boundary. It has been seen to silently drop the new commit with
"Successfully rebased and updated refs", no error, no skip notice, working tree reset to the base
tip. Reproduced: commit 13f1ac7 added two new files that conflicted with nothing on release-uk,
yet git rebase --onto origin/release-uk feat/s63-oom-sentinel docs/s63-handoff reset the branch to
origin/release-uk with no replayed commit. The root cause was not found (the patch was non-empty
and not a duplicate); the defensive rule stands. If it already happened, git reflog <branch> then
git reset --hard <reflog-hash> recovers it within the reflog retention window.
Even rebase-merge has an edge: a commit pushed after the rebase-merge starts may or may not be included, depending on GitHub's race resolution.
git status shows M lines for files you
remember fixing; git diff origin/<base> against the merged work surfaces edits that should have
been in the PR; or [ahead N] commits sit on the merged branch.gh pr create or the merge printed Warning: N uncommitted changes. That is the canary.recover-from-an-async-post-commit-hook (Variant 5).Audit before every merge.
git status --short # any `M` or `??` lines?
git diff # any uncommitted hunks?
git diff origin/<base_branch> # exactly what the squash will contain
For each unstaged change decide: part of this PR (git add <file>, commit, push, then merge);
stays local (stash it or .gitignore it so the choice is explicit); a leftover from an earlier
session (triage it). Never run gh pr merge with a non-empty git status without a stated
reason; the harness and GitHub will both let you.
Check PR state before every push to a PR branch.
gh pr view <num> --json state
If it is MERGED, stop: commit on a fresh branch off current main and open a follow-up PR.
For high-iteration PRs (three or more async commits expected): prefer rebase-merge if the project allows it, or hold iterations locally and push one batch right before merge, or tell the user "still iterating, hold the merge" before each push.
Never build on the stale, merged branch.
Uncommitted edits (Variant 1). The edits survive the checkout because they are uncommitted:
git fetch origin
git checkout -B hotfix/<short-name> origin/<base_branch>
git add <files_that_were_stranded>
git diff --staged # sanity-check before commit
git commit -m "hotfix(<area>): <fixes that missed the squash>
<one paragraph per stranded fix explaining the bug and why it missed>"
git push -u origin hotfix/<short-name>
gh pr create --base <base_branch> --title "..." --body "..."
gh pr merge <new_pr> --squash
If the stranded edits were since reverted (for example by git checkout HEAD -- <file>), the
working tree is no longer the source; recover from the Edit tool's history or re-apply from notes.
Stranded or new commits (Variants 2 and 3).
git fetch origin --prune
git log origin/main..<closed-branch> --oneline # EVERY branch commit, landed ones included:
# after a squash none of their SHAs are on main
gh pr view <N> --json commits -q '.commits[].oid' # the commits the merged PR captured
git show <squash-sha> --stat # cross-check: the content that landed
# stranded = branch commits after the last one the PR captured
git checkout -b <topic>-followup origin/main
git cherry-pick <commit-2> <commit-3> ... # resolve conflicts if main moved
git push -u origin <topic>-followup
gh pr create --title "<topic>: follow-up — <what was missed> (PR #N squash missed M commits)" \
--body "PR #N was squash-merged when only my first commit was on the branch. The follow-up
commits — <list> — never reached main. This PR cherry-picks them. Stale on main: <file X> still
says <old>; should say <new>."
For one new commit after the merge:
git checkout -b <followup-branch>-v2 origin/<base>
git cherry-pick <followup-commit-sha>
git push --force-with-lease origin <followup-branch>-v2:<followup-branch>
The closed branch is not garbage-collected at once (--delete-branch removes the remote branch, not
your local one, which is what you cherry-pick from), but the longer you wait, the more main diverges
and the more conflicts the cherry-pick meets. A conflict there is normal; resolve it on top of the
latest content.
git diff origin/<base_branch> origin/hotfix/<name> shows only the stranded edits, no extras.git fetch origin --prune and git show origin/main:<file> | head -20 shows the intended end state, not the first commit's state.git status in the worktree is clean once the fix is checked out or pulled.During PR #90's acceptance pass the user reported two UI bugs. (1) A Plotly chart looked squashed
because the y-range included masked-period extrapolations (~2.5M) while visible data sat at
200K-300K; fixed by editing webapp/templates/report.html. (2) Download buttons were missing
because a save path raised ModuleNotFoundError from a wrong relative import; fixed in
webapp/views/analysis.py (.data_storage → ..data_storage). The Flask reloader picked both up
and the user verified. Then an unrelated webapp/templates/runs.html change was committed without
adding the two earlier files. After the squash, "buttons still not there"; git status showed
M webapp/templates/report.html and M webapp/views/analysis.py. Recovery PR #93 shipped both in
eight minutes. gh pr create had printed Warning: 3 uncommitted changes during #90 and was
ignored.
git diff origin/<base> before merging is the auditable truth of what the squash will contain;
anything you expect that is not there is stranded.recover-from-an-async-post-commit-hook: a hook's commit lands after your push and is orphaned.verify-a-squash-merge-by-content-not-lineage: false alarms after a squash that did land.pr-conflict-from-mid-flight-merges: other PRs make your open PR conflict.gh-pr-merge-worktree-checkout-trap: gh pr merge local side effects fail from a worktree, but
the merge succeeded.What SKILL.md sets; muted values are Claude Code's defaults
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-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.
npx claudepluginhub wan-huiyan/agent-traffic-control --plugin agent-traffic-control