Quick Start¶
This guide walks you through the most common claude-review workflows in under five minutes.
1. Set your API key¶
2. Review staged changes (default)¶
The simplest use case: stage your changes and run claude-review:
This reviews only the staged diff โ exactly what git diff --cached would show.
Output is written to REVIEW.md in the current directory. Example:
# Code Review Report
Branch: feature/auth-refactor โ main
Changes: +142 -38 across 8 files
## Summary
| Severity | Count |
|----------|-------|
| ๐ด Critical | 1 |
| ๐ High | 2 |
| ๐ก Medium | 4 |
| ๐ก Suggestion | 1 |
Cost: $0.43 ยท Agents: 5 finder + verifier + ranker ยท Time: 38s
---
## ๐ด Critical
### JWT expiry is never validated before granting access
**File**: `src/auth/token.go` ยท **Line**: 87 ยท **Confidence**: 95%
The decoded token's expiry (`exp` claim) is extracted but never compared against
the current time. Any expired token will be accepted as valid.
**Suggested Fix**:
if claims.ExpiresAt.Unix() < time.Now().Unix() {
return nil, ErrTokenExpired
}
3. Review a specific commit or range¶
# Last commit
claude-review diff HEAD~1
# Last 3 commits
claude-review diff HEAD~3
# Branch diff against main
claude-review diff main..feature/auth-refactor
# Specific commit hash
claude-review diff a1b2c3d
4. Review a GitHub PR¶
# Full URL
claude-review pr https://github.com/org/repo/pull/123
# Just the PR number (auto-detects your remote)
claude-review pr 123
For PR reviews you need a GITHUB_TOKEN set:
5. Review a GitLab MR¶
# Full URL
claude-review pr https://gitlab.com/org/project/-/merge_requests/45
# MR number shorthand (auto-detects GitLab remote)
claude-review pr 45
Set GITLAB_TOKEN before running:
6. Review a Bitbucket PR¶
Set BITBUCKET_TOKEN (an app password with PR read scope):
7. Preview cost before running¶
Don't want to be surprised by the API cost? Use --estimate:
This counts tokens and prints the estimated cost without making any API calls.
8. Output as JSON (for CI / bots)¶
The JSON output is structured for machine consumption โ pipe it into Slack bots, dashboard scripts, or GitHub comment automation.
9. Focus on a specific concern¶
claude-review diff --focus security # security issues only
claude-review diff --focus logic # logic bugs only
claude-review diff --focus "security,types" # multiple
10. Use a more powerful model for critical PRs¶
claude-review diff --model claude-sonnet-4-6 # deeper analysis
claude-review diff --model claude-opus-4-6 # maximum depth (most expensive)
11. Install as a pre-commit hook¶
Run reviews automatically before every commit:
Remove it:
12. Enable memory across reviews¶
The memory layer remembers patterns across all your PRs. No setup required โ just add --memory:
After the first review, findings are stored in .claude-review/memory.db. On your next command, if 30+ minutes have passed or 10+ new findings exist, consolidation runs automatically in the background โ no daemon needed.
Learn more about the memory layer โ