
For two weeks, Anthropic let Claude run continuously in a staging environment, load testing infrastructure and fixing what it found broken. Anthropic also uses verification loops to check software written with Claude Code, helping catch problems before changes are merged. As Ray Amjad reports, these loops can pass a builder’s work to review and verification agents, which check the behavior a change is meant to produce. You’ll see how separate sandboxes let agents check user flows in parallel, and learn why the verifier itself needs checking.
Claude Code: How Verification Loops Check Its Work
TL;DR Key Takeaways :
- A builder can pass changes through a review agent and verifier up to three times, fixing issues between checks.
- End-to-end verification checks user-facing flows in three stages: setup, driving the application, and checking the results.
- Separate sandboxes let agents verify 15 user flows in parallel without competing for database state.
- Anthropic says Claude ran continuously in a staging environment for two weeks, load testing infrastructure and fixing broken components.
- Anthropic’s 39-item reliability checklist triggers targeted verification when a change matches a condition drawn from past incidents.
Claude Code is Anthropic’s coding agent. It can read a codebase, edit files and run commands. When an agent writes and reviews much of a project’s code, you also need to check whether its changes work and whether later changes break them.
Anthropic describes verification loops as a building block for delegating more work to Claude. Without a verifier, the company says, a developer can run only one or two Claudes at a time before personally checking each change becomes the bottleneck.
Put a Verifier in the Build Loop
A verification loop gives a coding agent feedback it can use before a change is merged. A builder can pass its work to a review agent and a verifier, fix the issues they find, then repeat the check.
One setup loops a builder through a review agent and a verifier up to three times. Boris Cherny, who created Claude Code, has said that giving Claude a way to verify its own work can improve the quality of the final result by two to three times.
A check needs to do more than confirm that code runs without an error. It also needs to examine the behavior the change is meant to produce and, over time, catch regressions when another change touches the same code.
Deep dive into the latest in verifying and using Claude Code by exploring our other resources and articles.
- Anthropic Launches Claude Code Review Preview for Team & Enterprise
- Master Anthropic’s Claude Code : Tools, Hooks & User Commands in One Guide
- 6 Claude Code Levels Explained : Map Skills from Prompts to Agent Teams
- 15 Claude Code Tricks For Persistent Context, Projects, Lower Costs and More
Check Changes Where Users Encounter Them
End-to-end verification checks a flow at the surface where a person or another system uses the application. That surface might be a web page, an API, a command-line interface or a mobile app.
Anthropic’s advice is that if you focus on one type of test, it should be end-to-end. Without a surface-level check, an agent may choose an easier unit test or endpoint call and report the change as verified without exercising the full flow.
A verification skill can include shortcuts, such as quickly creating an account, and divide the work into three stages:
- Setup: Launch the application and put its database in the state needed for the flow.
- Driving: Interact with the application through the same surface a user would use.
- Checking: Inspect the result and confirm that the driving agent followed the intended steps.
For an organization transfer, a setup agent could create the organizations and users, using skills or shortcuts to prepare the database. A driving agent could then send and accept the transfer through the interface, while a checker could confirm that the driver clicked the real buttons rather than bypassing them with a JavaScript tool.
A passing flow can still contain defects. In Ray Amjad’s demonstration on an app of his own, a bug bash found no critical issues but four high, 23 medium and 41 low, including accessibility, contrast and one-time-password pasting problems. In another check, an agent completed the creation flow it was asked to verify but reported six things that looked or felt off, including a cancel button that did not clear a dialog. It also reported things it could not prove for itself.
Use Sandboxes to Run Flows in Parallel
A sandbox template can contain the application and dependencies needed for verification, so an agent does not have to assemble the environment from scratch for each flow. A project using Postgres and Redis, for example, may also need Playwright and other tools for browser verification.
Separate sandboxes can let agents check different flows at the same time without competing for the same database state. For a feature with 15 user flows, one approach is to launch 15 prepared sandboxes and send their findings back to the builder for fixes.
Running those checks in one sandbox could cause agents to conflict over Postgres and Redis. The 15 agents would need roughly 15 Postgres instances, more than one sandbox can reasonably hold. Running checks in sequence avoids that conflict, but requires resetting the state between flows and can take much longer.
An agent also needs access to the surface it is checking. Without its own Slack account, for example, an agent cannot exercise a Slack integration end to end as a user would. It may fall back on a unit or integration test that gives less confidence.
Give Agents a Private Cloud for Stress Tests
A private cloud can give verification agents resources beyond their initial sandbox. In one setup, agents have Cloudflare and AWS accounts with a budget cap, which they can use to create buckets, deploy AWS Lambda functions and rent GPUs.
Those resources also let agents host parts of a service on AWS and send traffic to them for stress testing. Anthropic says it gave Claude its own staging environment, where it ran continuously for two weeks, load tested every part of the infrastructure and fixed what it found broken.
Access and verification needs differ by domain. An agent checking an integration may need its own identity and workspace, while a stress test needs infrastructure on which the relevant service can run.
Check the Checker and Preserve Working Behavior
A verifier’s own instructions need scrutiny: a faulty skill can let real bugs through or block clean code. Anthropic recommends treating the verification layer like any other system, rather than setting it up once and leaving it unchanged.
One approach is to plant bugs in pull requests and see whether the verification skill catches them. Ray Amjad tried this on 15 pull requests, and the resulting report showed the skill getting some calls right and others only partly right. Another proposed step is to repeat previous pull requests weekly and report possible improvements.
A successful check today does not guarantee that a flow will survive a later change. The traditional testing pyramid has many unit tests, fewer integration tests and still fewer end-to-end tests.
Traditional end-to-end tests can help guard against regressions, though a Playwright test tied to a page layout can fail after the layout changes even when the underlying flow still works. Such tests typically navigate pages, click selectors and use timed waits. Agentic end-to-end tests can combine agent-driven steps with deterministic ones and run selected checks when a later pull request affects them, though the setups can grow more complex over time.
Turn Incidents Into Targeted Checks
Anthropic compiled a 39-item reliability checklist from previous incidents. Claude reads a change’s diff and runs an extra verification step when the change matches an item’s trigger, rather than running every checklist item every time.
One item followed a change to how Claude Code stored sessions, which stopped users from resuming a previous session. After a quick fix, Anthropic added a check for session resumption whenever session storage changes.
The same principle applies when a defect reaches a user despite earlier checks: fix the defect, then examine what the verification instructions missed.
In our view, the most useful idea is splitting the builder from the judge. A model marking its own homework is the weak point, so a separate verifier that is itself watched over time is what makes more delegation reasonable.
Checks drawn from past incidents can give you a record of behavior to protect as your application changes. For anyone using Claude Code to build software, verification loops are worth exploring in more detail as a way to check changes and guard against regressions.
Media Credit: Ray Amjad
Disclosure: Some of our articles include affiliate links. If you buy something through one of these links, Geeky Gadgets may earn an affiliate commission. Learn about our Disclosure Policy.