/agent-traffic-control:ci-leg-skipping-moves-minutes-it-does-not-remove-themfrom agent-traffic-control
You 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.
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.
The bill is too high, so someone proposes the obvious fix: this job does not need to run on this kind of change, so filter it out and save its minutes. The reasoning is clean, the change is small, and it is usually wrong.
A leg removed from the pull-request run is not a leg removed from the bill if the pipeline runs it somewhere else. Many pipelines deliberately carry a backstop: the merge or push run executes the COMPLEMENT of what the pull-request run skipped, precisely so that a wrong filter cannot make a leg stop running anywhere. Under that design the minutes are redistributed, not deleted.
For a branch that is made ready once and merges, the total is unchanged. The saving exists only from the SECOND ready run onward, and its size is:
saving = (ready runs − 1) × the skipped legs' minutes
So a change that looks like "we no longer pay for this leg" is really "we pay for this leg once per merge instead of once per ready run", and on a branch that lands first time those are the same number.
And on wall clock it usually saves nothing at all. Matrix legs run in parallel, so removing a leg that was never the long pole changes the pull request's wall clock by zero — while making the merge run longer. Wall-clock minutes and billed minutes are different quantities with similar digits, and quoting one while meaning the other is how a saving gets approved twice.
You are in the right place if any of these is true:
The reasoning this retires, in its exact intuitive form: "this leg does not need to run here, so we save its minutes." Whether that is true is a property of the whole pipeline, never of the leg.
Before pricing anything, enumerate every trigger that can execute the leg you are about to filter: pull request, push to the default branch, merge queue, scheduled run, manual dispatch. Read the workflow rather than remembering it.
grep -n "^on:" -A 20 .github/workflows/<workflow>.yml
grep -rn "complement\|exempt\|backstop\|schedule:" .github/workflows/ .github/scripts/
A leg named in more than one trigger has not been removed from the bill by a pull-request filter. It has been moved.
You need three numbers, and all three are per branch rather than global:
Then (ready runs − 1) × skipped minutes is the saving for that branch. Do
this over a real sample of branches, not a representative one.
A mean over branches hides the shape. Branches that land on the first ready run save EXACTLY ZERO, and there are usually more of them than expected. A saving quoted as an average, on a distribution where half the cases are zero, is a true number that misleads whoever is spending the money.
Write "billed minutes" or "wall clock" beside every number. They diverge here by design: this class of change can move billed minutes while leaving wall clock untouched, and a reader who assumes the other basis will conclude the pipeline got faster when it did not.
Does this proposal remove RUNS, or does it merely move LEGS?
Where the money usually is: the number of runs it takes to land one change. If that average is well above 1, it dominates every leg-level saving, because each extra run pays for the WHOLE matrix rather than for one leg.
A complement or backstop is what makes a wrong filter safe, so do not weaken it while chasing its minutes. If a leg's only remaining home is the merge run or the nightly sweep, that run is now load-bearing rather than belt-and-braces: losing it stops the leg running anywhere at all, silently.
A correctly priced proposal states, for a named sample of branches:
sample: 6 branches, real merged file lists, ready-run counts from the API
basis: BILLED minutes, each job rounded up to the whole minute
before 270 billed minutes after 254 saved 16 across the sample
per branch 45.0 -> 42.3 billed minutes, about 6%
3 of the 6 save EXACTLY ZERO (single ready run)
wall clock: unchanged — the removed legs were never the long pole
If the write-up has a percentage but no basis, no sample size, and no mention of the zero cases, it has not been measured — it has been reasoned.
Worked example from a route-generation repository whose CI bill was the subject of an owner ruling. The pipeline's own script names are that repo's; the pattern is not.
That repository's merge run passes a --complement flag to the script that
decides which legs to run: on a push to the default branch it executes exactly
the legs a pull-request run over the same diff would have SKIPPED, and nothing
else. That design exists so a wrong safe list cannot silently stop a leg
running, and it is the reason a pull-request filter there moves minutes rather
than deleting them.
A proposal to make two legs skip on a class of pull requests was priced over six real branches, using their actual merged file lists, their actual ready run counts from the API, and per-leg billed minutes from those same runs:
| billed minutes | |
|---|---|
| before | 270 across six branches |
| after | 254 |
| saved | 16, about 6% |
| per branch | 45.0 → 42.3 |
| branches saving zero | 3 of 6 |
On wall clock it saved nothing. The matrix's long pole was a different leg at a median 604 s; the two candidates for removal ran 185 s and 136 s, well inside it. Removing them changed the pull request's wall clock by zero and made the merge run longer.
The contrast that settled where to spend the effort. In the same repository a pull request averaged 3.7 runs to land one change, and four small pull requests landed together in a single run on 2026-09-11 saved roughly 90 billed minutes — several times the six-branch total above, from one act of batching. Batching deletes runs. Filtering redistributes legs.
merge-queue-thrash-stop-inflow-and-open-prs-as-drafts:
opening every pull request as a draft and promoting it only when it is next
to land removes whole RUNS, and measured about 46 seconds against about 16
minutes for a full one. Read the two together — that skill is what to do,
this one is why the other lever does not pay.fan-out-cost-control, which prices a
fan-out's token budget rather than CI minutes. Both go wrong the same way: a
saving that is reasoned from one unit and never measured in the unit that is
actually billed.merged-pr-not-deployed-gate-label-missing:
a path filter that quietly excludes your files stops a workflow running at
all. This skill asks what a filter costs; that one asks what it breaks. Both
questions are owed before a filter ships.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.
/cjk-structured-llm-output-truncates-json-needs-2x-tokensWhen generating LONG Chinese/Japanese/Korean (CJK) STRUCTURED output (a big JSON report, a multi-section
document) from an LLM chat API, the response truncates mid-JSON and your parser throws "no parseable JSON"
/ "Expecting ',' delimiter" / JSONDecodeError — even though the SAME prompt in English worked. Root cause:
CJK is token-heavy (≈1–2 tokens per character vs ≈0.25 for English), so a report that fit your max_tokens in
English overflows it in Chinese. Some models ALSO hard-cap output well below what you request (e.g. qwen-max
caps at 8192) and silently truncate. Use when: a zh/ja/ko structured-generation run fails JSON parsing,
worked in English, or a specific model truncates while others on the same prompt succeed. Covers the ~2×
token budget rule, per-model output caps, and a salvage that recovers the complete sections from a
truncated object.
npx claudepluginhub wan-huiyan/agent-traffic-control --plugin agent-traffic-control