verify-loop
A verification workflow for people who direct coding agents but do not read the code.
If you build software by talking to Claude Code, Codex or Gemini CLI, you cannot review the diff yourself. So the system has to: hooks that run your tests before the agent may stop, permissions decided by "can this be undone?", and each mistake turned into a check instead of another line in AGENTS.md.
繁體中文說明 · The method · Credits
What's inside
| Piece | What it does |
|---|
skills/verify-loop | Say "verify". The model picks a mode: start (set 3–5 checkpoints first), setup (audit a repo's guardrails), map (feature map + a CLI that drives the real app), triage (turn a mistake into a check), done (evidence, blast radius, risk-tiered review). |
skills/debug | Say "debug". The model routes: ordinary bug, performance, state/timing, or blast radius. |
hooks/stop-verify.sh | A Stop hook. When the agent tries to finish in a registered repo with changed code, it runs that repo's checks. A failure or a timeout blocks once per exact state (exit 2); the same state is not re-run, and after that Claude may stop and sees NOT VERIFIED. With tests_re set, it also blocks, once, a change that edits code and existing tests together; it sees uncommitted edits only (committed test edits are listed by verify-evidence.sh for the reviewer). Its own errors never trap the session. |
hooks/post-edit-check.sh | A PostToolUse hook (Edit, Write, MultiEdit), layer 1. After an edit in a registered project that has an edit_check, it runs that quick check (for example tsc) and blocks (exit 2) only when the check fails and a line of its output names the file Claude just edited. Errors in other files are ignored. A timeout, a missing tool or its own error never blocks. |
hooks/subagent-verify.sh | Layer 2, registered as a PreToolUse hook for SubagentHandback and as a SubagentStop hook. When a subagent is about to hand in its report (or, on a host without that tool, is about to stop), it works out from the subagent's own transcript whether it changed a trusted checkout, and if so runs the project's checks. A failure blocks it (exit 2) and the subagent keeps fixing. At most 2 blocks per subagent, once per exact state. At stop, each checkout that passed or was blocked in the latest hand-back is skipped if its state matches (ledger handback-done). Previous failures and unfinished checks remain visible. |
tools/codex-dispatch.sh | Runs codex exec with an allowlist of flags only: read-only or workspace-write, network off by default for the commands Codex runs (the prompt and images still go to the model service; the caller can pass --net), no user config (no MCP servers, no notify hooks), workspace-write only in the current repo (or repos you list), the report file only under <repo>/.scratch/ or /tmp. |
tools/verify-evidence.sh | Runs a check and prints a Markdown evidence block tied to the commit: SHA, command, exit code, log hash, the node and python3 it found on PATH (add more with --tool <name>; paths are masked, but read that line before posting), and whether existing tests changed. A test added in the branch and edited again is listed under its own heading. The script does not change PATH: if the tools line shows a shim or an old interpreter, fix PATH and rerun. Refuses a dirty tree; exits 90 (INVALID) if the tree changes during the run or test edits cannot be checked. It prints no log text unless you pass --tail N, but it does print the full command. Local evidence helps a reviewer; it cannot see a command that edits files and puts them back. The real gate is CI rerunning on that SHA in a clean checkout. |
docs/METHOD.md | The method in one page. |
Install
As a Claude Code plugin
/plugin marketplace add hank840214-alt/verify-loop
/plugin install verify-loop@verify-loop
The plugin registers the Stop hook and the two new hooks. They do nothing until you register a project.
To upgrade an existing installation, run claude plugin marketplace update verify-loop and claude plugin update verify-loop@verify-loop, then restart Claude Code. Version 0.1.1 runs hook commands and quoted evidence commands with Bash pipefail, so a failed test in test-command | tee log propagates through the pipeline. Pass separate arguments to the evidence tool to execute a program directly. A consumer such as head or grep -q can close a pipe early and leave its producer with status 141 (SIGPIPE). For verification commands, capture the full output before inspecting it. Stop blocks a nonzero pipeline, while the edit and subagent hooks report a signal as unverified.