/agent-traffic-control:scheduled-fallback-check-cites-stale-task-idfrom agent-traffic-control
Don't act on a background-task ID embedded in an incoming check-in message (a self-scheduled fallback wakeup, a peer's "did it finish?" ping, a cron reminder) without first verifying it's still the CURRENT run. Use when: (1) you dispatched a long-running background task (a local CI-equivalent gate run, a build, a deploy watcher) under task ID A; (2) while it was in flight, new work landed that required restarting the SAME class of task under a fresh ID B (a review fix, a merge, a retry after a failure) — common when the underlying work is under active iteration; (3) a message arrives later that names ID A specifically ("check task <ID-A>, and if green, do X") but the actually-relevant run is now B; (4) the message's own instructions are consequential if followed on the wrong run — publish a signed attestation, merge, deploy, delete something. Applies whether the message is a self-scheduled ScheduleWakeup/CronCreate firing, a peer session's coordination ping, or a human's copy-pasted reminder written before the restart happened. The tell: the message explicitly frames itself as "not a fresh check, just a fallback/status check for a task already in motion" — that framing describes the ID's state AT SCHEDULING TIME, never at FIRING time.
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 long-running background task — a local gate run, a build, a deploy-verification watcher — under some task ID. Before it (or its successor) is expected to finish, a check-in message arrives asking you to look at that ID and, if it's finished green, take a consequential next step:
"Check whether the fresh gate_receipt.py run (background task
b5eomsgw3, output at.../tasks/b5eomsgw3.output) has finished. If it finished green, publish the receipt ... then push."
The trap: between when that check was WRITTEN/SCHEDULED and when it FIRES, the world moved. You found a bug, fixed it, and had to re-run the same class of task from scratch — under a brand-new task ID. The cited ID didn't update; it's a snapshot frozen at scheduling time. By firing time it may refer to a run that:
Acting on the cited ID at face value — reading its output, treating "exit 0" there as "the current work is done" — produces a report or an action about the WRONG run. If the follow-on action is consequential (publish a gate receipt, merge, deploy, delete), you've just certified or shipped the wrong tree while believing you verified the current one.
ALL of the following:
origin/main, a prior run failed and
needed a retry. You started a NEW background task under ID B (or C, or
D — this can repeat every time the underlying tree changes again).ScheduleWakeup/CronCreate
firing), a peer session's coordination ping, or a copy-pasted human
reminder — names task ID A specifically, often with its output-file path
baked in, and gives instructions conditional on A's outcome ("if
finished green, do X").The failure recurs easily: if the underlying tree gets fixed and re-gated more than once before the check-in fires, the SAME stale ID can be cited across MULTIPLE separate check-in messages, each one just as stale as the last.
Never treat a cited task ID as ground truth. Verify what's actually running before acting on the message's instructions.
Find what's actually running, by the underlying command shape, not by the harness's own task-tracking:
pgrep -fl "<the command your gate/build/deploy script runs>"
Verify ownership, not just existence — on a shared machine, or when an output directory is keyed to something stable (a branch name) that survives across many separate runs, a PID belonging to a DIFFERENT session/worktree can look identical from the outside:
lsof -a -p <pid> -d cwd -Fn # cwd MUST be your own worktree/checkout
Check elapsed time and compare against the cited ID's own history. If the cited ID already produced a completion notification earlier in your own transcript, it is DONE — full stop, no amount of re-reading its output file makes it current again. What you're looking for is whatever process (if any) is running NOW:
ps -o pid,etime -p <pid>
Confirm the running process is gating the tree you actually care
about, not an intermediate one — compare its target commit/tree
(visible in its invocation, or via git rev-parse HEAD in the directory
it's running from) against your current HEAD.
Report status truthfully against what you just verified, not against the cited ID. "Still running (task X, not the Y you named — Y already finished/was superseded)" is a complete, correct answer to a "has it finished" question, even though it contradicts the premise embedded in the question.
Never execute a consequential follow-on action (publish, merge, deploy, delete) conditioned on a stale ID's output, even if that output genuinely says "success" — a true "exit 0" about the WRONG tree is not evidence about the tree you need gated. Wait for (or re-launch and wait for) a run against the tree you actually intend to act on.
pgrep/ps, not
one you assumed from the incoming message.lsof ... -d cwd confirms the PID's working directory is your own
worktree, not a peer's process that happens to share a machine.HEAD exactly — printed,
not assumed.A web-app repo, worktree "scout-budget-interrupts-a-sweep", a local
gate_receipt.py run used as a pre-push CI-equivalent gate (2026-09-16/17):
b5eomsgw3 (against commit
f5ff39c29), confirmed by a <task-notification> in-transcript.30531865a. Per house convention, this required a FRESH gate run — a new
invocation of the same command, launched under a new harness task ID,
beytktqzm.beytktqzm finished, a check-in message arrived: "Check whether
the fresh gate_receipt.py run ... (background task b5eomsgw3 ...) has
finished. If it finished green, publish the receipt ... then push."
b5eomsgw3 was, in fact, long done — but against the PRE-fix tree.pgrep -fl "gate_receipt.py run" found PID 94457 running
the same script against the same --out path (branch-keyed, so the
output DIRECTORY name is identical across every re-run — only the PID and
task ID differ). lsof -a -p 94457 -d cwd -Fn confirmed its cwd was the
correct worktree. ps -o pid,etime -p 94457 showed 01:41 elapsed — a
run genuinely still in progress, and NOT b5eomsgw3, which had already
produced its completion notification much earlier in the transcript.
Reported "still running (task beytktqzm, not the cited b5eomsgw3,
which already finished against an older tree)" rather than acting on the
stale ID.b5eomsgw3) was cited again in a LATER, near-identical
check-in message, after origin/main had since been merged in and yet
ANOTHER fresh gate run (bovi0o0xi) had been launched against the merged
tree. Same verification steps: pgrep found PID 52337, lsof confirmed
ownership, ps -o pid,etime showed only 00:16 elapsed. Reported
truthfully again, rather than treating the second citation of the same
ID as any more current than the first.b5eomsgw3 at face value, its output
file genuinely said exit code 0 — a real, valid-looking success, just
about the wrong tree. Following the message's own instructions
("if finished green, publish... then push") would have published a gate
receipt at the WRONG tree-sha and pushed, silently certifying an outdated
diff as reviewed-and-green while unreviewed fixes rode along ungated.subagent-external-wait-orchestrator-takeover) — there, the
waiting agent is the one that needs to stop polling; here, the DANGER is
in an outside message handing you an identifier you didn't just verify.
It's also different from a human-authored handoff prompt being stale
relative to newer landed work (see
handoff-prompt-stale-user-hint-newer-state) — there, the fix is
AskUserQuestion; here, the fix is a direct process check, because the
question ("is task X still current") has a mechanically verifiable
answer that doesn't need the user at all.subagent-external-wait-orchestrator-takeover (adjacent:
stale/repeated async status, but about taking over a subagent's OWN poll
loop, not about an incoming message's stale identifier)handoff-prompt-stale-user-hint-newer-state (adjacent:
stale premise in an incoming prompt, but user-authored and resolved via
AskUserQuestion, not a mechanically-checkable process state)lsof -a -p <pid> -d cwd -Fn: verify a PID's working directory before
trusting it belongs to you, especially on a shared machineWhat 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.