Reduces model quota spent on repeated supervision, polling, and status chatter by consolidating work into coherent blocks and avoiding wait loops.
Ships in quota-saving-mode. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Spend reasoning on decisions, implementation and verification—not repeatedly rediscovering unchanged state. This is an operating preference, not a runtime setting or a guarantee about billed usage. Follow required progress reporting, tool wait limits, safety rules and the user's model choices.
wait
loop is the single largest avoidable cost this skill exists to prevent.Polling is free. Re-entering the model is not. Every tool return replays the whole context so the model can decide one thing, and when that thing is "still running" the request was wasted. One measured session spent 40.6% of its input tokens this way, and a single background cell was waited on 64 consecutive times.
Two rules follow, and the second matters more than the first.
Never call wait in a loop. Not once. If a wait returns "still running",
that request bought nothing.
Never block either. A long-blocking tool call suspends the agent, which is
worse than the polling it replaces: a 45-minute run would make the session
unusable for 45 minutes. Codex also clamps exec_command to 30 seconds and
degrades silently somewhere past 8-13 minutes of looped calls, so long blocks
are unreliable as well as unusable.
The correct shape is the one a human uses: start the work, leave, be told.
sbatch, or
setsid ... </dev/null >log 2>&1 & for a local process. Do not hold a cell.The wake-up arrives as an ordinary user turn. Codex accepts injected messages
while a session is live: an idle session takes them immediately, and a busy one
shows Messages to be submitted after next tool call and delivers at the next
turn boundary. Either way the cost is exactly one model request per real event,
which is the floor.
Which watcher you need depends on the harness.
Claude Code already has this built in, so it needs no extra tool: start the work
with a background task and the harness re-invokes the session when it exits, and
a Monitor with an until-loop waits on a condition. Use those. Reach for the
scripts below only for a wake-up the harness cannot see, such as a Slurm job it
is not tracking.
Codex has no equivalent, so it needs an out-of-process watcher. await-notify
and await-event ship in this skill's bin/ for that case.
await-notify registers that watcher. It returns immediately with a receipt
and the waiting happens in a detached process:
await-notify --to <stable-pane-id> --mailbox <owner> [options] -- <await-event args...>
--to TARGET tmux session or session:window.pane to wake (required)
--mailbox AGENT required responsible manager, matching the bound pane owner
--bind-owner NAME bind a verified pane to its manager (no event arguments)
--label TEXT short human name for the thing being watched
--timeout S give up after S seconds total (default 86400)
--interval S seconds between internal polls (default 300)
sbatch scripts/slurm_fan_fit.sh # -> Submitted batch job 15233526
await-notify --to %9 --mailbox mao --label "fan fit" -- slurm 15233526
# {"event":"watch_registered","watch_id":"...","ledger":"..."}
# then go do something else; the wake-up arrives as:
# EVENT (fan fit): {"event":"slurm_terminal","state":"COMPLETED","exit_code":"0:0",...}
One responsible manager receives each event. Other managers ask that owner for
results; they do not subscribe to the same completion. Before the first watch,
verify the owner's actual pane and bind it with
await-notify --to %9 --bind-owner mao. Do not infer ownership from a bare
tmux display-message or inherited TMUX_PANE: tool hosts can inherit another
agent's terminal context. Resolve the agent's session/process or inspect an
explicitly targeted pane. Require --mailbox to match that binding. The helper
pins the stable pane and process, checks ownership again before delivery, and
locks each event across managers to reject duplicate live registrations.
Existing detached watchers retain their producing code; their owner must migrate
confirmed stale routes without cancelling the underlying work. Routine completion
notices go only to that owner; escalate to another manager only when an action or
decision is required.
It refuses to register against a tmux session that does not exist, because a
watcher whose wake-up can never land is indistinguishable from a job that never
finished. Every registration, firing, and delivery appends to a ledger under
~/.local/state/await-notify/, so a failure to deliver is visible rather than
silent.
Detail goes to the mailbox and the pane gets the short notice, which is the established split: keep PHI, identifiers and source excerpts out of both.
await-event is the detector underneath, useful directly only in a shell:
await-event slurm 12345 [more ids...] any listed job reaches a terminal state
await-event file <path> path exists and its size stops changing
await-event pid <pid> process exits
await-event log <path> <regex> regex appears in newly appended bytes
await-event cmd <command...> command exits 0
--interval S seconds between internal polls (default 300)
--max-block S give up and report still_waiting after S seconds (default 900)
It prints one JSON line and nothing before it. Exit 0 fired, 10 still waiting, 2 usage error.
Slurm watchers on one host share a single squeue --me snapshot, refreshed at
most once per interval (never under 60 s), with one query in flight at a time and
a 60 s limit on each. A watcher that finds the refresh already running launches
nothing and waits for its next poll. Before this, each watcher ran its own
untimed squeue -j every 30 s, and on an overloaded controller 27 of them stacked
hung queries for up to 26 minutes at once.
Fall back to the job's own completion signal -- a Slurm dependency, an epilog
that writes a marker, a --mail-type hook -- and check it when you next have a
reason to run a command anyway. Never open a poll loop just to look.
Where a check genuinely cannot be deferred, one bounded await-event call of
20 seconds inside a single tool execution is acceptable. A second consecutive
one is not: that is a poll loop with extra steps.
A wait condition that can never fire reports the same quiet as a healthy run,
and it is the easier half to get wrong because the output filter is the half you
think about. Key it on a pid, an exit marker, or a file the work writes -- never
a pgrep -f on the command being watched, which matches the watching shell's
own arguments. Prove it fires on a real positive before relying on it.
Preserve protected-data boundaries, temporal fidelity, untouched splits, matched denominators, code review and required scientific/QC checks. Do not shorten a necessary experiment or call an unreviewed artifact successful to save tokens. Do not add monitoring infrastructure, change permissions or edit global runtime settings merely because this skill is active.
Assess savings using actual usage when available, plus supervisor interventions, repeated reads and repair time. Those counts are proxies, not a conversion to quota: caching, reasoning, tools and model choice affect consumption. Keep this assessment lightweight; do not create a second bookkeeping project.
What SKILL.md sets; muted values are Claude Code's defaults
/quota-saving-mode:quota-saving-modefrom quota-saving-mode
npx claudepluginhub uchicago-dsi/ai-sci-skills --plugin quota-saving-modeOther plugins' skills for the same job