Skip to content
GitHub stars

Reviewing Code

Feature Branches

Use --branch to review all commits since your branch diverged from main:

Terminal window
roborev review --branch # Review branch vs auto-detected main/master
roborev review --branch=feature-xyz # Review a specific branch by name
roborev review --branch --base dev # Review branch vs specific base
roborev review --branch --wait # Wait for review and show result

This is useful for pre-merge reviews of entire feature branches.

Reviewing a Different Branch

By default --branch reviews the current branch. You can specify a branch name to review a different branch without switching to it:

Terminal window
roborev review --branch=feature-xyz
roborev review --branch=feature-xyz --base develop

Note: use --branch=name (with =), not --branch name. The space-separated form treats name as a positional commit argument.

How It Works

  1. roborev detects the merge-base between the target branch and the base branch
  2. All commits from the merge-base to the branch tip are queued for review
  3. Each commit is reviewed individually by the AI agent
  4. Results are stored and can be viewed in the TUI

Pre-Merge Review

Before creating a pull request, review your entire branch:

Terminal window
git checkout feature-branch
roborev review --branch --wait
roborev compact --wait # Consolidate findings across commits
roborev fix # Address consolidated findings
roborev tui # Browse results

CI Integration

Terminal window
if ! roborev review --branch --wait --quiet; then
echo "Reviews found issues"
exit 1
fi

Branch Review Options

FlagDescription
--branch [name]Review all commits on the branch since base. Optionally specify a branch name with --branch=name.
--base <branch>Compare against a specific base branch (default: auto-detect main/master)
--waitWait for all reviews to complete
--quietSuppress output
--agent <name>Use specific agent
--reasoning <level>Set reasoning depth

Uncommitted Changes

Use --dirty to review working tree changes before committing:

Terminal window
roborev review --dirty # Queue review of uncommitted changes
roborev review --dirty --wait # Wait for review and show result

What Gets Reviewed

The --dirty flag includes:

  • Staged changes
  • Unstaged changes to tracked files
  • Untracked files

Dirty Review Options

FlagDescription
--waitWait for review to complete
--quietSuppress output
--agent <name>Use specific agent
--reasoning <level>Set reasoning depth

Exit Codes

The --wait flag exits with:

  • Code 0 for passing reviews
  • Code 1 for failing reviews

This is useful for CI or pre-commit workflows:

Terminal window
if ! roborev review --dirty --wait --quiet; then
echo "Review failed - please address findings"
exit 1
fi

Review Types

Use --type to change what the reviewer focuses on. Omitting --type gives you the standard code review.

Terminal window
roborev review # Default code review
roborev review --type security # Security-focused review
roborev review --type design # Design-focused review
roborev review --branch --type security # Security review of branch
TypeFocus
(default)Bugs, security, testing gaps, regressions, code quality. This is what you get when you omit --type.
securityInjection, auth, credential exposure, path traversal, unsafe patterns
designCompleteness, feasibility, task scoping, missing considerations

Review types work with all review modes (--branch, --dirty, --since, single commits, ranges).

Each type can have its own agent and model configuration via {type}_agent and {type}_model in .roborev.toml or global config. See Workflow-Specific Agent and Model.

Specific Commit Ranges

Use --since to review commits since a specific point:

Terminal window
roborev review --since HEAD~5 # Review last 5 commits
roborev review --since abc123 # Review commits since abc123 (exclusive)
roborev review --since v1.0.0 # Review commits since a tag

The range is exclusive of the starting commit (like git’s .. range syntax). Unlike --branch, this works on any branch including main.

Large Diffs

For --dirty reviews, diffs are limited to 200KB since uncommitted changes cannot be easily inspected by the agent. If your dirty diff exceeds this limit, commit your changes in smaller chunks.

For committed changes, diffs over 250KB are omitted from the prompt - the agent is given only the commit hash and can inspect changes using git show.

Waiting for a Review Without Enqueuing

When a post-commit hook already triggers roborev review, you don’t need review --wait (which enqueues a duplicate job). Use roborev wait to block until the existing job completes:

Terminal window
roborev wait # Wait for most recent job for HEAD
roborev wait abc123 # Wait for job matching a specific commit
roborev wait --sha HEAD~1 # Explicit git ref
roborev wait --job 42 # Wait for a specific job ID
roborev wait --quiet # Suppress output (exit code only)

Exit codes: 0 for PASS, 1 for FAIL or no job found.

Argument Resolution

A positional argument is resolved as a git ref first (so numeric SHAs like 123456 are handled correctly), then as a numeric job ID. Use --sha or --job to disambiguate when needed.

Agent Review-Fix Loops

roborev wait is designed for coding agents running review-fix refinement loops. The agent commits, the hook enqueues the review, and the agent calls wait to block until the verdict is ready. This avoids wasting tokens on repeated roborev list or roborev show invocations.

Terminal window
# Typical agent loop
git commit -m "Fix auth validation" # Hook triggers review
roborev wait --quiet # Block until verdict
# Exit code 0 = pass, 1 = fail

Addressing Findings

After reviewing, use roborev fix to let an agent address any failed reviews:

Terminal window
roborev review --dirty --wait
# commit your changes
roborev fix # Fix open reviews

See Also