How the Claude Code Team Thinks About Verification: E2E, Property, and Differential Tests

The Claude Code team says roughly 90% of its code is written and reviewed by Claude, and that verification loops — not better prompting — are what let it run dozens or hundreds of agents in parallel instead of one or two. The team's stated position is that giving an agent a way to prove its work with evidence is the building block of delegation, and that the verification layer itself must be treated like any other system: kept out of reach of the changes it judges, graded against real bugs, and pruned regularly.

Verification loops are what make parallel agents possible

Without verification loops, an engineer can realistically supervise only one or two Claude instances at a time because every output has to be checked by hand. With them, the team reports running dozens or hundreds in parallel.

The team cites internal testing on structured file generation in which a separate grader checked Claude's work against a rubric and improved task success by up to 10 points over a standard prompting loop, with the largest gains on the hardest problems.

The economics changed because verification artifacts are now cheap to generate. Tests, benchmarks, and specs that were once expensive to write can be requested from an agent, and once generated they run as software — so they can be executed frequently without consuming many additional tokens. The loop can also be closed back into the agent's configuration: if an agent repeatedly fails a test that checks logs for user data, the team recommends creating a hook or a more explicit rule in CLAUDE.md so the issue does not recur.

Three test types worth investing in

The article names three failure modes to avoid before naming the tests. Flaky tests train the agent to re-run them rather than fix the failing code. Slow tests push the agent to batch fewer checks, which makes pinpointing issues harder. Heavier tests are best deployed before changes are committed.

End-to-end tests are the highest-value single investment

If a team focuses on only one test type, the Claude Code team recommends end-to-end tests. E2E tests describe real user flows such as adding an item to a cart, checking out, and reaching a confirmation page.

The stated reason is that E2E tests are difficult to fool: either the whole feature works or it does not, they have definitive done criteria, and they can concretely identify what is broken. Unit tests are faster and less flaky, but they can pass while the feature is broken because neither the agent nor the test understands the full task.

The team's illustration contrasts a unit test failure that reports only Error: Timeout after 30s with an E2E failure that reports a step trace (Register, Add item to cart, Checkout failed, See confirmation page not reached), a screenshot of the checkout page showing a disabled "Place order" button, and the diagnosis that the button stayed disabled because the payment form never loaded.

To give agents hands and eyes on a running system, the team suggests a skill that boots, drives, and inspects the app using tools such as the Chrome DevTools Protocol (CDP), simulators, or API harnesses. A feature map can serve as both guide and grading rubric because it typically lists features from the user's point of view with paths, keyboard shortcuts, selectors, and expected results.

Property tests catch the edge cases agents miss

Property tests target edge cases that people tend to overlook, which the team identifies as a common failure point for agents. The method is to write a statement believed to be unfalsifiable, then use a property-testing library to generate thousands of inputs that attempt to disprove it. The article names fast-check for JavaScript and TypeScript, Hypothesis for Python, and proptest for Rust.

The team lists four property categories that appear in nearly every project:

  • Round-trip encoding: if you encode X and then decode it, you get X back. This also applies to parsing and serialization.
  • Invariants: things that must always hold, such as an account balance never becoming negative.
  • Idempotency: performing an action such as a migration, normalization, or retry twice has the same effect as performing it once.
  • Equivalence: optimized code produces the same result as naive but correct code.

Property libraries are described as a way to keep agents honest by generating edge cases without the same bias as the agent that wrote the original code. They are also called out as particularly useful during rewrites, when the spec has drifted from production behavior and is no longer a reliable verification source.

Differential tests use the old system as the oracle

Differential tests are most effective for large-scale migrations where functionality is expected to stay the same. Both the old and new systems run on identical inputs, and any difference in output indicates a bug or breaking change.

The team's guidance is to feed the comparison randomly generated inputs or a sample of production traffic, normalize irrelevant factors such as whitespace, and maintain a list of approved changes for cases where the new environment is supposed to differ from the old one.

How the Claude Code team verifies its own changes

Verification means running the change, not just passing tests

Running the app end to end matters more than tests. The team's analogy is that nobody would ship an iOS change without trying it in a simulator, and the same standard applies to Claude. Claude can exercise the whole app the way a human or QA engineer would: the Claude Chrome extension for web changes, an iOS or Android MCP for mobile, computer use for desktop, or running the service locally for backend work.

To codify this, the team creates a skill called verify, placed in a .claude/skills/ folder in the repository as close to the relevant code as possible, with as many instances as needed. Claude knows to use the verify skill before committing changes. The team advises investing in making the verify skill fast and reliable by having Claude iterate on and stress-test it, because it functions as the smoke-test harness. The article states this is how nearly all changes at Anthropic are tested.

Failing tests require human attention

Because nobody can read every change, the team uses failures as one signal for what needs a person. Claude runs the checks and attempts to fix anything that fails. If a check is still failing after three rounds, Claude stops and brings in a human.

Code owners write their own checks

The people who own a piece of code write the checks for it and refine them until the checks flag what the owner would flag. When a check pulls in a reviewer, it should state why, so the reviewer does not have to reconstruct the reason from the diff.

Reliability checks trigger on the diff

The team maintains a reliability checklist of 39 items. Each item has a trigger that can be read from a diff, a check, and the incidents or pull requests behind it. One example item is --resume loads old transcripts: when session storage or message types change, the reviewer asks whether a new field loads safely, since older transcripts will not contain it. Claude reads the diff and runs only the items whose trigger matches — usually 3 to 10 — so nobody has to memorize past outages.

One reviewer, multiple rounds

The team does not improve reviews by stacking reviewers. Adding a second, more expensive reviewer on top of the primary one is described as often worse than tuning the primary reviewer. Instead, a REVIEW.md file specifies what the reviewer should pay attention to for that code. Review and verification rounds are designed to build on each other: each pass is pointed at context from earlier rounds and past failures rather than re-checking everything from scratch, which the team says is cheaper and finds more.

Changes cannot modify their own checks

If a change can modify the check that judges it, the check is broken. Code Review reads REVIEW.md from the base or default branch, never from the pull request's changes, and the team ensures the rules that gate changes live on a branch the change cannot modify.

Reviews are also reserved for commits. If someone pushes while a review is running, the review result is no longer useful, because a passing review on an out-of-date commit means nothing.

Cheap checks run first. If an agent pushes before testing locally, it has consumed shared review and CI time on a bug it could have caught itself. On the Claude Code team, Claude runs the tests, build, and linter before opening a pull request, which can be enforced with a hook that runs tests when Claude finishes or a /goal of a passing test suite.

New gates should start in observe mode

In its own repositories, the team stamps each commit with how it was verified, including a none value so commits that were not verified can be queried. The team also built a commit gate that can block a commit if the session did not contain /code-review or /verify. The gate has three modes: off, observe, and enforce.

Observe mode logs what would have been blocked so the team can review false positives before anyone is affected. Enforce mode blocks the commit. A commit can carry an explanation in its message for why it was not verified, and if commits have been blocked twice in a session, the next one is allowed through so Claude does not get stuck — the article notes plainly that Claude Code is not perfect.

Test your checks against what actually matters

The team regularly reviews the reviewers. It tracks how many merged changes were reverted, how many changes a maintainer rejected before merging, and a size-matched subset of changes that have stayed clean.

The Code Review team also runs a formal evaluation built from previous incidents and reverts. For each example, the repository is recreated to the state it was in at review time, and a one-sentence answer key describes what the bug was. Only findings that correctly describe that bug earn points. Merged and stable changes serve as a control to prevent over-flagging, and the tuning set is kept separate from the fixed test set used to evaluate the system.

Recall is measured separately for raw findings, post-verification findings, and final review, so the team can see whether the system is losing bugs it had already found. The article states that any evaluation collapsing these into a single end-to-end score will miss that distinction.

Beyond validity, the team cares about importance. Code Review tags findings as Important, Nit, or Pre-existing, where the pre-existing tag means the reviewer should not hold the author responsible for a bug that already existed. Recall is tuned upward only to the point where the next improvement would be overfitting to the evaluation rather than catching real bugs.

Turn misses into rules

The Claude Code repository uses two methods to convert missed cases into rules. The first extracts patterns from human code review comments and PR reverts to identify common issues. A candidate rule must occur in at least two pull requests and be identifiable from a diff. Three agents then attempt to disprove it, and a human reviews and approves it in a pull request.

The second method replays three bug finders against a pull request associated with a known incident. If at least two of them find the bug, it is classified as a detectable bug. If the bug is missed on a small diff, that gap is considered worth turning into a rule in REVIEW.md.

Flaky tests receive the same treatment. Claude cannot skip them, add sleeps, or retry until they pass. If it cannot find the root cause, it deletes the test and writes down why.

Rules require cleanup too. Test suites, verification steps, and Markdown files only grow if left alone, so the team tidies them on a routine basis.

What Hacker News commenters pushed back on

The 275-point discussion was sharply divided. Several commenters argued the described workflow is expensive relative to deterministic alternatives, while others reported that the same workflow already works for them in production.

Deterministic tools may beat token-burning verification

The most detailed critique was that the article reflects having unlimited tokens available. Commenter OtherShrezzing argued that Playwright achieves equal quality with deterministic results and near-zero marginal cost:

This article feels like the result of having unlimited tokens at your disposal. It's got some very expensive practices, where near-free practices would produce the same or better results. There's a long section in the middle where the article describes per-change verification via skill files and "ask Claude to use the chrome-for-Claude tool" when checking if changes have introduced regressions. But there's already tools which do this without spending tokens tokens. Playwright will achieve equal quality but deterministic results across the same verification attempts. It is write-once-use-often, so has a marginal cost near zero.

Commenter girvo raised the same cost concern from the opposite direction, noting that running dozens or hundreds of parallel agents is not reachable for most users:

With them, you can run dozens or hundreds in parallel. Im already spending my $2k usd per month in tokens with just one or two agents. How do they expect me to do that?

Commenter jwpapi described the same tension in evaluation rather than verification: more verification means more test runs, and running evals gets expensive quickly. That commenter added that UX and agent workflows are the parts that remain hardest to verify.

Commenter Narann framed the expense as a prototyping cost that should be amortized into cheaper artifacts:

The more I read articles like this, the more I realize Claude is good for process prototyping, but you need to "bake" the process with flat code/script/organization to decrease costs.

Human review of every diff may still be feasible

Commenter koolba disputed the article's premise that nobody can read every change, arguing it is a project-level choice:

Whether a human can or should review every diff is a conscious project level decision. I have yet to see a project where it is not feasible. The trick is to break things into small enough pieces that you can review them. Just like one would do if you were doing such changes manually. Nobody in their right mind performs non-mechanical changes of 100s of files.

Tests written by the same agent can agree with its bugs

Commenter d-sanoj reported a concrete failure of self-generated verification: an agent wrote a feature and its tests, and the tests passed while the feature was wrong, because the tests agreed with the bugs. This is the failure mode the article's property-test and differential-test sections are designed to counter, since both generate expectations independently of the code under test.

Flaky tests deserve root-cause analysis, not deletion

Commenter FartyMcFarter pushed back on the article's instruction to delete a flaky test when the root cause cannot be found:

If the tests are hermetic, you should always be able to find the root cause (by bisecting to determine when the test became flaky). If the tests are not hermetic, it should still be possible to identify the dependency that is making them flaky, and use that as a justification if it still makes sense to delete the test.

There is no deterministic verification for architecture

Commenter hliyan argued that stochastic output can only be truly verified by a deterministic process, and that the tooling stops short of whole-program structure:

Tests already do this for functional accuracy. Linters can do this for line-level code, with code treated as text. But there is currently no such method of deterministic verification for the structure of the entire program, or more importantly the viability of the architecture when you throw in connectivity and IOPS. Perhaps we need a level above linters: a tool that constructs the abstract syntax tree and verifies its various branches against deterministic rules. How to do this for architecture: unsure.

E2E suites are too slow for agent loops

Commenter holoduke identified test runtime as the practical bottleneck for the article's central recommendation:

What we need are ultra fast testing suites. Specially e2e tests are notoriously slow. Runtime is big and its often difficult to isolate just a few tests. I want 1000 e2e tests in a few seconds instead of 10 minutes. It's also a mayor blocker for an agent that cannot work fast because of the constant waiting.

Some practitioners report the workflow already works

Commenter VadimPR was surprised by the negative tone and reported that the article matches a workflow already in production use:

I've shipped quality software thanks to Claude, with a lot of features, bugfixes and performance improvements at velocity that is incomparable to doing it without an AI that has the stakeholders VERY happy. The QA workflow I worked out is pretty much mirrored in this article, so speaking from the real world, this is the advice to follow.

Commenter gregwebs reported a similar shift in trust after building a verification skill, while noting the cost:

After I created this skill for verification, it completely changed my level of trust with AI coding. ... It does use a lot more time and AI spend than just asking AI to do something. I still do the latter for simple or noncritical changes. I had to switch to using DeepSeek as my workhorse to keep down my spend.

Commenter jeffybefffy519 raised a counterpoint about where the burden moves when humans leave the loop, arguing that end-to-end agent development places more emphasis on manual user acceptance testing and that dropping quality steps produces regressions.

The takeaway

The Claude Code team's position is that the verification layer is a system in its own right and should be engineered as one: keep checks out of reach of the changes they judge, grade them against bugs that actually mattered, write down lessons when they miss something, and prune those lessons so they stay worth running. The payoff the team describes is a shift in the engineer's job from reading every diff to defining what "done" looks like and reviewing the evidence — which is what makes running many Claudes at once possible. The Hacker News discussion adds the counterweight: deterministic tools such as Playwright may deliver comparable verification at near-zero marginal cost, E2E suites are often too slow for tight agent loops, and tests generated by the same agent that wrote the code can pass while the feature is broken.

Sources

Related

  • Dispatch
  • Project
  • Dispatch
  • Dispatch
  • Dispatch