| name | code |
| description | Dual AI code review with CodeRabbit + Claude Code for maximum coverage. Use
when reviewing changes before a PR, or for deep architectural analysis of
committed code.
|
Review Command
Dual AI code review with CodeRabbit + Claude Code for maximum coverage
Usage
/review
/review uncommitted
/review committed
/review --base develop
/review --quick
/review --deep
Overview
This command orchestrates a dual AI review combining:
| Reviewer | Strengths |
|---|
| CodeRabbit | Static analysis, security scanning (Gitleaks, Semgrep), linting (Ruff, Pylint), pattern detection |
| Claude | Architectural review, business logic, design patterns, contextual understanding |
┌─────────────────────────────────────────────────────────────────┐
│ DUAL AI REVIEW PIPELINE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────┐ ┌───────────────┐ │
│ │ CodeRabbit │ │ Claude │ │
│ │ CLI │ │ Code │ │
│ └───────┬───────┘ └───────┬───────┘ │
│ │ │ │
│ ┌───────▼───────┐ ┌───────▼───────┐ │
│ │ • Security │ │ • Architecture│ │
│ │ • Linting │ │ • Logic │ │
│ │ • Patterns │ │ • Design │ │
│ │ • Style │ │ • Intent │ │
│ └───────┬───────┘ └───────┬───────┘ │
│ │ │ │
│ └────────────┬─────────────┘ │
│ │ │
│ ┌───────▼───────┐ │
│ │ UNIFIED │ │
│ │ REPORT │ │
│ └───────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Process
Step 1: Determine Scope
git status
git diff --stat HEAD
git log origin/main..HEAD --oneline 2>/dev/null || echo "No commits ahead of main"
Scope Selection:
| User Input | Scope |
|---|
/review | All changes vs main |
/review uncommitted | Working directory only |
/review committed | Committed changes only |
/review --base <branch> | Compare to specific branch |
Step 2: Run CodeRabbit Analysis
source ~/.zshrc
coderabbit --version || echo "CodeRabbit CLI not available"
coderabbit review --plain
coderabbit review --type uncommitted --plain
coderabbit review --type committed --plain
coderabbit review --base <branch> --plain
Note: Requires CodeRabbit GitHub App installed on the repository.
Parse CodeRabbit Output:
SEVERITY MAPPING
├─ [CRITICAL] → Must fix before merge
├─ [ERROR] → Should fix before merge
├─ [WARNING] → Recommended to fix
└─ [INFO] → Nice to have
Step 3: Run Claude Deep Analysis
Use the python-code-reviewer agent capabilities:
Focus Areas:
| Category | Check For |
|---|
| Architecture | Project pattern alignment, separation of concerns |
| Business Logic | Correct implementation, edge cases, error handling |
| Design Patterns | Project conventions, established patterns, consistency |
| Maintainability | Self-documenting code, type hints, DRY principle |
Step 4: Synthesize Findings
Combine results from both reviewers:
- Deduplicate — Same issue found by both → keep one, note "Both"
- Prioritize — Critical > Error > Warning > Info
- Categorize — Security, Quality, Performance, Style
- Action — Must fix vs Should fix vs Nice to have
Step 5: Generate Report
Output Format
## 🔍 Dual AI Review Report
**Reviewers:** CodeRabbit + Claude Code
**Scope:** {scope_description}
**Files:** {count} files, {lines} lines changed
**Date:** {timestamp}
---
### 📊 Summary
| Source | 🔴 Critical | 🟠 Error | 🟡 Warning | 🔵 Info |
|--------|-------------|----------|------------|---------|
| CodeRabbit | {n} | {n} | {n} | {n} |
| Claude | {n} | {n} | {n} | {n} |
| **Total** | {n} | {n} | {n} | {n} |
---
### 🔴 Critical Issues
> Must fix before merge
#### [C1] {Title}
- **Source:** {CodeRabbit|Claude|Both}
- **File:** `{path}:{line}`
- **Issue:** {description}
- **Fix:**
```{lang}
{code}
🟠 Errors
Should fix before merge
[E1] {Title}
- Source: {source}
- File:
{path}:{line}
- Issue: {description}
🟡 Warnings
Recommended to fix
- [{source}]
{file}: {description}
🔵 Suggestions
- {suggestion 1}
- {suggestion 2}
✅ Positive Observations
- {good practice 1}
- {good practice 2}
📋 Action Checklist
Merge Status: {✅ Ready | ⚠️ Fix warnings first | 🚫 Fix critical issues}
---
## Error Handling
### CodeRabbit CLI Not Available
```text
IF coderabbit command not found:
1. Attempt: source ~/.zshrc && coderabbit --version
2. If still fails: Proceed with Claude-only review
3. Note in report: "CodeRabbit unavailable"
CodeRabbit Not Authenticated
IF authentication error:
1. Inform user: "Run 'coderabbit auth login' to authenticate"
2. Proceed with Claude-only review
3. Note in report: "CodeRabbit not authenticated"
Large Changeset
IF > 50 files changed:
1. Suggest: "Large changeset detected. Use '/review uncommitted' for faster feedback"
2. Proceed with review but note potential timeout
Quick Mode (--quick)
CodeRabbit only — for fast feedback:
/review --quick
Process:
- Run
coderabbit review --plain
- Parse and format results
- Skip Claude analysis
- Return immediately
Use When:
- Quick sanity check
- Pre-commit validation
- CI/CD integration
Deep Mode (--deep)
Claude only — for thorough analysis:
/review --deep
Process:
- Skip CodeRabbit
- Full Claude analysis with all capabilities
- Detailed architectural review
- Extended recommendations
Use When:
- CodeRabbit unavailable
- Need deeper contextual analysis
- Reviewing design decisions
Integration
Before PR Creation
/review
/create-pr
With create-pr Command
/create-pr --review
In Development Loop
/review uncommitted
git add .
/review committed
Configuration
Optionally respects .coderabbit.yaml settings (create this file if needed):
| Setting | Effect |
|---|
reviews.path_instructions | Custom rules per path |
reviews.tools | Which linters are enabled |
reviews.pre_merge_checks | Quality gates |
Examples
Example 1: Standard Review
/review
...
🔴 Critical: 0
🟠 Error: 2
🟡 Warning: 5
Merge Status: ⚠️ Fix errors first
Example 2: Quick Check
/review --quick uncommitted
...
✅ No critical issues
⚠️ 3 warnings to consider
Example 3: Branch Comparison
/review --base develop
Comparing: HEAD vs develop
...
Tips
- Review Early — Run
/review uncommitted frequently during development
- Fix Critical First — Always address critical and error issues before PR
- Learn from Feedback — Both AIs provide educational explanations
- Use Quick Mode — For rapid iteration,
/review --quick is your friend
- Pre-PR Habit — Always
/review before /create-pr
Related
- Agent:
.github/agents/python-code-reviewer.agent.md
- Config:
.coderabbit.yaml (optional, create if needed)
- Create PR:
.github/commands/workflow/create-pr.md