agentleFS
KohulanKohulan/orthonym-skills/skills/reuse-before-rerun/SKILL.md

reuse-before-rerun

Skill2 starsChanged 47 days agoMITView on GitHub

Searches the results ledger, the repo, scratch directories and notes in one sweep for an existing result, then gives a three-line REUSE / EXTEND / RERUN verdict before anything expensive runs. Use when about to launch any measurement over a minute long — benchmark, failure census, spy over many rows, head-to-head against another engine, determinism eval, shard generator, full gate, large-corpus run — and when the user asks for a number, a table, or the run from a given date. Also use on the thought "let me re-measure", "fresh spy", or "quick sanity run", and when a prior result cannot be found. Not for running the measurement itself (use run-eval or run-gate after it).

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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
  1. Distinctive:

    Every expensive run is a claim: "no usable result exists." Prove that claim in one sweep before spending compute.

    line 10
  2. Very specific:

    Create it once — newest first, append-only, one row per expensive run.

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Reuse before rerun

Overview

Every expensive run is a claim: "no usable result exists." Prove that claim in one sweep before spending compute. Most numbers a mature project needs were already measured; the failure mode is not finding them and re-running for hours.

Small runs count too: a "quick 500-row sanity run" on a question that already has a full-corpus answer is a rerun, and so is a spy over ~100+ rows. Not needed for: a single-input probe, unit tests, the fast pre-gate.

Wire this in

sweep.sh (run it; it calls _group.py beside it, and you need not read either) needs bash, git and python3 (standard library only). It reads its roots from env vars — set them once:

  • RBR_REPO — repo to search (default: git toplevel, else $PWD)
  • RBR_LEDGER — the ledger (default: $RBR_REPO/RESULTS-LEDGER.md)
  • RBR_EXTRA_ROOTS — colon-separated extra dirs: session scratchpads, a notes/memory dir, an artifact store. Set this — a large share of results land outside the repo.

<skills-dir> in the commands below is wherever this skill was installed: .claude/skills for a project copy, ~/.claude/skills for a user copy, or ${CLAUDE_PLUGIN_ROOT}/skills under the plugin.

Also substitute your expensive commands below, and your notes / memory tool in step 2.

The protocol (in order, no skipping)

Copy this checklist and track your progress:

- [ ] 1 Question named (corpus · size · config · metric · HEAD)
- [ ] 2 sweep.sh run + one notes/memory query
- [ ] 3 REUSE / EXTEND / RERUN picked
- [ ] 4 Verdict block written; user OK if past the expensive threshold
- [ ] 5 Ledger row appended when the run finishes
  1. Name the question in one line: corpus + size + engine/config + metric + code state (a HEAD hash, or "any" if the question is about the past).
  2. Sweep once — one Bash call, then one query to your notes / memory tool ("<keyword> result"):
    bash <skills-dir>/reuse-before-rerun/sweep.sh <keyword> [since YYYY-MM-DD] [until YYYY-MM-DD]
  3. Pick one outcome:
    • REUSE — same corpus and size exists, and git log --oneline --since=<run date> -- <src> is empty, or the question is about the past. Report path, date, HEAD.
    • EXTEND — a subset, or a paused/partial run (shard files in a scratchpad), exists. Run only the delta: new rows, failing rows, or missing shards.
    • RERUN — nothing usable exists. Say which of the five places came up empty.
    • Commits since the run date do not make it RERUN by themselves. Report the last full number plus the measured gain of each shipped fix, and mark it "incremental, not re-measured".
    • Sweep reports rows not shown? Narrow the keyword or add a date window; return to Step 2.
  4. Write the verdict block in every reply that reports a number or launches a run, REUSE included, even when nothing is launched, so the reader can see what was searched. Exactly these 3 lines, right after the numbers:
    Existing: <path · date · HEAD>  |  none — 0 hits for "<keyword>" in ledger, repo, scratchpads, notes, memory tool
    Verdict:  REUSE | EXTEND <delta rows> | RERUN because <none exists | corpus changed>
    Cost:     0 (reused)  |  <rows> rows · ~<minutes> min · <cores> cores
    A run past your expensive threshold (tens of thousands of rows, or an hour+) needs the user's OK this session unless pre-approved. Saying "you'll need a fresh run" also needs the verdict block first.
  5. Register when it finishes — append one row to the ledger ($RBR_LEDGER) in the same turn. The next sweep then finds it in step 2.

Answering "where is the run from <date>"

Same command with the date window — sweep.sh <keyword> 2026-01-13 2026-01-15 (until is exclusive) — across all roots, not only the repo. "I can't find it" is not "it does not exist" until the ledger, the repo, every scratchpad, your notes and your memory tool all came up empty. Name each one you checked.

Ledger format

Create it once — newest first, append-only, one row per expensive run. Strict: keep date first as YYYY-MM-DD; sweep.sh reads only rows that start | 20.

| date | tag | engine | HEAD | rows | headline | path |
|---|---|---|---|---|---|---|
| 2026-01-14 | <corpus>-<size> | <engine/config> | <short hash> | 500 | <the numbers a reader needs> | <artifact path> |

tag = corpus + size, as your file names spell it; HEAD = the short commit measured (— if unknown); path = the artifact to open. Never delete a row — a missing row is how a run gets repeated.

Red flags — run the sweep first

  • The command you are typing is a benchmark / census / measure / shard script, or names a large corpus file, and no verdict block is in the chat.
  • You are about to write "needs a fresh measurement" or "not yet measured" with no verdict block.
  • "Let me re-measure to be sure." / "A fresh spy is more trustworthy." / "Quick sanity run."
  • You cannot name the prior result you looked at.
  • The user said "again and again" or "you already have" this session.

Rationalization table

ExcuseReality
"The old number may be stale"git log --since=<date> -- <measured path>. No commits → same number. Commits → EXTEND on the affected rows.
"Re-measuring is cheap insurance"A full-corpus run is hours, and an unasked full run needs the user's OK (step 4).
"I searched and did not find it"Ledger, repo, scratchpads, notes, memory tool — name each. Many outputs land in scratchpads.
"Spy-before-code needs a fresh spy"An existing spy at the same HEAD satisfies it. Re-spy only on 2+ positives when it is load-bearing.
"The user asked for the number"They asked for the answer. The answer usually already exists.
"This run is different (corpus/size)"Then EXTEND from the existing subset, and state the delta.
"It is only 500 rows"If the full corpus was measured, 500 rows adds noise, not information.
"The numbers predate the last fix, so re-run the full corpus"Past the expensive threshold: needs the user's OK. Report the incremental number — last full run plus each fix's measured gain — in the verdict block first.
"Engine X was never run at full size"Five agents said that; the summary was in a session scratchpad. Sweep before saying "not measured".
"A note already gives the number"Open the file it points at. A note is a pointer, not a result: a number counts as VERIFIED only once you have opened its file.
"I'll add the ledger row later"Later is the next session re-running it. Append it in the same turn the run finishes.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.