/paperlint:run-agent-gridfrom paperlint
Runs a paid or counted agent experiment grid (units × arms × seeds × agent stacks) with guards against common failures: unapproved samples, timeouts, shared working copies, secrets in transcripts, mislabeled outcomes, session caps, and lost results. Ships grid-guard.js for lock, gate, overlap audit, env probe, key scan, and pre-commit.
Ships in paperlint. 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; scripts run unread.
What a grid is here. Units under test × conditions (arms) × seeds, repeated per agent stack
(model + CLI). Each cell is one agent CLI run in a fresh working copy of the unit; a scorer reads
what the run left behind, and an outcome oracle decides the cell's result. build-benchmark designs
the study and the artifact; this skill is the operational procedure for running it, from the
first paid call to the last committed run.
Every rule below was paid for by a failure. Each is stated with that failure and with what HOLDS it:
a refusal in skills/run-agent-grid/scripts/grid-guard.ts (run as the compiled scripts/grid-guard.js), a commit hook, a probe — or, said plainly, prose only,
which means it holds only as long as someone reads this. The full catalog, one entry per failure:
references/failure-catalog.md. The registry, the attempt ledger
and a driver loop that calls the guard: references/registry-and-ledger.md.
Exit codes of every guard command: 0 allowed or clean · 1 refused or a finding · 2 usage ·
3 (gate only) the cell is already counted, skip it.
The grid's study folder. A grid is one study of the paper. Its folder is made by
npx paperlint studies new <paper-dir> "<title>" --kind measurement — the next id in
repro/studies.json, the folder repro/<id>-<slug>/ with the study's plan.json — and grid.json,
the runs and the ledger live in it. The plan says what the grid measures, the population and its
draw ({ "kind": "seeded", "method", "seed" }), the arms (each name once) and the primary_outcome, and is filled before the first counted
run; the author's approval of the drawn units goes into both grid.json's approval (the guard reads
it) and the plan's author_check (the lint reads it). A grid that is one study of a larger
measurement names it in its row's measurement. When the grid ends, its row is updated (status,
result, result_file, in_paper) and npx paperlint studies index <paper-dir> regenerates the
index; repro/study-registered fails the lint until both are done, and on a running grid whose plan
is empty.
grid.json): each unit with its
role (counted, smoke, excluded), the author's requirement on it verbatim, the arms, the
seeds, the models, the budget cap. A requirement that lives only in a chat or a design note is not
a requirement: a driver cannot read it, and a whole grid can run on one easy, hand-picked unit.gate reads the registry from HEAD and refuses when the working copy differs from
it, when the cell is not declared, when an excluded unit has no reason, when a counted run has no
draw seed. Prose only: that the frame is the whole population, and that the draw is
proportional; the guard sees the registry, not the population behind it.approval. The agent that designed or drew the sample
never fills this field, not even to "save a step".gate refuses a counted run unless approval.by equals the registry's author and
at and channel are filled. Prose only: who typed it — the guard cannot tell the author
from an agent writing the author's name. Make it reviewable: the approval lands in its own commit,
quoting the author's message.The agent's environment excludes secrets by name pattern, and a names-only probe passes before any model call. Transcripts capture environment dumps; a secret in the environment ends up in a committed transcript.
The same probe proves that what the agent needs still works: an exclude-by-pattern policy also
strips variables git needs (GIT_CONFIG_KEY_n matches "KEY"). Prove git commits inside the sandbox.
Per unit, with no model call: the tools the agent is meant to use are visible inside the sandbox, the instrument fires on the pinned state of the unit, and it accepts the reference fix. A shared tools directory that is invisible inside the sandbox turns every run of an arm into a run without the tool.
Held by: run inside the sandbox, as the agent would run —
node ${CLAUDE_SKILL_DIR}/scripts/grid-guard.js env-probe --git
It prints secret-looking variable NAMES (never values) and exits 1; --allow NAME accepts one by
name after you have looked at it. gate refuses a counted unit without proof (toolVisible,
firesOnPinned, acceptsReference, all true). Prose only: how the proof is taken — the
three facts are recorded by your proof script; the guard only refuses their absence.
smoke.timeoutSec and smoke.costPerRun
(measured, with reserve), and commit it before the grid. A model can cost a multiple of its
planned price; the cap and the stop rule are written down before the first counted run.gate refuses a counted run on a model without smoke.timeoutSec and
smoke.costPerRun, hands the driver timeoutSec in its output, and refuses when the spend in the
ledger plus the next run's cost would pass budget.cap. Prose only: that the smoke runs were
actually read.One lock per working-copy root. Two drivers on one scratch path delete each other's trees; one crashes, the other's runs are silently contaminated. A second concurrent driver gets its own root.
node ${CLAUDE_SKILL_DIR}/scripts/grid-guard.js lock <root> --owner <driver-id> --pid $$
node ${CLAUDE_SKILL_DIR}/scripts/grid-guard.js release <root> --owner <driver-id>
The lock is a file beside the root. A live holder → refused. A holder whose process is gone on the same host → taken over, and said so. A holder on another host → refused (it cannot be judged). The holder must be detached — see the next point.
Before every cell, ask the gate and obey its exit code; 3 means the cell is already counted, or reserved by another attempt — skip it. That makes a killed driver resumable: run it again and it continues.
node ${CLAUDE_SKILL_DIR}/scripts/grid-guard.js gate --registry grid.json --ledger attempts.jsonl --unit <u> --arm <a> --model <m> --seed <s> --attempt <id>
An allowed cell is reserved for <id> in the ledger in the same step, under the ledger's
lock: two drivers asking at once cannot both get one cell, nor both fit under the cap, because a
reservation holds the cell and counts its estimated cost until the attempt's end record (same
id) replaces it, or until it lapses (--reserve-sec, default six hours).
Never delete shared inputs from a step. Templates, fixtures and pinned states are read-only
(chmod -R a-w them); a packing step that deletes what it packed removes what another driver
still reads. Prose only, held by file permissions where you set them.
Run the driver detached (setsid nohup … &, its log to a file), never as a task tracked by
the agent session: a session's time cap kills a long grid. A separate waiter (a scheduled wake-up,
a loop that polls the ledger) brings the session back. Held by lock: it refuses a holder
that is not the leader of its own session (Linux /proc/<pid>/stat; true after setsid) and
names the command to use instead; --attached allows a short run, said out loud; without
/proc it warns and passes.
The driver appends a ledger line when an attempt starts and another when it ends (same attempt
id, root, start/end, status, cost). Format: references/registry-and-ledger.md.
node ${CLAUDE_SKILL_DIR}/scripts/grid-guard.js overlap attempts.jsonl
Lists every pair of attempts that shared a root at the same time (an attempt with no end overlaps
everything after its start), where at least one is counted. Each contaminated attempt is marked
"status": "harness-error" — the record is kept, not deleted, and not counted — and its cell
runs again as a new attempt. Run it after any crash, kill or harness change, and before the
numbers are reported.
label-agent-runs.Results in scratch space vanish. Commit finished runs — those with a completion record — frequently; never a half-written run folder.
Every committed artifact is scanned for key-shaped strings, by a pre-commit hook:
node ${CLAUDE_SKILL_DIR}/scripts/grid-guard.js precommit --runs runs --done done.json
It reads the staged content (the index is what commits), refuses key-shaped strings by file and
line without printing them, and refuses a staged run folder that has no completion record. Before
an artifact leaves the repository: node ${CLAUDE_SKILL_DIR}/scripts/grid-guard.js scan-keys <dir>.
Report the spend: total, per model, against the cap.
Stop the driver; do not fix forward on a running grid. Write the incident down (what, when, which attempts), run the overlap audit, mark contaminated attempts, fix the harness, re-run the smoke for any stack the fix touched, then resume. A harness change is an addendum like any other.
docs/osf-artifact.md in the package) — only after scan-keys is clean.SKILL.md.spec.ts (opens in a new tab)references/failure-catalog.md (opens in a new tab)references/registry-and-ledger.md (opens in a new tab)run-agent-grid.eval.ts (opens in a new tab)run-agent-grid.harness.ts (opens in a new tab)scripts/grid-guard-commands.ts (opens in a new tab)scripts/grid-guard.test.ts (opens in a new tab)scripts/grid-guard.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
agent-grid, experiment-runner, grid-guard, benchmarking, reproducibility
23 skills in this plugin
/analyze-sibling-paperDeep-analyze a specific related / competing / concurrent paper — reading the ACTUAL paper, not its abstract — to decide the "isn't this just X?" question before a reviewer asks it: what it really does, whether it's prior or concurrent work, the strongest scoop a reviewer could claim, whether your delta is REAL or merely cosmetic, and the exact cite + positioning clause (or a scoop escalation) to apply. Saves the analysis to the paper's research folder and surfaces action points. Use whenever a paper close enough to yours surfaces — via verify-citations' nearest-neighbor, a reviewer's "this was already done", your own lit search, or an arXiv alert. Distinct from verify-citations (confirms a cite is real + one-line delta) and study-accepted-papers (mines a venue's accepted corpus for levers); this one does the deep per-competitor overlap/scoop analysis. Compose with verify-citations (feeds it neighbors), harden-paper (its nearest-neighbor-scoop axis calls this), and extend-paper (a scooped angle can become the extension's pivot)./argument-arcBuild or repair the paper's argument architecture — the one-sentence-per-section outline, the bottom-up inevitability pass, and the name/number budget. Run it when the reader says the paper throws ideas at them, when a structural objection repeats, or before any large rewrite. Not a prose or length skill.Other plugins' skills for the same job
Generated from the plugin's indexed repository (zernie/paperlint) — no native marketplace selected
npx claudepluginhub p/zernie-paperlint