Review the diff against the spec with a read-only subagent
A second agent with a fresh context and no write tools checks the change against SPEC.md, and reports only gaps that affect correctness.
Reported by @juliandierker · Verified 2026-11-21
- Agent
- Claude Code
- Stack
- Any
Problem
The agent that wrote the code reviews it with the same assumptions it wrote it with. Asking it "is this correct?" gets a yes.
Setup
A reviewer that can read but not edit, in .claude/agents/reviewer.md:
---
name: reviewer
description: Reviews a diff against the spec. Read-only.
tools: Read, Grep, Glob
---
Check every requirement in SPEC.md is implemented and every listed edge case
has a test. Report only gaps that affect correctness. Skip style.use the reviewer subagent to review the rate limiter diff against SPEC.mdWhat happened
The fresh context does not share the writer's blind spots, and the narrow brief keeps it on correctness. Anthropic's guide pairs this with a spec written before the code.
Sources: Best practices for Claude Code.
Reproduce
Write a short SPEC.md with requirements and edge cases.
Add the reviewer agent and implement the spec in a normal session.
Run the review and check each reported gap against the spec.