How the Claude Code team verifies AI-written code
Brief
Anthropic’s Claude Code team shares how it uses evidence-based checks to review code written by coding agents and catch failures without manually inspecting every change.
Tests that give agents evidence
- Use end-to-end tests to exercise real user flows; property tests to probe edge cases and invariants; and differential tests to compare old and new systems on the same inputs.
- Keep tests fast and reliable: flaky or slow checks can lead agents to retry rather than fix problems, or run fewer checks.
A verification workflow
- Give Claude a
verifyskill for running and inspecting the app, and run tests, builds and linters before opening a pull request. - Claude attempts to fix failed checks; if a check still fails after three rounds, it stops and asks a human to review.
- Keep rules that gate changes on a branch the changes cannot modify; start new commit gates in observe mode to check for false positives before enforcement.
Check whether the checks work
- Evaluate reviewers against past incidents and reverts, and track merged changes later reverted as well as changes rejected by maintainers before merging.
- Turn repeated, diff-detectable review misses into proposed rules, have agents try to disprove them, and get human approval.
Generated by AI from the original article. Check the source for full details.