Skip to content
iam.alan.abreu
← Log
HOWTO2026-11-22

A Green Test Suite Is Not a Definition of Done

How to route work across Claude Code models and make completion depend on evidence.

Three graphite and violet forms beside the question: What proves it’s done?
Topics
  • Applied AI
  • Engineering Workflows
  • Verification
Tags
  • claude-code
  • model-routing
  • testing

Evidence before completion

Imagine a checkout fix with a green test suite and a checkout that still fails. Both can be true. Unit tests might exercise the payment adapter in isolation while the browser flow still sends a request the server rejects. Before accepting the change, ask for the evidence that connects the diff to the behavior you wanted.

That is where model routing helps. You can delegate repository discovery, keep implementation in one session, and give someone else the job of reviewing the evidence. The most important decision is who can move the work forward when a check fails or has yet to run.

Give each model a job

Scout (Haiku). Relevant files and call sites, the project's documented checks, and unknowns worth resolving.

Implementer (Sonnet). An approved plan, a focused diff, and actual results from the relevant checks.

Reviewer (Opus). A verdict tied to acceptance criteria, with blockers backed by a file, an artifact, or a missing observation.

Keep the scout's assignment bounded. For example, ask it to trace the checkout request from the UI to the handler and identify the existing test covering that boundary. The implementer owns the patch and the test runs. Give the reviewer read-only access and point it at the exact diff and test artifacts it should evaluate.

Review at three decision points

1. Before editing. Review the proposed change and agree on an observable acceptance criterion. In the checkout example, a successful payment should yield an order confirmation visible to the user.

2. After the same failure twice. Pause if the same check returns the same underlying error. Preserve the commands and outputs, then ask the reviewer to identify what the next attempt would actually test. This is a workflow rule you can choose, with a threshold that suits the project.

3. Before closing. Compare the final diff and captured results with the acceptance criterion. Green unit tests are one piece of evidence. For checkout, run the user journey against a sandbox payment provider and verify the confirmation and order state.

Haiku scouts the repository, Sonnet builds and verifies, and Opus reviews without editing. Bring in the reviewer before editing, after the same failure twice, and before closing.

Start with the built-in Advisor

For a compatible Claude Code account and provider, try a one-session pairing.

claude --model sonnet --advisor opus

The Claude Code Advisor documentation covers supported providers, model pairings and billing. The feature is experimental. The main model decides when to consult the Advisor, which receives the session conversation and tool results. Treat its advice as a second opinion. Use explicit review steps and CI when the next action must depend on a recorded outcome.

Anthropic reported that Haiku with an Opus advisor moved from 19.7% to 41.2% on BrowseComp and still scored below Sonnet alone. Sonnet with an Opus advisor gained 2.7 percentage points on SWE-bench Multilingual while costing 11.9% less per task in that evaluation. These measurements are for the tested advisor setup and workloads. For your own codebase, track cost, turnaround, and changes accepted with complete evidence across comparable tasks.

Add a reviewer to the repository

Use Sonnet as the main session and create two project subagents. For a scout, use the same frontmatter pattern with name: repo-scout, model: haiku, and a body that asks for file locations, relevant commands and missing context. Here's the reviewer:

---
name: evidence-reviewer
description: Reviews a plan or patch against explicit acceptance criteria.
model: opus
tools: Read, Grep, Glob
---
Return APPROVE, BLOCK, or UNVERIFIED and explain the basis.
Check the acceptance criteria against the supplied diff and test evidence.
Identify the missing observation whenever a criterion cannot be verified.

Save it as .claude/agents/evidence-reviewer.md. The main session can explicitly invoke @agent-evidence-reviewer and pass the target diff and paths to captured outputs. The reviewer can inspect those artifacts with its allowed tools. See the custom subagent documentation for model aliases, tool restrictions and explicit invocation.

Record the decision points in CLAUDE.md. To bootstrap a repository, ask Claude to first show the proposed agent files, review policy and project-specific verification command for approval. Once approved, run the workflow in two passes:

- Plan. Find the relevant code, write the acceptance criteria and review the proposed approach before edits.

- Build and verify. Implement the patch, run the applicable tests and reproduce the user journey in a safe environment. Give the reviewer the diff and the failure or success artifacts.

A repo-local verify skill can document how to start the app, prepare test data and exercise the main flow. If the project needs a hard release gate, put executable checks in CI and require them through the repository's merge rules.

Ask for evidence you can reopen

A completion report should identify the commit or diff reviewed, the actual commands and exit outcomes, the acceptance criteria observed, and anything skipped or blocked. Attach stable CI links or sanitized output when possible. If the relevant journey could not run, record it as unverified and explain what is needed to run it.

Use the smallest process that fits the change. A typo may need a quick diff review. A checkout change may warrant a full browser run and a separate reviewer. A flaky check is a signal to investigate. If you retry, retain the first failure and explain why the new result is meaningful.

The next time an agent says a bug is fixed, ask one question: what can I open that shows the original failure is gone?

References

The checkout example is illustrative.

Related suggestions