batten
English · Español
78% of agent failures are silent. They do not raise an error — the agent reports success and
the work is wrong. In the same measurements, deterministic gates tripled reliability, and they
did it by refusing things rather than by asking an agent to be careful.
(arXiv:2607.07405)
batten is one of those gates, for the workflow your repo already declares.
See it before you configure anything — it builds a throwaway repo, runs the whole flow, and deletes
it. It does not touch your repository or your database:
$ batten demo
And it does not block you by default. batten init writes enforcement: report: the gates
watch and warn, nothing is refused, and you flip it to enforce when you trust what you have been
reading. batten report is what you read.
A workflow written in prose cannot enforce itself.
Every serious team writes its process down. Phases, review gates, "two agents never touch the same
file", "never approve without evidence". It goes in a CONTRIBUTING.md, or a 700-line prompt file,
and it gets pasted into each new session.
Then an agent ignores it, and nothing happens. No error, no denial. The rule was a sentence in a
document, and a sentence cannot stop a git commit.
The two rules that matter most are exactly the two that fail this way:
"Never close a work item with result: ok and an empty evidence[]."
"Two agents must never write the same file."
Both are pleas. A distracted agent breaks the first one because the code looks fine, and you find
out in production. It breaks the second one at hour six of an overnight fan-out, and you find out in
the merge.
batten turns that document into data — a batten.yaml your repo declares — and then enforces
it with Claude Code hooks. The rules stop being advice and start being denials.
The product is two denials
Everything else in this repo exists to serve these.
Five more have joined them since, and they are listed here rather than buried because each one
used to be prose asking a model to behave: merging a worktree without both verdicts, deleting
anything during an unattended run, batten override while nobody is watching, committing during an
unattended run even with the verdicts in place, and exceeding the declared iteration ceiling. The
last four are the absolute rules of /batten-night — 112 lines of markdown, in the most dangerous
command this plugin ships, in the one place where a mistake is irreversible and nobody is awake to
catch it. That was the single loudest instance of batten not taking its own medicine.
1. The verdict gate
An agent finishes a work item, feels good about it, and reaches for the commit:
$ git commit -m "feat: add order rate limiting"
PreToolUse:Bash [batten] permission denied
batten: US-034 has no verdict envelope. Run the "qa" phase before committing.
To proceed anyway (recorded in the audit log): batten override US-034 --reason "..."
It runs the QA phase, and tries to approve with nothing to point at:
$ echo '{"check_id":"US-034-qa","result":"ok","evidence":[]}' | batten verdict --unit US-034
batten: result "ok" with an empty evidence[] is not allowed: an approval must cite
something (command output, test counts, a criterion verified). Without evidence the
result is "blocked"
Rejected by the binary, before it ever reaches the database. And if a verdict somehow got in by
another path, the commit hook catches it independently.
This is the one failure batten exists to kill: closing a work item because it looks fine.
So it cites three real things. That is still not enough, because a citation is also just text:
$ batten verdict --unit US-034 --file verdict.json
verdict recorded: US-034 qa=ok (3 evidence)
$ git commit -m "feat: add order rate limiting"
batten: US-034 has no batten-verified pass. The gate's checks must be RUN, not asserted.
Run: batten check US-034
When the gate declares checks:, batten insists on running them itself:
$ batten check US-034
✓ go build ./...
✓ go vet ./...
✓ go test ./...
US-034: OK (batten-verified). all gate checks passed (batten ran them)
$ git commit -m "feat: add order rate limiting"
[feature/US-034 8f2a1c9] feat: add order rate limiting
Two verdicts, from two different producers. batten check proves the declared checks ran;
the envelope proves somebody judged the work against its acceptance criteria. Neither one
substitutes for the other, and batten check on its own does not close a unit.