Claude Code's #1 Tip: Verification Loops for 2-3x Quality.

10 min read
By Houston IT Developers
Automated code verification and testing workflow showing quality improvement process

Quick Answer: Boris Cherny, creator of Claude Code, calls verification loops "probably the most important thing" for getting great results. By giving Claude a way to verify its own work—through browser testing, running unit tests, or checking output—you can improve the quality of generated code by 2-3x. This feedback mechanism transforms AI from a code generator into a self-correcting development partner.

When the creator of Claude Code reveals his single most important tip, developers should listen. Boris Cherny's insight isn't about prompting techniques or model selection—it's about feedback loops.

"Probably the most important thing to get great results out of Claude Code: give Claude a way to verify its work. If Claude has that feedback loop, it will 2-3x the quality of the final result." — Boris Cherny

Here's what verification loops are, why they're so powerful, and how to implement them in your own workflow.

Watch: Claude Code Plan Mode & Verification in Action

Peter Yang demonstrates using Plan Mode at 7:37—the same verification approach Boris Cherny recommends to ensure Claude gets it right before writing code.

What Are Verification Loops?

A verification loop is any mechanism that allows AI to check whether its output actually works. Instead of generating code and hoping for the best, the AI:

  1. Generates code
  2. Verifies the result
  3. Identifies issues
  4. Iterates until verified

This mirrors how experienced developers work—write code, test it, fix issues, repeat. The difference is that AI can do this cycle automatically.

The Problem Without Verification

Without verification loops, AI coding follows this pattern:

Developer: "Build a login form"
AI: [Generates code]
Developer: [Tests manually, finds bugs]
Developer: "Fix this bug..."
AI: [Generates fix]
Developer: [Tests again, finds more bugs]
[Cycle continues...]

The human becomes the verification mechanism. Every bug requires manual discovery and reporting.

The Power of Verification Loops

With verification loops:

Developer: "Build a login form and verify it works"
AI: [Generates code]
AI: [Opens browser, tests login flow]
AI: [Finds issue with validation]
AI: [Fixes issue, tests again]
AI: [Confirms working]
Developer: [Reviews completed, tested feature]

The AI handles the iterative testing cycle, delivering verified results.

How Cherny Tests Every Single Change

"Claude tests every single change I land to claude.ai/code using the Claude Chrome extension. It opens a browser, tests the UI, and iterates until the code works and the UX feels good." — Boris Cherny

Cherny's workflow is remarkably thorough. Before any code gets merged:

  1. Claude makes the change
  2. Claude opens a browser
  3. Claude tests the actual UI
  4. Claude evaluates the user experience
  5. Claude iterates if needed
  6. Only then does Claude report completion

This isn't just checking if code compiles—it's verifying the end-to-end user experience.

The Browser Testing Approach

For frontend work, browser-based verification is powerful:

Verification StepWhat It Catches
Page loadsImport errors, build failures
Elements renderComponent bugs, styling issues
Interactions workEvent handling, state management
User flow completesIntegration issues, edge cases
UX feels rightUsability problems, rough edges

Each layer catches issues that earlier layers might miss.

The 2-3x Quality Improvement

Cherny's claim is bold: verification loops improve quality by 2-3x. Where does this improvement come from?

Source 1: Catching Obvious Errors

AI sometimes generates code with simple errors—typos, wrong imports, syntax issues. With verification, these are caught and fixed automatically.

Without verification: Developer finds error, reports to AI, waits for fix With verification: AI finds and fixes before reporting completion

Source 2: Discovering Edge Cases

Testing reveals edge cases that neither the developer nor AI anticipated:

  • What happens with empty input?
  • What about very long strings?
  • How does it handle network errors?
  • What if the user clicks rapidly?

Verification loops surface these issues during development, not production.

Source 3: Iterative Refinement

The first attempt is rarely perfect. Verification enables refinement:

  1. Initial implementation: 70% correct
  2. After first verification: 85% correct
  3. After second verification: 95% correct
  4. After third verification: 99% correct

Each cycle catches remaining issues, approaching production quality.

Source 4: UX Improvements

Cherny specifically mentions UX: "iterates until the code works and the UX feels good."

Verification isn't just functional testing—it's quality evaluation:

  • Is the loading state smooth?
  • Does the error message make sense?
  • Is the layout responsive?
  • Does the animation feel right?

Quality improvement through iterative testing showing 2-3x improvement metrics with feedback loops
Quality improvement through iterative testing showing 2-3x improvement metrics with feedback loops

Types of Verification Loops

Browser testing is one approach, but verification loops come in many forms:

1. Unit Test Verification

Verification: Run unit tests after changes
What it catches: Logic errors, regressions, edge cases
Best for: Backend code, utilities, business logic

Workflow:

  • AI writes/modifies code
  • AI runs relevant tests
  • If tests fail, AI fixes and re-runs
  • Only reports completion when tests pass

2. Integration Test Verification

Verification: Run integration tests
What it catches: API issues, database problems, service interactions
Best for: APIs, database operations, external services

3. Browser/UI Verification

Verification: Open browser, interact with UI
What it catches: Rendering issues, UX problems, flow bugs
Best for: Frontend code, user-facing features

4. Type Check Verification

Verification: Run TypeScript/type checker
What it catches: Type errors, missing properties, wrong arguments
Best for: TypeScript projects, strongly-typed code

5. Lint Verification

Verification: Run linter after changes
What it catches: Style issues, potential bugs, anti-patterns
Best for: All code, maintaining consistency

6. Build Verification

Verification: Run build process
What it catches: Import errors, compilation issues, bundling problems
Best for: Any compiled/bundled project

Combining Multiple Verifications

The most robust approach combines several:

After each code change:
1. Run type checker → Fix type errors
2. Run linter → Fix style issues
3. Run unit tests → Fix logic errors
4. Run integration tests → Fix integration issues
5. Test in browser → Fix UX issues

Each layer catches different issues, maximizing quality.

Setting Up Browser-Based Verification

Cherny's browser verification is particularly powerful for frontend development. Here's how to implement it:

Using Claude's Built-in Browser Tool

Claude Code can interact with browsers through its tool system:

  1. Launch browser: Open your development server
  2. Navigate: Go to the page being modified
  3. Interact: Click buttons, fill forms, test flows
  4. Evaluate: Check if behavior matches expectations
  5. Screenshot: Capture visual state for analysis

Example Verification Prompt

When requesting a feature, include verification:

Create a user registration form with:
- Email validation
- Password strength indicator
- Confirm password matching
- Submit button that disables during submission

After implementation, verify by:
1. Opening http://localhost:3000/register
2. Testing with invalid email (should show error)
3. Testing with weak password (should show warning)
4. Testing with mismatched passwords (should prevent submit)
5. Testing successful registration flow

The explicit verification steps guide Claude's testing.

Automated Verification Hooks

For recurring verification, set up hooks:

{
  "hooks": {
    "PostToolUse": {
      "command": "npm run lint && npm run test"
    }
  }
}

This automatically runs linting and tests after Claude makes changes.

Building Your Own Verification Workflow

Here's a step-by-step guide to implementing verification loops:

Step 1: Identify What to Verify

For each type of work you do, identify:

  • What constitutes "working"?
  • What errors are most common?
  • What would you manually check?

Step 2: Make Verification Automatic

For each verification type, create automation:

  • Unit tests: npm test or equivalent
  • Type checking: tsc --noEmit
  • Linting: npm run lint
  • Building: npm run build
  • E2E tests: Playwright, Cypress scripts

Step 3: Include Verification in Prompts

Be explicit about verification expectations:

"After making changes, run the test suite and fix any failures before reporting completion."

"Test the feature in the browser and verify the user experience before finishing."

Step 4: Create Slash Commands

For common verification patterns, create reusable commands:

/.claude/commands/implement-with-tests.md:
Implement the requested feature, then:
1. Write comprehensive tests
2. Run all tests
3. Fix any failures
4. Verify in browser if UI changes
5. Report completion only when all checks pass

Step 5: Review Verification Results

When Claude reports completion, check:

  • Did it actually run verification?
  • What did verification reveal?
  • Were all issues addressed?

Developer workflow showing verification integration with automated testing and quality assurance systems
Developer workflow showing verification integration with automated testing and quality assurance systems

Advanced Verification Techniques

Subagents for Code Review

Cherny uses subagents—separate Claude instances—for verification:

His code review command spawns several subagents at once: One checks style guidelines, another combs through the project's history, another flags obvious bugs.

You can implement similar patterns:

For code review, spawn subagents:
1. Style checker: Verify consistency with project patterns
2. Security reviewer: Check for vulnerabilities
3. Performance analyzer: Identify potential issues
4. Test coverage: Ensure adequate testing

Adversarial Verification

Cherny also uses subagents to challenge initial findings:

He uses five more subagents specifically tasked with poking holes in the original findings.

This adversarial approach catches false positives and ensures thorough review.

Visual Regression Testing

For UI work, consider visual verification:

  • Screenshot before and after
  • Compare for unexpected changes
  • Flag visual regressions

Performance Verification

For performance-sensitive code:

  • Run benchmarks after changes
  • Compare against baselines
  • Flag regressions

Common Verification Mistakes

Mistake 1: No Verification

Simply generating code without any verification. Results in bugs discovered later.

Fix: Always include some form of verification, even basic.

Mistake 2: Verification That Can't Fail

Tests that always pass don't provide value.

Fix: Ensure verification can actually catch real issues.

Mistake 3: Ignoring Verification Failures

AI reports failures but continues anyway.

Fix: Make fixing failures mandatory before completion.

Mistake 4: Manual Verification Only

Relying on human testing defeats the purpose.

Fix: Automate verification wherever possible.

Frequently Asked Questions

Does verification slow things down?

Initially, yes. But it prevents bugs that would cost more time later. Net effect is usually faster delivery of working code.

What if tests don't exist?

Have Claude write tests as part of the feature. Verification incentivizes good test coverage.

How thorough should verification be?

Match verification depth to risk. Critical features deserve extensive verification; minor changes need basic checks.

Can Claude really test UI effectively?

Yes, particularly with browser tools. It can navigate, interact, and evaluate visual results. For complex UX judgments, human review is still valuable.

What about verification for non-coding tasks?

The principle applies broadly. For documentation, verify accuracy. For refactoring, verify behavior unchanged. Always ask: "How can we check this works?"

Bottom Line

Boris Cherny's "most important" tip is deceptively simple: give AI a way to verify its work. But the impact is profound.

Key takeaways:

  • Verification loops improve quality by 2-3x
  • AI can test its own work—browser, tests, linting
  • Make verification explicit in your prompts
  • Combine multiple verification types for best results
  • The best code is code that's been tested before you see it

Implementing verification loops transforms Claude from a code generator into a self-correcting development partner. The investment in setting up verification pays dividends on every task.


Want to implement robust AI development workflows with proper verification? Contact Houston IT Developers to learn how we help teams build effective AI-assisted development processes.

Sources:

Houston IT Developers

Houston IT Developers

Houston IT Developers is a leading software development and digital marketing agency based in Houston, Texas. We specialize in web development, mobile apps, and digital solutions.

View all posts →

Need Help With Your Project?

Our team of experts is ready to help you build your next web or mobile application. Get a free consultation today.

Get in Touch

Related Posts