elliottower/reproducible-science/tree/main/packages/repro/mod
repro
一个用于可复现研究工作阶段的 Claude Code function hook 插件:拒绝编辑已冻结的 PREREG.md 计划,在论文或分析运行没有 .results/ 台账时发出警告,记录下载的源 URL 供引用,并显示 prereg、结果和引用状态的实时状态行。
关于这个 mod
repro 是与 reproducible-science 插件一起发布的 Claude Code mod,用记录约束研究工作阶段。它拦截 Edit/Write 调用来冻结摘要 PREREG.md 文件并拒绝修改;在论文或分析运行首次编辑 .tex、.Rmd、.qmd、.typ 文件,且背后没有 .results/ 台账时发出提示;还会提示模型把下载的 PDF 记录为供 citations fetch 使用的 url: 条目。它会把 seal/claim/freeze 门禁注入系统提示,在提示上方渲染一行暗色状态行,总结 prereg 的冻结、台账的运行/封存/声明以及引用验证,并发出简洁警告,例如 '1 plan edited after freeze' 或 '16 runs, nothing sealed'。斜杠命令包括 /repro-status(可通过 name、pick、list、auto 选择项目)、/repro-verify,以及 /repro-hide /repro-show。这个 mod 注册一个 set_project MCP-style 工具,并根据被触碰的文件路径检测工作项目。通过 '/plugin marketplace add elliottower/reproducible-science' 和 '/plugin install repro@reproducible-science' 安装;它要求 results、prereg 和 citations 命令位于 PATH 上。开发使用 'claude plugin validate' 和 'claude plugin test'。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add elliottower/reproducible-science claude plugin install repro
原文 / README
repro
A Claude Code mod for research sessions. The reproducible-science plugin's hooks speak when a
number enters a manuscript unbound or a frozen plan changes, and they speak only in a project
that already keeps a ledger or a plan. This closes the other half: it works in a project that
keeps neither yet, and it can refuse.
It is a plugin of function hooks. That API is early access and changes between Claude Code
releases, so this ships beside the reproducible-science plugin and not inside it: a build
that cannot load it still loads the plugin.
What it does
| | |
|---|---|
| Refuses an edit to a frozen plan | An Edit or Write to a PREREG.md carrying a freeze digest is denied, with the instruction to record the change with prereg log. |
| Notes a manuscript with no ledger | The first edit to a .tex, .Rmd, .qmd or .typ with no .results/ ledger above it goes through, and the model is told no number in the file is bound to a run. |
| Notes an analysis with no ledger | The same, once per project, when a command runs an analysis. |
| Notes a downloaded source | After curl or wget saves a PDF, the model is told the address to record as url: in the claims file, so citations fetch can retrieve the same bytes for a reader. |
| Puts the gates in the system prompt | Seal before a run, claim before a number, freeze before a confirmatory analysis, with the state of the project's records as of the last turn. |
| Shows the state | One dim row above the prompt, refreshed at the end of each turn, with one field per tool. |
| Warns | The pinned line under the prompt appears only when something is wrong, a few words per problem. |
| /repro-status | The same readout on demand, with the sealed files hashed. Instant, and no model turn. |
| /repro-verify | Checks every pinned quotation of the working project against its source, which takes minutes on a large project, and keeps the count for the readout. |
| /repro-hide, /repro-show | Hides the readout above the prompt, and shows it again. A warning still appears while it is hidden. |
The status row
study · prereg: 1/1 frozen · results: 3 runs, 2 sealed, 4 claims · citations: 120/120 found
prereg is frozen plans over all plans, or none drafted. results counts the ledger's runs, seals and claims.
citations is the last full check by /repro-verify, and before one has run it is the count
pinned: citations: 120 pinned, not verified. Checking quotations takes minutes on a large
project, so the row never runs it. A check that does not finish in a minute marks its own field
not read (timed out) and leaves the others standing.
The warnings, each on the pinned line as repro: ...:
| | |
|---|---|
| 1 plan edited after freeze | a frozen PREREG.md no longer matches its digest |
| ledger truncated, edited, corrupt | the chain does not verify |
| ledger rewritten after timestamp | a timestamp proof contradicts the chain |
| 2 sealed files changed | after /repro-status, which hashes the sealed files |
| 16 runs, nothing sealed | runs are recorded and no input was sealed |
| 3 runs, no plan frozen | runs are recorded and no plan is frozen |
The working project
A session started in one folder often edits files in another, so the project is read off the
paths the tools touch: the nearest directory above a touched file that holds a .results/
ledger, a claims/ directory, a PREREG.md or a paper/ directory.
/repro-status the working project's state
/repro-status <part of a name> set the working project, among the folders beside the session's
/repro-status pick choose one from a list
/repro-status list print them
/repro-status auto go back to following the files
The model can set it too, through the set_project tool the mod registers.
Install
/plugin marketplace add elliottower/reproducible-science
/plugin install repro@reproducible-science
It needs the results, prereg and citations commands on PATH.
Develop
claude plugin validate packages/repro/mod
claude plugin test packages/repro/mod
The tests stand in for the engine and need no network. They do not run in this repository's CI, which has no Claude Code.
