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

  1. Freeze scope evidence

    Record commits and working-tree changes before asking for review.

    Step 1
    git status --short
    git diff --stat
    git diff --check
  2. Run the local review read-first

    Invoke `/code-review` without `--fix`; model output and cost were not exercised in this audit.

  3. Reproduce each candidate

    Open cited lines, run the smallest relevant test, and reject findings that do not survive code evidence.

  4. 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.

CommandDescription
/diffOpen an interactive diff viewer for current changes.
/code-reviewReview the current diff for bugs, cleanup, and security issues.
/code-review --fixApply review findings to the working tree when appropriate.
/security-reviewFocus the review on security-sensitive changes.
Local review before commit
/diff
/code-review
/security-review

GitHub 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.

Triggers

Configure once after PR creation, on every push, or manual `@claude review` comments.

Read guide

Customize review guidance

Repository guidance files help Claude focus on what your team cares about. Keep review instructions factual and tied to verifiable risks.

Act on findings

Treat review output as input. Fix verified issues, rerun tests, and request another review when the PR changes materially.

CommandDescription
@claude reviewTrigger a managed PR review from a GitHub comment.
@claude review onceRun one review without subscribing to future pushes.
claude ultrareviewRun a deep non-interactive review from the CLI.

Review checklist

Related topics