bench-baton
Skill585 starsChanged 3 months agoMITView on GitHub
Coordinate heavy local workloads across worktrees, processes, and subagents — benchmarks and timing-sensitive gates run exclusively on a quiesced machine, while builds, test suites, regeneration, and lint run concurrently in a capacity-limited shared lane. Use when parallel workers could perturb benchmark numbers, when a perf gate needs an idle machine, or when concurrent builds need a fair capacity cap and a shared ledger.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- comment-lintSkill
- docs-statusSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 57
Before blaming a commit for an anchor drift, check the power state (pmset -g | grep lowpowermode).
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
bench-baton — one quiet machine, two lanes
The scarce resource is a quiet machine, not the build tree. cmd/bench-baton
arbitrates one pool per machine-level resource:
| lane | mode | use for | concurrency |
bench | exclusive | benchmarks, make bench-ratchet, timing assertions | alone — no other bench, no builds |
build | shared | builds, test suites, make generate / check-generated, lint | up to --max-shared (default 4) |
A waiting benchmark closes the gate: shared work arriving behind it is deferred
until the bench has run, so a stream of builds cannot starve it. Leases are flocks,
so a holder that dies releases the pool by itself; reap only tidies the record.
State lives in $BENCH_BATON_HOME (default ~/Library/Caches/let-go/batons on macOS,
~/.cache/let-go/batons on Linux), one directory per --pool (default letgo):
state.json, ledger.jsonl, logs/, and the lock files. Set BENCH_BATON_HOME
to an existing pool root to keep its ledger.
Shell
go run ./cmd/bench-baton bench --owner pr641 --cwd WT -- make bench-ratchet
go run ./cmd/bench-baton build --owner pr641 --cwd WT -- go test ./...
go run ./cmd/bench-baton run --mode shared --owner pr641 -- make generate
go run ./cmd/bench-baton status
go run ./cmd/bench-baton ledger -n 10
go run ./cmd/bench-baton reapbuild / bench exit with the wrapped command's return code and print its tail, so
they drop into existing scripts unchanged; the full output is in the log the ledger
names. --lease-timeout SEC makes a worker report contention instead of blocking;
--timeout SEC kills a runaway command.
Rules
- Benchmarks and any timing-sensitive gate go through
bench— neverbuild. A ratchet number captured next to a running test suite is noise the ratchet cannot tell from a regression (the pre-push gate compares against a baseline captured on a quiet machine). - Builds and tests use
build; they are concurrent, so do not hand-serialize them. - Give every worker a stable
--owner(worktree or PR name) sostatusandledgerread well across subagents. - One pool per machine-level resource;
--poolfor an unrelated project. - Cheap commands (grep, one focused test,
jj status) take no lease at all. - Before blaming a commit for an anchor drift, check the power state
(
pmset -g | grep lowpowermode); a laptop on battery is not a quiet machine either.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

