/agent-traffic-control:session-context-runs-out-mid-brief-measure-first-hand-back-earlyfrom agent-traffic-control
A dispatched session can run out of its context budget before it finishes, and what survives is only what it MEASURED and sent — never the orientation it did. Hours of reading a call path leave nothing transferable; the two cheap readings the brief called unmeasured are the whole inheritance. Use when: (1) a brief names facts as unknown, unchecked or "not measured" and you are deciding what to do first; (2) you are partway through a task and can see the budget will not cover reading plus building plus gating; (3) a coordinator offers you another workstream and you suspect you cannot finish it; (4) you are tempted to start coding so the session has "something to show". Two rules: measure the named unknowns FIRST, because a measurement is the only artefact that outlives the session, and once the budget is visibly short DECLINE the next assignment BEFORE reading anything or claiming a worktree — a clean no is reassigned in minutes while a claimed-then-abandoned task costs the next session a worktree, a claim file and a hand-off nobody can use. NOT for a session that is merely slow or blocked on a dependency, and NOT a licence to decline work you can finish.
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.
A coordinator hands a session a brief. The brief is honest about its own gaps: it names two or three facts as unmeasured and says to settle them before relying on them. It also describes the change to build, the tests to add, and the gates to run.
The natural order is to understand the system first. So the session reads the code path, maps the callers, finds the guards that will fire, works out the design — and somewhere in there its context budget runs out.
Now measure what survives. Orientation is worth nothing to anyone else. The understanding lived in a context window that is gone. No file changed, no branch exists, and the next session cannot inherit "I read the reap path and it makes sense". If the named unknowns were also left unmeasured, the successor starts from exactly where the first session started, minus the hours.
The inversion is the finding: the cheapest work in the brief is the only work that is transferable. A grep that answers "where is this value written?" and a single read-only policy query that answers "can this identity already do that?" take minutes each, fit in any budget, and go straight into the next brief as facts. The expensive work — reading, designing, deciding — is exactly the part that cannot be handed on.
The second half of the problem arrives right after the first. A session that has spent its budget still looks idle and available, so more work gets offered to it. Accepting one and stopping partway is worse than refusing: it leaves a claimed worktree, a claim file, a half-written branch and a hand-off the next session has to audit before it can trust any of it.
Reach for this at three moments.
When a brief names its own unknowns — "not checked: whether X", "unmeasured: whether Y". That wording is the signal. Those lines are the brief telling you which of its facts are load-bearing and unverified, and they are almost always the cheap ones.
When you can see the budget will not cover the whole task. The tell is arithmetic, not a feeling: the task needs reading plus building plus tests plus gates plus a wrap-up, and you are already deep into the first of five.
When another workstream is offered and you doubt you can finish it. Especially after you have already stopped one task short — the same limit applies to the next one, and nothing about a fresh brief resets it.
Not for: a session that is blocked on someone else (that is a dependency, say so and wait), one that is merely slow, or one that can finish but would rather not. This is about a hard limit you can see coming, not a preference.
Before the first substantive read, split the brief into two lists:
| List | Contains | Do it |
|---|---|---|
| Transferable | facts the brief calls unmeasured; readings of live state; anything that ends as a sentence someone else can act on | FIRST, whatever the logical order of the work |
| Perishable | understanding the call path, choosing a design, writing the code | after, knowing it may not survive |
This is not the order that makes the work easiest — orientation first is usually better for building. It is the order that makes the session safe to lose.
A measurement qualifies as transferable only if you write it down somewhere outside your own context: a message to the coordinator, a committed file, a comment on the issue. A measurement you merely made is perishable too.
Record the answer, its method and its date, so the next reader can re-check it without redoing it:
(a) where the value is written: <path/function>, not <the place the brief guessed>.
Read off the code that writes it, at <commit>.
(b) whether the identity may already do it: yes — <role> covers <permission>.
Read-only, <timestamp>. No grant needed.
Both lines are useful to a successor who has none of your context. "I looked into it and it seems fine" is not.
The cost of a refusal is not symmetric, and the asymmetry is the whole rule:
| Cost if you decline | Cost if you accept and stop partway | |
|---|---|---|
| Coordinator | one reassignment, minutes | the same reassignment, later |
| Next session | nothing | audit a claimed worktree, a claim file, a partial branch |
| Repo | nothing | a stale branch and a claim nobody dares delete |
So the refusal has to come before the first read and before any claim. A no after you have created a worktree is a cleanup task you are handing someone.
Say three things and nothing else: that you cannot take it, the reason in one clause, and that you have touched nothing. Naming the reason matters — "I am out of budget" is reassignable, silence looks like a session that is stuck.
The same limit applies to every later offer in that session. Re-deciding each time invites the failure this skill exists to prevent, because each new brief looks small in isolation.
Before you start building anything:
When you stop short:
git status --porcelain in it is empty before you remove it.When you decline:
A session was handed a server fix whose brief named two facts as unmeasured: where a started job's identifier is recorded, and whether the running service's identity was already allowed to read a cloud API it would need. The brief also carried the design, the tests and the gate rules.
The session read the code path first, as anyone would. Its budget ran out before a line was written. It then spent what was left on the two named unknowns:
Both went into the next session's brief. The worktree was removed unchanged, because nothing in it was worth keeping. The successor started with two settled facts and a correction to an assumption, which is strictly more than it would have had, and the hours of reading were simply lost.
Four further workstreams were offered to that session over the following day. Each was declined before reading the issue or creating a worktree, with the reason given. Each was reassigned within minutes and left nothing to clean up. The one earlier task that had been started and stopped left a worktree and a branch that someone had to check and remove.
inherited-scope-doc-names-may-not-exist
— the other half of "a brief is a claim": verify the names a predecessor's scope
doc cites before a long dispatch, rather than afterworkflow-agent-unreachable-mid-flight-check-output-not-brief
— a brief frozen at dispatch, and why the correction has to be caught at output
review; here the brief is fine and the session is the thing that runs outparallel-impl-agent-dies-mid-stream-verify-working-tree
— the involuntary version: an agent that died mid-stream, where the working tree
may hold the only copy of its productagent-refusal-with-evidence-beats-literal-compliance
— refusing because the instruction is wrong, which is a different reason from
refusing because you cannot finish; both want the reason stated, not silencefan-out-cost-control
— budget spent sideways across a fan-out rather than downwards in one sessionWhat 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.