$ cat ~/map/write-judge.md
write-judge
Pi extension that judges every edit before it lands and blocks the ones that delete or weaken tests.
extensions✓ Oct 22
Facts
- repository
- github.com/acoyfellow/write-judge ↗
- GitHub Stars
- ★ 7
- Forks
- 0
- license
- MIT
- npm / mo
- —
- last push
- Nov 1, 2026
install
npx wrangler login (once; a free Cloudflare account works), then pi install git:github.com/acoyfellow/write-judge, then /reload## TL;DR
A Pi extension that judges every edit and write before it lands, asking one question — does this change delete or weaken a test, assertion, check, or guard — and blocking likely deletions so the agent has to state its intent in a separate edit that touches only the test.
## Key points
- $Before each edit or write runs, write-judge asks one yes/no question: does this change delete or weaken a test, assertion, check, or guard?
- $A small decision model answers with a probability; above 0.5 the edit is blocked and the agent is told why, and it can still make the change in a separate edit that touches only the test.
- $The decision model is Clef, called on Cloudflare Workers AI; write-judge borrows your wrangler login and your first Cloudflare account, with no API keys to paste and no config file.
- $A one-off trial without installing: pi -e git:github.com/acoyfellow/write-judge.
- $The guard fails open: a project with no tests lets the edit through with no model or network call (logged as skipped), an expired token refreshes once from wrangler, and a logged-out or offline session lets edits through with one unavailable warning per session.
- $A 401 from the decision API fails at once, with no retry loop slowing every edit.
- $It is not a code reviewer and does not judge bash — sed -i on a test file is not checked yet.
- $Optional env overrides: WRITE_JUDGE_ACCOUNT_ID, WRITE_JUDGE_TOKEN, WRITE_JUDGE_MODEL (default @cf/cloudflare/clef), and WRITE_JUDGE_LOG for a JSONL verdict log; the README reports holdout results (AUC 0.94, precision 82 percent, recall 93 percent at 0.5 on 58 held-out test-file edits) with receipts in the repo.
## FAQ
Q Is write-judge an official pi extension?
No. It is a community extension by acoyfellow, built on the Agent Experience team at Cloudflare; it judges pi's edit and write calls before they run.
Q Does a block destroy the agent's change?
No. Above the 0.5 threshold the edit is blocked and the agent is told why; if the change is intended, the agent can state that and make it in a separate edit that only touches the test.
Q What happens when I am offline or logged out of wrangler?
The edit goes through — the guard fails open — and the session logs one unavailable warning; a 401 from the API fails at once instead of retrying.
Q Does it review all my code changes?
No. It answers exactly one question about test deletions and lets everything else pass through; bash commands such as sed -i on a test file are not checked yet.
Q Do I need an API key for the decision model?
No. write-judge borrows your wrangler login and uses your first Cloudflare account to call Clef on Workers AI; WRITE_JUDGE_ACCOUNT_ID, WRITE_JUDGE_TOKEN, and WRITE_JUDGE_MODEL override the defaults when needed.
## References
## Related entries
$ pi-heed
Turns what you said into runtime constraints and checks every side-effecting tool call against them before it runs.
$ pi-jev-sentinel
Guards pi tool calls, tool outputs, and replies with Jev-scored risk, injection checks, and secret scrubbing — never auto-allows.
$ pi-feats
Production extension bundle for pi: isolated profiles, Nono sandboxing, guardrails, HTTP API, scheduling, and a web console.
## Guides
Last updated: Nov 1, 2026