Skip to main content

prereg

pypi python license docs

Freeze a plan before you run it, and record what changed after.

Part of reproducible-science alongside repro, citations and results — see the documentation.

Install

pip install prereg

Quick start

prereg new V16_reliability_ceilings
# fill in the plan, commit it
prereg freeze
# run the experiment, then log what happened
prereg log "tolerance now derived from fixtures" --access "no results seen"
prereg check
unchanged    V16_reliability_ceilings/PREREG.md

Commands

Command What it does
prereg new <name> Scaffold a plan in OSF's headings
prereg freeze Record the commit and hash
prereg freeze --osf Freeze and push as a draft registration to OSF
prereg log <note> Append to the log without freezing
prereg check Has the plan changed since the freeze?
prereg setup Save your OSF token to .env

One file, one rule

V16_reliability_ceilings/
    PREREG.md      the plan, then a line, then an append-only log
    tests/  results/

Never edit above the line. Only append below it.

prereg check enforces it — the freeze records a hash of the plan, and any later edit to it fails the check. Appending to the log does not.

The log

2026-08-11  frozen at 9894e148e429              nothing run
2026-08-13  tolerance now from fixtures         no results seen
2026-08-14  ran                                 results not opened
2026-08-15  C5 failed at k=15: 6.6% vs 5%       results seen

The last column is what distinguishes an amendment from a deviation, so you never have to decide which word to use. nothing run, no results seen, results not opened, results seen. An entry logged before results is an amendment; one logged after is a deviation.

Check output

Exit Result Meaning
0 unchanged The plan says what it said
1 CHANGED The plan was edited above the line after freezing
2 not frozen No hash recorded — nothing was measured

not frozen is not a pass. It is the absence of a check.

The plan uses OSF's headings

Verbatim, so the document maps onto an OSF registration without being rewritten. Two of the twenty-seven do the real work:

  • Foreknowledge of data or evidence — what you have already seen.
  • Inference criteria — the decision rule as a commitment, before the number exists.

A heading that does not apply is answered N/A with a reason, never deleted.

OSF integration

The plan uses OSF's question titles verbatim, so prereg freeze --osf pushes it directly to OSF as a draft registration. You review and submit it there — submission is irreversible.

prereg setup                  # save your OSF token (once)
prereg freeze --osf           # freeze locally and push to OSF

Create a token at osf.io/settings/tokens with the osf.full_write scope. The token is stored in .env (gitignored).

What a freeze is

A commit and a hash. The commit is the evidence — it is in history, dated, and not yours to revise quietly. The hash is the convenience that lets prereg check tell you in a second whether the plan still says what it said.

Neither proves you did not run the experiment first. Nothing can: a timestamp bounds when something existed, never when work began.

Claude Code

plugin/ is a Claude Code plugin. Three surfaces, because each catches a different failure: the hook catches what the model does not think to do, the skill catches what you did not know to ask for, and the command is there for when you want the answer now.

surface fires
hook when a frozen preregistration no longer matches the digest it was frozen with
skill when Claude judges the situation calls for freezing a plan before a run, and recording what changed after
command when you type /prereg-check

Why the hook. This is the only exact check in the set. It recomputes a hash you recorded and compares two strings, so there is no threshold and no judgment. A plan rewritten around a result defeats registration entirely and no reader can detect it afterward, so the hook reports the difference and never edits the registration.

It reports and never blocks, and stays silent in a project with no frozen plan.

/plugin marketplace add elliottower/reproducible-science
/plugin install prereg@reproducible-science

The plugin ships instructions and hooks, not binaries, so install the tool as well:

uv tool install prereg        # or: pip install prereg

All four tools in one plugin, with every hook, skill and command:

/plugin install reproducible-science@reproducible-science

MIT licensed.

This tool and repro

prereg installs and runs on its own, is not deprecated, and is not going to be. reproducible-science depends on it, so repro prereg ... runs this same command with the same arguments and the same exit code. That is a spelling, not a feature.

What only exists in the umbrella is repro check, which runs every tool a project uses in one pass, with one report and one exit code, and names the tools the project does not use rather than counting them as passing. If a project only preregisters, the umbrella adds nothing over this command at all.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prereg-0.4.1.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prereg-0.4.1-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file prereg-0.4.1.tar.gz.

File metadata

  • Download URL: prereg-0.4.1.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prereg-0.4.1.tar.gz
Algorithm Hash digest
SHA256 2bd04b9f723b333316ae541d28b2f390b8585c8e8d8526e13f7e562f1b66effb
MD5 bc8453f3577ead68ec27425a32b0d54d
BLAKE2b-256 3c2632ace38941cefb3dac15cce9cad4c54ca8b208fa3f6bd50085f4c0939c8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for prereg-0.4.1.tar.gz:

Publisher: publish-prereg.yml on elliottower/reproducible-science

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prereg-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: prereg-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prereg-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b37d6ff1ec265d64e8809aed93553f6f5125a0ae0bb76a20d36a198a1e43c739
MD5 c98944548d289598acc5df1c087d15a1
BLAKE2b-256 4969e3cfd94399896fba3032aae0569b71ddc32b02c2dca15abb04bfc7f5fd49

See more details on using hashes here.

Provenance

The following attestation bundles were made for prereg-0.4.1-py3-none-any.whl:

Publisher: publish-prereg.yml on elliottower/reproducible-science

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.2

2 files

This release

0.4.1 This release

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page