← All use cases

中文

Building software · Claude + Claude Code

Set up layered reviews for code an agent wrote

Idea + starter prompt, not run by us yet

For: Software teams where agents now write a large share of the code

The Claude Code team describes its review setup. Claude checks its own work with tests, builds or screenshots, then a fresh subagent reviews the diff. Each PR gets parallel bug-hunting agents that vote, a blocking security check and CI. A classifier assigns zero to two human approvers by risk. Between June and September, merged PRs grew more than twofold and the revert share dropped by over 40 percent.

Steps

  1. Make the agent prove its work with tests, a build or a screenshot.
  2. Add a reviewer with fresh context that sees only the diff.
  3. Run a security review that can block the merge.
  4. Set how many humans must approve based on how risky the change is.
  5. Cap re-review rounds, for example at three, so author and reviewer agents cannot loop all night.

Starter prompt

Starter prompt. Change the [brackets] first.

Review the changes on branch [branch name] against [main branch]. Look only at the diff. Check for bugs, security problems and missing tests. For each finding, give the file, the line, why it matters and how sure you are. Rate the overall risk as low, medium or high, and say how many human reviewers you think it needs. Do not edit code or merge anything. Stop after one review round.

Original post: claude.dev · found via agentusecases.ai. Written up in our own words. We haven't run it, so test it on made-up data first.