Local Code Review

Use the /review command to analyze local code changes with AI-powered review workflows

Overview

The /review command provides a local workflow for analyzing code changes with AI-powered insights. It offers multiple review modes to fit different development scenarios, from reviewing uncommitted changes to analyzing full branches or specific commits.

When you run /review, droid guides you through selecting a review type, configuring parameters, and then performs a comprehensive analysis of your code changes based on industry-standard review guidelines.

Quick start

  1. 1
    Start the review flow

    In a local droid session, type:

    Bash
    /review
  2. 2
    Select a review type

    Choose from four review presets:

    • Review against a base branch - PR-style review comparing your branch to a base branch
    • Review uncommitted changes - Analyze working directory changes (staged, unstaged, and untracked)
    • Review a commit - Examine a specific commit from history
    • Custom review instructions - Define your own review criteria
  3. 3
    Configure parameters

    Depending on your selection:

    • For base branch reviews: Select the target branch (e.g., main, develop)
    • For commit reviews: Choose a commit from the interactive list
    • For custom reviews: Enter your review instructions
  4. 4
    Review the findings

    Droid analyzes the code changes and provides:

    • Prioritized findings with severity levels [P0-P3]
    • Specific file locations and line numbers
    • Suggested fixes with code suggestions
    • Overall assessment of the changes

Review types

Review against a base branch

Compare your current branch against a base branch (like a pull request review). This is ideal for pre-PR reviews or checking what changes would be merged.

How it works:

  1. 1
    Select "Review against a base branch"
  2. 2
    Choose your target base branch from the list (local and remote branches shown)
  3. 3
    Droid finds the merge base and reviews the diff

Use cases:

  • Pre-commit PR reviews
  • Checking branch changes before creating a pull request
  • Validating feature branch against main/develop

Example workflow:

> /review
# Select: Review against a base branch
# Choose: origin/main
# Droid reviews all changes that would be merged

Review uncommitted changes

Analyze all current working directory changes: staged files, unstaged modifications, and untracked files.

Use cases:

  • Quick sanity check before committing
  • Reviewing work in progress
  • Finding issues early in development

Example workflow:

> /review
# Select: Review uncommitted changes
# Droid immediately reviews all working directory changes

Review a commit

Examine the changes introduced by a specific commit in your repository history.

How it works:

  1. 1
    Select "Review a commit"
  2. 2
    Browse commits with hash, message, author, and date
  3. 3
    Select a commit to review

Use cases:

  • Reviewing recent commits for issues
  • Understanding changes in a specific commit
  • Post-merge review of teammate's work

Example workflow:

> /review
# Select: Review a commit
# Browse and select: abc1234 - "Add user authentication"
# Droid reviews that specific commit's changes

Custom review instructions

Define your own review criteria for specialized analysis.

Use cases:

  • Performance analysis
  • Checking specific coding standards
  • Domain-specific validations

Example workflow:

> /review
# Select: Custom review instructions
# Enter: "Focus on performance regressions and unnecessary re-renders"
# Droid performs a targeted review

Review guidelines

All code reviews follow a structured rubric designed to produce actionable, high-quality feedback.

Severity levels

PriorityMeaningTypical response
[P0]Critical issue blocking release or operations.Fix immediately before merge or deploy.
[P1]Urgent issue that should be addressed in the next cycle.Fix before the work is considered complete.
[P2]Normal priority issue to fix eventually.Track or fix when practical.
[P3]Low-priority nice-to-have improvement.Consider if it aligns with nearby work.

Bug detection criteria

The AI flags an issue as a bug only when all of these are true:

CriterionMeaning
Meaningful impactAffects accuracy, performance, security, or maintainability.
Discrete and actionableClear, specific issue with a clear fix.
Appropriate rigorDoes not demand more rigor than the rest of the codebase.
Introduced in changesAdded by the reviewed changes, not pre-existing.
Worth fixingThe author would likely fix it if made aware.
No unstated assumptionsBased on verifiable facts, not speculation.
Provably affectedIdentifies specific affected code, not a theoretical risk.
Not intentionalClearly not a deliberate design choice.

Comment and output standards

AreaStandard
ReasoningExplain why the issue matters and which conditions trigger it.
SeverityUse [P0] through [P3] to communicate impact accurately.
BrevityKeep each finding to one paragraph.
Code snippetsLimit Markdown code chunks to three lines.
ToneStay matter-of-fact and avoid accusatory language or excessive flattery.
Finding titleUse a clear title, 80 characters or fewer, in imperative mood.
LocationInclude file paths and line numbers when applicable.
Suggested fixInclude a concrete replacement only when it is safe and specific.
Overall assessmentState whether the changes are correct or incorrect, plus a one to three sentence summary.

Tips and best practices

Making the most of reviews

  • Run reviews frequently during development, not just before commits
  • Use custom instructions for domain-specific concerns your team cares about
  • Treat P0/P1 findings seriously, they represent real issues worth addressing
  • Review the overall assessment for context on whether changes are sound
  • Press Esc to go back at any step in the review flow
  • From the preset selection, Esc closes the review overlay
  • Use arrow keys to navigate branch/commit lists
  • Type to filter branches by name in real-time

Automated reviews in CI

The /review command is meant for local CLI sessions. For automated PR reviews in CI/CD, use the Automated Code Review workflow, which supports:

  • Automatic PR reviews triggered by pull request events or comments
  • Review depth (deep or shallow) to control thoroughness and cost
  • Custom review guidelines for repository-specific checks

Set it up by running droid and entering /install-code-review, or run a one-off review with:

Bash
droid exec "Review the changes in this PR for correctness and performance regressions"

See the Automated Code Review guide for full configuration options.