paper-reproduction
CLAUDE.md2 starsChanged 20 days agoMITView on GitHub
A bench for faithfully reproducing scientific papers with Claude Code skills. See README.md for the user-facing overview. Each stage only reads the previous stages' files. Skills live in .claude/skills/<name>/.
- Reads credentials
In this repository3 other files it gives its agents.
- implement-paperSkill
- paper-to-specs-and-testsSkill
- test-paperSkill
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Illustrate whenever possible: Prefer a diagram, table or image to prose: mermaid diagrams in Markdown files, ASCII schemas in the terminal, …
- Very specific: line 26
Results only via
write_results.py: Never hand-write results/. - Very specific: line 27
Tests are the definition of "reproduced": Never widen a tolerance, change a paper_value or remove a target to make a test pass.
- Very specific: line 45
Not installed: gh, pdftotext.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md 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
CLAUDE.md
A bench for faithfully reproducing scientific papers with Claude Code skills. See README.md for the user-facing overview.
How to answer
- Get straight to the point. Lead with the answer or the result, skip preamble and recaps, and keep explanations short.
- Illustrate whenever possible. Prefer a diagram, table or image to prose: mermaid diagrams in Markdown files, ASCII schemas in the terminal, plots (PNG) for results and learning curves, and tables for paper-vs-local numbers.
Pipeline
paper ──/paper-to-specs-and-tests──▶ spec/<id>.md + tests/<id>/
spec ──/implement-paper───────────▶ papers/<id>/ + results/<id>/*.json
tests + results ──/test-paper──────▶ reports/<id>.md + README "Reproduced papers" rowEach stage only reads the previous stages' files. Skills live in .claude/skills/<name>/.
Rules that must hold
- Never edit the spec without asking the user. Propose the change (with its source) via AskUserQuestion. After approval, edit the spec and append a row to its
## 10. Change log. Unapproved values may be used provisionally for cheap work, never for full runs. - Official code first.
papers/<id>/official/is a git submodule pinned to the spec's commit. Never commit edits inside it: save changes withpapers/<id>/save_patch.sh <name>aspatches/NNNN-<name>.patch, and restore withapply_patches.sh. Write an own implementation only when the spec's §2 decision says so. - Ask before full training runs. Smoke runs and released-checkpoint evaluations (Stage 0) are fine. Full runs need a compute estimate and the user's approval. The GPU is shared, so check
nvidia-smifirst. - Never stop a GPU process you didn't launch without asking the user, even to free memory for a run. Show the PID, its owner and command, then ask. You may stop your own processes, i.e. ones started in this session or recorded with their PID in a
REPRODUCTION_LOG.mdRuns table. Check that the PID and command still match first, since PIDs get reused, and log the stop. Running under the same Unix user doesn't make a process yours. - Results only via
write_results.py. Never hand-writeresults/. The script records the provenance thattest-paperchecks. - Tests are the definition of "reproduced". Never widen a tolerance, change a
paper_valueor remove a target to make a test pass. Such a change needs a spec change-log entry approved by the user, otherwisetest-papermakes the verdict INCONCLUSIVE. test-paperis read-only. It diagnoses but never edits spec, tests, results or code. Fixes go back toimplement-paper.- Report honestly. A near-miss is a fail. A value far above the paper is suspicious (possible leakage), not a success.
- Detach every run longer than ~1 minute from the ssh session, so it survives a disconnect or the session shutting down. Launch it with
setsid nohup <cmd> < /dev/null > <run_dir>/stdout.log 2> <run_dir>/stderr.log &(own session, no TTY, SIGHUP ignored), or intmux. Write its PID to<run_dir>/pidand to the log's Runs table. Never run long jobs in the foreground of a tool call or as a plain background child of the shell.
Conventions
paper_idis<first author last name><year>_<keyword>in snake_case, e.g.vaswani2017_transformer. It is shared by every file of the paper.- Spec (
spec/<id>.md, frompaper-to-specs-and-tests/assets/spec_template.md): §2 implementation strategy, §6 targets (absolute, relative claims, proxies), §7 results contract, §8 assumptions, §10 change log. Every number cites its source (table, figure, section, config). - Tests (
tests/<id>/test_<id>.py):Target(id, experiment, metric, paper_value, tolerance, source, priority)andClaim(id, greater, lesser, min_gap, source). They skip when a results file is missing. Every target and claim ID must appear in backticks in the spec.REPRO_RESULTS_DIRoverrides the results folder. - Results (
results/<id>/<experiment_id>.json, tracked in git):paper_id,experiment_id,metrics,per_seed,implementation(official / official-modified / own),commit,bench_dirty,official_commit,patches,patches_sha256,config,run_dir,written_at,notes. Smoke experiments have IDs ending in_smoke. - Per-paper work log:
papers/<id>/REPRODUCTION_LOG.md(status, pending spec questions, deviations, environment, runs). Read it first when resuming. - Verdicts: REPRODUCED, PARTIALLY REPRODUCED, NOT REPRODUCED, INCONCLUSIVE. The model may downgrade a mechanical verdict, never upgrade it.
Environment
- Root
.venv(Python 3.12, pytest) runs the bench tests and the skill scripts. Each paper has its ownpapers/<id>/.venvcreated bysetup_env.sh(uv). - GPU: NVIDIA RTX PRO 6000 Blackwell (98 GB, shared with other users). It needs torch ≥ 2.7 built with CUDA ≥ 12.8.
- Not installed:
gh,pdftotext. - Paper lookup: the arXiv API and OpenAlex work. Semantic Scholar rate-limits without
S2_API_KEY, and DBLP is blocked from this machine. Papers with Code has shut down, so usehuggingface.co/papers/<arxiv_id>to find code. - Large artifacts (data, checkpoints, runs,
papers/*/source/) are gitignored.
Commands
.venv/bin/python -m pytest tests/<id> -v # quick check
.venv/bin/python .claude/skills/paper-to-specs-and-tests/scripts/smoke_test.py <id> # validate a new test suite
.venv/bin/python .claude/skills/test-paper/scripts/collect.py <id> --out <file> # evidence + verdictDoes 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.

