Fork
pi-autoresearch-harness
The harness is a fork of pi-autoresearch by monotykamary, published on npm as pi-autoresearch-harness (version 1.0.17, November 2026, about 589 downloads a month, MIT). It keeps the same loop and changes the environment the loop runs in — which is exactly the part that bites you when a session runs unattended for hours.
pi install npm:pi-autoresearch-harness
What it changes
Every session gets its own git worktree. The upstream extension works in the checkout you are sitting in: experiments are commits on a branch, and a revert undoes them. The harness instead creates a per-session worktree under autoresearch/<session-id>/ and works there. Your working tree stays clean, two sessions cannot fight over the same files, and a session you abandoned is a directory you can delete rather than a branch you have to unpick. It also adds the session directory to the global gitignore so experiments do not show up in your own repo.
A target value can end the loop. Upstream runs until you interrupt it or hit an iteration cap. The harness lets a session finish by itself when the metric reaches the target you set — the difference between “run overnight” and “run until done”.
Backpressure checks are part of the flow. The optional checks script from upstream is a first-class step here: after a benchmark passes, tests and type checks run, and a failure means discard rather than keep. In a fork built for long unattended runs, that is the safety net that matters most.
Merge or discard is a deliberate step. Where upstream finalizes kept experiments into reviewable branches, the harness asks you to merge or discard at the end of a session, so the worktree can be cleaned up in one move.
Prerequisites are stated. pi, git, and an API key for the model you run pi with. On Windows the loop needs Git Bash, because the measurement steps are shell scripts.
What the README adds that upstream does not
- A cost control section. An unattended loop spends tokens at a rate you will not notice until the invoice; the fork tells you where the brakes are.
- A testing section, because the fork ships with a test suite and CI rather than a single skill file.
- A divergence from upstream list, so you can see what you are trading before you switch.
Which should you install
| Situation | Pick |
|---|---|
| First time trying the loop on a small repo | Upstream pi-autoresearch |
| Overnight runs while you keep editing the same repo | The harness — worktree isolation is the point |
| You want the loop to stop at a target and then let you merge | The harness |
| You read the extension source and want the smallest possible thing | Upstream |
One thing to check before you rely on it
The harness is a fork, and forks drift. Read the divergence list in its README against the upstream release you are on before a long run, and keep the measurement command identical between the two — a metric is only comparable to itself.
The upstream repository and its history are covered on the pi-autoresearch GitHub page; the loop itself, including the .auto/ files and the confidence score, is on the pi-autoresearch home page.