Harness Engineering 6 months ahead, in a few hours.

Claude Code verification: how Anthropic checks Claude's code

Thomas Poulain ·

Anthropic’s Claude Code team has Claude write and review about 90% of its code. Before each commit, Claude starts the app and tries its change the way a tester would. After three failed rounds, it calls in a human. A change can’t touch the rules that judge it. You can copy most of this in your own repo.

Why does the Claude Code team invest in verification?

A verification loop lets you hand Claude far more work. Addy Osmani explains why in a post published on November 16, 2026, on claude.dev, Anthropic’s developer blog.

In that loop, Claude keeps fixing its work until a check passes. Checking every result yourself limits you to one or two Claudes at once. According to the post, a loop lets you run dozens of them in parallel.

An internal Anthropic test backs this up. A separate grader scored structured files produced by Claude against a rubric. Compared with a standard prompting loop, the success rate climbed by up to 10 points, mostly on the hardest tasks.

How does the Claude Code team verify each change?

Claude starts the app and uses it like a tester, before every commit. It drives Chrome through the Claude extension for web changes, and an iOS or Android MCP server for mobile.

The launch recipe lives in a skill named verify, stored in .claude/skills/. Claude knows to run it before committing, so the team keeps it fast and reliable.

If a check still fails after three rounds of fixes, Claude stops and calls in a human. No one can review everything by hand, so failures help decide where a person looks.

The owners of each area of the code write its checks themselves. A check that pulls in a reviewer has to explain the reason.

A reliability checklist, built from past incidents, adds to this. Each item fires on a pattern you can spot in the diff, meaning the changed lines. Claude only goes through the items that fire.

Which tests help Claude verify its code?

The post puts end-to-end tests first, then property tests and differential tests. It also flags two traps. A flaky test, one that fails at random, teaches Claude to rerun instead of fix. A slow test means fewer checks get run.

End-to-end tests (E2E) replay a real user flow, such as filling a cart and checking out. They’re hard to fool. When one fails, it shows the broken step with a screenshot.

Property tests start from a rule that should always hold. For example, decoding an encoded value should give back the original. A library such as fast-check, Hypothesis or proptest then generates thousands of inputs to break it. Those inputs don’t share the blind spots of the agent that wrote the code.

Differential tests run the old and the new system on the same inputs, then compare the outputs. They’re most useful for large migrations, fed with random inputs or sampled production traffic.

How does the team review Claude’s code?

The team relies on one reviewer and tunes it carefully. According to the post, adding a second, pricier reviewer often does worse than tuning the first one. A REVIEW.md file tells the reviewer what to focus on.

Each review round starts from earlier rounds and past failures. That costs less than rechecking everything, and it catches more bugs.

The team also grades its reviewers, for instance by counting merged changes that later got reverted.

Every missed bug can turn into a rule. A human review comment that shows up in at least two pull requests (PRs) becomes a candidate rule. A human then approves it.

Flaky tests have their own rule. Claude isn’t allowed to skip them, pad them with sleeps or rerun them until they go green. When it can’t find the cause, it removes the test and records the reason.

How does the team protect its checks?

It keeps them beyond the reach of any change they judge. As the post puts it, “If a change can modify the check that judges it, the check is broken.”

So the Code Review service reads REVIEW.md from the PR’s base branch or the default branch. It ignores the PR’s own copy. The base branch is the one the PR will merge into, often main.

A review also only counts for the exact commit it read. Code pushed while it runs makes the result stale.

Claude runs the tests, the build and the linter locally before it opens a PR. That spares review time and CI, the continuous integration checks a server runs on each push.

An internal gate also blocks any commit from a session that ran neither /code-review nor /verify. It has an observe mode that logs what it would have blocked, without blocking anything.

What can you copy in your own repository?

You can copy most of it with documented Claude Code features. The commit gate and the reliability checklist stay internal to the team.

Have Claude test your app. The bundled /verify skill builds and runs your app to check a change. Without a recorded recipe, it saves what worked to .claude/skills/verify/SKILL.md. If that file exists when a session starts, Claude is told to run it before each commit. Changes to docs or tests are exempt. This needs Claude Code v2.1.286 or later.

Make tests pass before Claude stops. A Stop hook fires when Claude finishes responding. If it runs your tests and exits with code 2 on failure, Claude goes back to work. For a single session, the /goal command does the same with a written condition.

/goal all tests in test/auth pass and no test file is modified

Keep your rules out of reach. If you use the Code Review service, on Team and Enterprise plans, write your instructions in REVIEW.md and merge it. Then protect your default branch, as the REVIEW.md docs ask.

On your machine, a PreToolUse hook can refuse edits to protected files, such as your tests. With "onFailure": "block", a broken hook blocks the action instead of letting it through. Claude can still edit those files through the shell, so this hook adds to the protected branch. The post on failing hooks shows the config.

Get a review before merging. On any plan, /code-review reviews your branch and follows your CLAUDE.md. On Team and Enterprise, the Code Review service also reviews your GitHub PRs. It tags its findings as Important, Nit or Pre-existing. The code review post compares both.

Tell Claude when to hand over. Put the three-rounds rule and the flaky-test rule in your CLAUDE.md.

## Verification
- If a check still fails after three fix attempts, stop and explain what's blocking you.
- Never skip a flaky test. Don't add sleeps, and don't rerun it until it passes.

For a new blocking guard, let it log what it would have blocked first. Review the false positives, then turn blocking on. Claude Approvals follows the same path with its observe mode, covered in the Claude Ship post.


Module 10, Team collaboration, shows how to write the team CLAUDE.md that reviews also read. Module 5, Hooks and automation, covers the Stop and PreToolUse hooks.

To see these articles more often on Google, add Harness Engineering to your preferred sources.

You might also like