Overview
Write a feature spec, have Claude Code implement it with tests, then run separate review passes in fresh sessions that check the diff against the spec, security and migrations before you merge.
Problem or Objective
- Which tools help write a spec before an agent writes code?
- Which agents build a non-trivial feature with you?
- Which agents review pull requests?
More in Coding and Code Review
AI Agents and Models
Tools and Integrations
- Tools
- Git
- Prerequisites
- Claude Code installed with a Claude plan or API key, a repository with a test suite, and a written spec for the feature.
How It Works
Write the feature as a short spec file in the repository: the problem, acceptance criteria, data or schema changes, and what is out of scope. Put coding standards and a review checklist in CLAUDE.md so every session reads them. Ask Claude Code to read the spec and propose a plan, approve or adjust it, then let it implement on a branch with tests for each acceptance criterion, approving commands as it asks. When it reports done, start a fresh, non-interactive review that sees only the spec and the diff, for example with claude -p, and ask for a list of criteria not met, security problems and risky migrations. For larger features, have a lead agent spawn separate reviewer agents for security and for tests. Feed the findings back to the implementing session, rerun the tests, and read the final diff yourself before opening and merging the pull request.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Claude Code.
- Connect the toolsConnect the tools this workflow relies on: Git.
- Check the prerequisitesClaude Code installed with a Claude plan or API key, a repository with a test suite, and a written spec for the feature.
- Gather your detailsCollect what the prompt asks for: Path to the spec file, Base branch, Feature branch.
- Run the starter promptPaste the starter prompt below into Claude Code and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at code.claude.com before you rely on it.
Practical Starter Prompt: Review a feature diff against its spec
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
You are reviewing, not implementing. Read the spec at [Path to the spec file] and the diff between [Base branch] and [Feature branch]. List each acceptance criterion as met, partly met or not met, with the file and line that shows it. Then list security issues, unsafe data migrations and missing tests, most serious first. Do not edit files, commit or push; report findings only for the implementer and me to act on.Run this in a fresh session with read-only tool permissions. You approve the implementer's plan and commands, read the review findings, and open and merge the pull request yourself after the tests pass.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. The Claude Code overview says CLAUDE.md is read at the start of every session and can hold coding standards and review checklists, that claude -p can be piped a diff to review changed files for security issues, and that a lead agent can spawn multiple agents, assign subtasks and merge results. The pages do not measure how many defects the review passes catch.
Limitations and Considerations
Give the reviewer the spec and the raw diff in a fresh session, not the implementing chat. A claude -p session shows no trust dialog, so set its tool permissions explicitly and keep the reviewer read-only. Check migrations against a copy of production data yourself. Check how running several agents in parallel counts against your plan before doing it for every feature. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Official Website
The official site of the main tool or project in this use case.
Visit Website (opens in a new tab)code.claude.com
Related Videos
About anthropics/claude-code
The SECRET Claude Code Upgrade That Has Everyone Going Nuts (Full Guide) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)About anthropics/claude-code
The only Claude Code guide you'll ever need (Opus 4.5) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- Overview - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 11:57 UTC
What this source supports
- CLAUDE.md is a markdown file you add to your project root that Claude Code reads at the start of every session; use it to set coding standards, architecture decisions, preferred libraries, and review checklists.
- Spawn multiple Claude Code agents that work on different parts of a task simultaneously; a lead agent coordinates the work, assigns subtasks, and merges results.
- Example: git diff main --name-only | claude -p "review these changed files for security issues".
- Run Claude Code programmatically - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 26 Nov 2026, 17:27 UTC
What this source supports
- Claude Code runs non-interactively with claude -p for scripts and automation.
- A -p session shows no workspace trust dialog and no per-server approval prompt.

