SDLC Playbook

Stage 4: Test

Give Claude a feedback loop, and run evals continuously in CI.

The shift

From QA gates to checks that run all the time

When an agent writes the code, a late "does it work" signal turns a person into the bottleneck. Testing moves into the work itself.

Traditional

QA gates at stage boundaries

The signal arrives late, and a person has to check everything the agent produced.

When you find out it works
CI: minutes laterTester: days laterProduction: weeks later
AI-native

Continuous evals woven through implementation

The session checks its own work and iterates until the check passes. What reaches the engineer has already passed.

When you find out it works
Inside the session, before an engineer looks
Claude or an agent does the work A person decides A gate or check committed file
Two plays

Check the work, then check the setup

Play 1 makes each session verify itself. Play 2 tests the agent's configuration the way you test code.

1

Give Claude a feedback loop

"Always give Claude a way to verify its own work." A session checks and fixes its own work before an engineer sees it.

Traditional

The "does it work" signal comes late: CI minutes later, a tester days later, production weeks later. With an agent producing the code, someone must check all of it.

AI-native

The session runs the tests, runs the build, takes the screenshot, and iterates until the check passes. What reaches the engineer has already passed it. The engineer running the session sets up the loop.

The loop is not the same thing as the verifier subagent from Stage 3. The loop runs through the whole task, as many times as needed. The verifier is one way to package the final check, in a fresh context window, so its verdict is not colored by the assumptions that produced the code.

Watch the loop run

One bug fix, from a failing test to a verified diff. Use Play, or the arrow keys on the step buttons.

The feedback loop A bug starts with a failing test. Claude then cycles through running the check, reading the result and fixing the code until the check is green. A verifier in a fresh context checks the result, and a verified diff goes to the engineer. repeat Bug? Write the failing test first 1 Run the checkone command 2 Read the resultwhat failed, and why 3 Fix the codenever the test Run it againsame command Verifier, fresh contextno memory of the fix Verified diff
  1. Engineer reproduces the bug as a test and confirms it fails for the expected reason. The test is committed before any fix.

  2. Claude runs the check, for example make test. It fails, as expected.

  3. Claude reads the output and works out what failed and why.

  4. Claude changes the code. Hook blocks any edit to the test file.

  5. Same command. If it is still red, go around again. When it is green, the loop ends.

  6. A separate context re-runs the checks, so the verdict is not colored by the assumptions that produced the code.

  7. The diff arrives with the test output attached. The engineer reviews intent and risk.

2

Continuous evals in CI

"Evals are the AI-native equivalent of stage-gate QA." A suite that says whether the agent still does the work to the same standard.

Traditional

QA gates at stage boundaries.

AI-native

A suite of evals reruns whenever the agent's configuration changes, such as a new model or a rewritten prompt. It tells you whether the agent still meets the same standard.

The suite is live. As models improve, some cases stop telling good from bad, and monitoring produces new cases. Some teams prefer to run evals offline on a set cadence. The steps here are for continuous evals.

Watch a config change meet the evals

A pull request trims CLAUDE.md. The suite runs before it can merge.

CLAUDE.mdwaiting
PASSportal-stays-off-claims-core (4/4 checks)
RUNstatus-no-pii-in-logsFailed check: no response body in logs. The free-text field can hold personal data.
Merge check: waiting
  1. CI starts on a pull request that touches CLAUDE.md, .claude or the evals. It also runs on a schedule.

  2. CI checks out the code as it was before the original work, then copies in the branch's configuration. That is the thing under test.

  3. Claude runs each prompt non-interactively. Then the checks run on whatever files it left behind.

  4. The trimmed file dropped the line about not logging response bodies. The suite catches it.

  5. Config owner puts the line back before merge. The rerun passes.

  6. The team that owned the incident writes it. It joins the suite as a regression test.

Hand-off

What Test hands to Deploy

From Stage 4

A verified diff

The change has passed its own checks, with the output attached. Any change to the agent's configuration has passed the evals.

verified diff

Trigger

A PR enters review

The pull request starts the layered review in Stage 5: Deploy. Reviewers can focus on intent and risk because the mechanical evidence is already there.

Key takeaways

  • Give every session one command that says whether the work is done, and put it in CLAUDE.md.
  • For bugs, commit the failing test first. A test the agent could not rewrite is proof the bug is gone.
  • Protect the loop. The agent fixes the code, never the check.
  • Treat CLAUDE.md, skills and hooks like code: a suite of 20 to 50 real tasks reruns on every change and on a schedule.
  • Every production incident becomes a new eval.

Based on Anthropic's The AI-native SDLC playbook course (Claude Academy). Summarized by Bitovi to guide client transitions.