Claude Code review
Claude Code supports both local diff review inside a session and managed GitHub pull request reviews. Use local review before commit; use PR review for team workflows and continuous feedback.
- Last verified
- Applies to
- Claude Code 2.1.x. CLI spellings were checked on local version 2.1.198; official docs may describe newer 2.1.x behavior.
- Verification method
- Local `/code-review` behavior and managed GitHub review limitations were reviewed in official docs. No model review, PR comment, GitHub App installation, or automatic fix was executed.
- Official sources
- Code ReviewCommands referenceChangelog
Reproducible practice
Review a controlled diff before allowing any automatic fix
Freeze the intended diff, run a read-first local review, reproduce findings, and decide fixes separately.
Prerequisites
- A trusted repository and known base branch.
- Tests that can reproduce the changed behavior.
- No unrelated uncommitted work in the review scope.
Steps
Freeze scope evidence
Record commits and working-tree changes before asking for review.
Step 1 git status --short git diff --stat git diff --checkRun the local review read-first
Invoke `/code-review` without `--fix`; model output and cost were not exercised in this audit.
Reproduce each candidate
Open cited lines, run the smallest relevant test, and reject findings that do not survive code evidence.
Fix in a separate step
Apply only accepted findings, rerun targeted and broad gates, then compare the final diff with the frozen scope.
Expected result
Every accepted finding has a cited location and reproducible failure or strong code-path proof; review output alone does not modify the tree.
Validation
- Compare pre- and post-review `git status --short`.
- Record the command or code path that confirms each accepted finding.
- Run repository tests after fixes, not merely another model review.
Failure handling
Review is too broad
Specify a ref range or isolate the intended commits before rerunning.
Managed review is neutral
Do not assume it gates merges; use existing branch protection and CI.
Cleanup or rollback
- Discard only reviewed automatic edits after inspecting the patch; preserve unrelated user work.
- Remove temporary review notes that contain private code or identifiers.
Boundaries and when not to use it
- Managed Code Review is a research preview with plan and provider limits documented by Anthropic.
- A clean review is evidence from one method, not proof that the change has no defects.
Review a diff locally
Local review commands inspect the current working tree or selected targets before you commit or open a pull request. They complement tests but do not replace human ownership.
| Command | Description |
|---|---|
/diff | Open an interactive diff viewer for current changes. |
/code-review | Review the current diff for bugs, cleanup, and security issues. |
/code-review --fix | Apply review findings to the working tree when appropriate. |
/security-review | Focus the review on security-sensitive changes. |
/diff
/code-review
/security-reviewGitHub Code Review service
The managed Code Review service analyzes pull requests with multiple agents and posts inline findings tagged by severity. It complements CI but does not block merges by default.
Important
Bugs that should be fixed before merge.
Read guideNit
Minor issues worth fixing but not blocking.
Read guidePre-existing
Issues present before the PR that were not introduced by the change.
Read guideTriggers
Configure once after PR creation, on every push, or manual `@claude review` comments.
Read guideCustomize review guidance
Repository guidance files help Claude focus on what your team cares about. Keep review instructions factual and tied to verifiable risks.
CLAUDE.md
Share project-wide review expectations and architecture constraints.
Read guideREVIEW.md
Add review-specific guidance for the managed PR reviewer.
Read guideLocal vs managed
Local `/code-review` is immediate; managed PR review scales across the team.
Read guideAct on findings
Treat review output as input. Fix verified issues, rerun tests, and request another review when the PR changes materially.
| Command | Description |
|---|---|
@claude review | Trigger a managed PR review from a GitHub comment. |
@claude review once | Run one review without subscribing to future pushes. |
claude ultrareview | Run a deep non-interactive review from the CLI. |
Review checklist
Review before handoff
Run local diff and code-review commands before treating work as ready.
Read guideVerify with project tests
Review findings still need the repository's own test and lint commands.
Read guideTune guidance files
Document review priorities in CLAUDE.md or REVIEW.md instead of repeating them in every PR.
Read guideRe-review after major changes
Large follow-up pushes deserve a fresh review pass.
Read guide