Tutorial
A Verification Loop for Solo Builders, Borrowed from Claude Code
Copy a small version of the Claude Code team's verification loop: cheap checks, a three round cap, a gate your agent can't edit, commit stamps and a demo.
Quick answer
On 2026-11-16 Addy Osmani published How the Claude Code team thinks about verification on the claude.dev blog (checked 2026-11-16). The article says the team wraps its coding agents in a verification layer so one person can hand work to many agents without reading every diff. The pieces include running the real app, cheap checks first, a stop after three failed rounds, a judge the change can’t edit, commit stamps and a gate with three modes.
If you work alone, you can copy about half of that in an afternoon: one verify script, a three round cap, cheap checks before anything expensive, a check config read from your main branch, a stamp line in every commit message and a rule for flaky tests. The other half (a 39 item checklist, evaluating reviewers against reverts, rules approved by a human in a PR) needs a team and a long history, so we’ll say so as we go.
We have not run the Claude Code team’s setup, and nothing here is a result from it. The demo at the end is our own teaching sketch, and its sample output is real output from a throwaway repo.
What this does not protect: the commit gate only checks that a Verified: line exists, not what it says. Verified: lint=pass tests=FAIL and Verified: banana both pass enforce. It’s a reminder and a record, not security.

What the article says the team does
Everything in this section is the article’s claim, not something we have verified (checked 2026-11-16). We list it so you can see what we borrow and what we leave alone.
- Scale. The article says about 90% of the team’s code is written and reviewed by Claude, and that verification loops are what let you delegate to many agents instead of one or two.
- Graders. It says a separate rubric grader improved task success by up to 10 points over a standard prompting loop, in internal testing on structured file generation.
- Three test types. End to end tests (its top pick), property tests and differential tests. It also warns that flaky, slow or heavy tests do damage.
- Run the change. A
verifyskill in.claude/skills/that boots and drives the app. - Stop after three rounds. If a check still fails after three rounds, the agent stops and brings in a person.
- Cheap checks first. Tests, build and linter run locally before a pull request opens, and the article mentions a hook that runs tests when Claude finishes.
- A judge the change can’t edit. The review config,
REVIEW.md, is read from the base branch and never from the pull request. - Stamps and a gate. Each commit is stamped with how it was verified, including “none”. A commit gate has off, observe and enforce modes, and it lets a commit through after two blocks in a session.
- A diff triggered checklist. The article describes 39 items, and says Claude checks only the ones whose trigger matches the diff, usually 3 to 10.
- Measuring and maintaining. Reviewers are evaluated on reverts, repeated misses become rules (after a human approves them), flaky tests cannot be skipped, slept or retried, and the rules get pruned on a routine.
What needs a team and what fits in an afternoon
Here’s our own sorting, based on reading the article. It is a judgment call, not something the article says.
| Piece | Solo afternoon? | Why |
|---|---|---|
verify script that runs the app |
Yes | One script, one app |
| Cheap checks first, three round cap | Yes | A loop around commands you already have |
| Check config read from the base branch | Yes | One git show |
| Commit stamps and a gate with modes | Yes, small version | A hook and a text file |
| Flaky test rules | Yes | A written rule plus a habit |
| Short diff triggered checklist | Yes, 5 to 8 items | You only need your own history |
| Pruning | Yes | A calendar reminder |
| 39 item checklist built from incidents | No | Needs a long incident history |
| Evaluating reviewers on reverts | Mostly no | Needs enough merged changes to compare |
| Rules approved by a human in a PR | Not as described | You are the human and the author |
The last row has a catch: the article has a human approve proposed rules in a PR, and alone you approve your own. A weekly reread is a fair substitute, not the same thing.
Start with a verify script that runs the change
The article’s advice is that running the change matters more than tests, and that you write down how to boot and drive the app so the agent can do it every time. You don’t need a skill system for that. A plain script in your repo does the same job for a solo project.
Make scripts/verify.sh (or .py) do three things: start the app the way a user would, hit one real path, and exit non zero if the result is wrong. For a web app, that might be starting a dev server and fetching one page. For a command line tool, run it on a sample file and compare the output. Keep it fast: the article warns that slow tests mean fewer runs.
#!/usr/bin/env bash
# scripts/verify.sh (illustrative sketch, not run here)
set -euo pipefail
python3 -B -m myapp --input samples/small.csv > /tmp/out.txt
grep -q "total: 42" /tmp/out.txt
echo "verify: ok"
Then tell your agent, in whatever instruction file it reads, to run scripts/verify.sh before it says a change is done. Our post on writing an AGENTS.md covers how to phrase instructions so they are checkable.
The article says to pick end to end tests if you can only write one type. Solo, that usually means this script plus a scripted user flow or two.
Cheap checks first, then three rounds, then a human
Order matters. Run the quick things (syntax check, linter, unit tests) before the slow things (the app run, a browser flow). The article says its agents run tests, build and linter before opening a pull request, so shared review and CI time is not spent on bugs the agent could have caught itself. You have no shared CI queue, but your attention and token budget are limited too.
Then cap the retries. The article says that after three failed rounds the agent stops and brings in a person. You can copy that: run the failing checks, let the agent try a fix, run them again, and after the third failure print “escalate to a human” and exit with a special code. We picked 3 because the article does; treat it as a starting point.
For a hard budget limit as well, see our post on an agent kill switch with a budget and loop guard. The cap says when to ask a human, and the kill switch says when to stop spending.
Here is the shape of the demo’s check file (the full demo is below):
[
{"name": "lint", "cmd": "python3 -B -I -m py_compile app.py"},
{"name": "tests", "cmd": "python3 -B -I -m unittest discover -s tests"}
]
Keep the judge out of the diff
This is the idea we’d copy first. The article puts it bluntly: “If a change can modify the check that judges it, the check is broken.” Its team reads the review config from the base branch, so the pull request cannot rewrite the rules it’s being judged by.
No malice is needed for this to bite. If a test fails, the quickest way to green is to loosen the check, which is one edit away when the config sits in the same working tree. Reading the config from your main branch closes the door:
# read the check list from main, not from your working tree (not run here)
git show main:.verify/checks.json
Two rules make this work solo. Put your check config, gate script and any rubric files in one folder, such as .verify/. Then have your tooling refuse to run if that folder shows up in the diff and point you to the base ref instead. The demo does exactly that.
One limit: if you merge your own pull request, you can still edit the checks and merge that first. The base branch protects you from your agent’s change, not from you. A separate small pull request for any change to .verify/ is a cheap habit.
Stamp every commit
The article says the team stamps each commit with how it was verified, and that the stamp includes “none” so they can query for commits that were not verified. It turns a missing step into something you can search for.
For a solo project, a git trailer line in the commit message is enough:
Verified: lint=pass tests=pass
or, when nothing ran:
Verified: none
Unverified-reason: docs only
Later, git log --grep "Verified: none" lists every commit that skipped the loop. The demo’s run command prints the line for you and also saves a small JSON stamp inside the git directory. The stamp format is our own, not the team’s, which the article doesn’t describe.
A commit gate with three modes
The article describes a gate that can block a commit when the session didn’t include a review or verify step. It has three modes: off, observe and enforce. Observe logs what would have been blocked so you can look for false positives. Enforce blocks. The article also says any commit can carry an explanation of why it was not verified, and that after two blocks in a session the next commit is let through, so the agent doesn’t get stuck.
Start in observe for a week, check what it would have blocked, then switch to enforce. The two block escape hatch matters because a gate that can wedge your agent forever will get switched off.
In our demo, the gate is a script that reads a commit message file. It’s meant to be called from a commit-msg git hook, though the demo doesn’t install one.
What this does not protect: the gate only checks that a Verified: line exists, not what it says. Verified: lint=pass tests=FAIL and Verified: banana both pass enforce, so treat the gate as a reminder and a record, not security.
Rules for flaky tests
The article says flaky tests teach an agent to rerun instead of fixing, and that the agent cannot skip a flaky test, add sleeps or retry until it passes. If the root cause can’t be found, the article says the test is deleted with the reason written down.
You can write that as three lines in your agent instructions:
- Never skip or mark a test as expected to fail to get a green run.
- Never add a sleep or a retry wrapper around a test.
- If you cannot find the root cause, stop and say so. Deleting the test is a human decision, and the reason goes in the commit message.
The third line differs from the article, which lets the agent delete the test. We’d rather you make that call yourself. That’s our preference, not a claim about what works better.
The demo’s retry loop re-runs failed checks after a fix between rounds. It is not a way to retry a flaky test until it passes.
A short checklist triggered by the diff
The article’s checklist has 39 items, each with a trigger you can read from the diff, a check, and the incidents behind it. Its example is a trigger about session storage or message types changing, with a check on whether old stored data still loads. The agent reads the diff and checks only the items whose triggers match.
You don’t have 39 incidents, and that is fine. Start with five to eight items from bugs you’ve actually hit. A starter file might look like this (an example of the format only):
trigger: a database schema or stored file format changes
check: does data saved by the previous version still load?
trigger: a dependency version changes in a lockfile
check: did the verify script run with a clean install?
trigger: a prompt or system message changes
check: was the small eval set re-run?
That last item pairs well with our posts on building a 30 case eval set and on prompt regression gates in CI. If you are unsure which risky actions your agent should even be allowed to take, agent tool risk classes is a good companion read.
Each time something slips through, add one item. The article says a pattern must show up in at least two pull requests before it becomes a rule. That is a sensible bar for a team. For one person, one painful incident may be enough.
Prune on a schedule
The article says test suites, verification steps and markdown files only grow if you let them, so the team tidies them on a routine. Put a monthly reminder in your calendar. For each check and checklist item, ask whether it has caught anything. Delete the ones that have not. If a check is slow, ask whether it belongs in the cheap tier at all.
Run the demo
Download verify_gate.py and the README (zip). The zip holds verify_gate.py, a README and a blank verification_scorecard.csv. It uses only the Python standard library, makes no network calls and calls no model. It’s a teaching sketch, not their tool.
In short: run retries failing checks for up to three rounds and then exits with code 3 (escalate to a human), writes a stamp, and refuses a check config that the change edited. gate has off, observe and enforce modes, and enforce lets the next commit through after two blocks.
We unzipped it into a fresh folder and ran it with python3 -I against a throwaway git repo in a temp directory. A tiny app.py, one unit test and a check file were committed on main, then a branch changed the code. This is sample output, trimmed to the lines that matter. Your timings and paths will differ, and the “agent fix” in scenario 4 is a stand-in command, not a model.
--- 1. clean change, config read from base ref
config: main:.verify/checks.json (read from the base ref, not the working tree)
round 1 lint pass
round 1 tests pass
stamp line (add to your commit message): Verified: lint=pass tests=pass
exit=0
--- 2. broken change that also weakens the check file
REFUSED: .verify/checks.json is part of the change being checked (diff vs main).
A change must not edit its own judge. Use --config-ref main --config-path .verify/checks.json.
exit=4
--- 3. same change, config from base ref: 3 rounds then escalate
round 1 tests FAIL
round 2 tests FAIL
round 3 tests FAIL
stamp line (add to your commit message): Verified: lint=pass tests=fail
ESCALATE TO A HUMAN: tests still failing after 3 rounds.
exit=3
--- 4. fix-cmd stands in for the agent fixing code between rounds
round 1 tests FAIL
round 2 tests pass
stamp line (add to your commit message): Verified: lint=pass tests=pass
exit=0
--- 5. gate, no stamp
gate: observe, WOULD BLOCK (no Verified: line), commit allowed
gate: enforce, BLOCKED (no Verified: line), block 1 of 2
gate: enforce, BLOCKED (no Verified: line), block 2 of 2
gate: enforce, already blocked 2 times this session, letting this one through
exit=0
In scenario 2 the branch had swapped the check file for one that always passes, and the tool refused to trust it. In scenario 3 it ran the original checks from main and the broken code failed all three rounds.
What the demo doesn’t do: it doesn’t protect test files (edit tests/test_app.py to a no op and the checks still pass), it doesn’t check that a stamp matches the exact commit, it doesn’t run your app, and the gate’s “session” is just a state file you manage. It also reads the stamp from the commit message, so an agent that types a fake Verified: line would pass. Treat the stamp as a record, not proof. A stronger version would have the gate re-run the checks itself.
Verification scorecard
Here’s a blank template, not results. Copy it into the verification_scorecard.csv from the zip (or a spreadsheet) and fill in one row per change you ship, using your own runs. We haven’t filled any of it in.
date,change,cheap_checks_ran,app_run,rounds_used,escalated,stamp,gate_mode,gate_result,reverted_later,notes
,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
After a month, two columns are worth a look: how many rows have a stamp of “none”, and how many ended up reverted. The article says its team tracks reverts to judge its reviewers, and this is a small version of that. If you want a bigger test set built from your own requests, see making your own benchmark from your logs.
FAQ
Do you need Claude Code to use this?
No. The demo is a plain Python script and git. The ideas (run the change, cap retries, keep the judge out of the diff, stamp commits) work with any coding agent, or with none.
Is three rounds the right retry cap?
It is the number the article says the team uses, so we copied it. We haven’t tested other values. Watch how often it escalates and adjust.
What parts of the article need a team?
The 39 item checklist, evaluating reviewers on reverts and recall, and human approval of rules in a pull request all assume history and more than one person. Solo, do the smaller versions: a short checklist, a scorecard and a weekly reread of your rules.
Can an agent cheat the stamp?
Yes, in our demo. The gate only reads a text line, so a made up Verified: line passes. The article doesn’t say how the team prevents forged stamps. A safer version would re-run the checks inside the gate.
Why read the check config from the base branch?
The article says that if a change can modify the check that judges it, the check is broken. Reading the config from your main branch stops a change rewriting the list of checks. It doesn’t protect the tests themselves: test files and app code stay in the diff and need review (in our demo, editing tests/test_app.py to a no op still passes). Consider protecting tests/ too, for example by requiring a separate review for any edit under it. The demo refuses to run if the config file is in the diff.
Should I start the gate in enforce mode?
The article says the team starts new gates in observe mode, logging what would be blocked so false positives show up first. We’d do the same, then move to enforce once the log looks right, keeping the two block escape hatch.
Where to go next
- Read the source: How the Claude Code team thinks about verification (checked 2026-11-16).
- Decide what your agent may do before it runs: Agent Tool Risk Classes: Read, Write and Irreversible.
- Add a spending and loop limit: Agent Kill Switch: A Budget and Loop Guard in Python.
- Build the eval that your checklist can point at: Build a 30-Case Eval Set in One Evening (And Run It Three Times).
- Gate prompt changes in CI: Does Your Prompt Change Break Anything? Regression Gates.


