Comprehensive local code review using both Claude AI and CodeRabbit AI before pushing changes to GitHub. This command analyzes your local changes and provides actionable feedback without posting anything to GitHub.
5k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
458
stars on the repo
on the repository, not the skill itself
Install
one command, takes just this skill from the repository
# Review all commits compared to main branch (default)
/pre-push-review
# Review only staged changes
/pre-push-review --staged
# Review commits compared to a specific base branch
/pre-push-review --base upstream/main
# Review commits compared to develop branch
/pre-push-review --base develop
# Review staged changes (base branch used for context only)
/pre-push-review --staged --base upstream/main
Description
Comprehensive local code review using both Claude AI and CodeRabbit AI before pushing changes to GitHub. This command analyzes your local changes and provides actionable feedback without posting anything to GitHub.
Two Review Modes:
Commits Mode (default): Review all commits that are new compared to the base branch
Claude will execute the command and provide authentication URL
User opens URL in browser and copies token
User pastes token back to Claude
Verify with: coderabbit auth status
IMPORTANT: If CodeRabbit is missing or not authenticated, you will stop and will not proceed.
Process
Phase 1: Determine Review Scope
Parse Parameters:
Check for --staged flag (review staged changes)
Check for --base <branch> parameter (default: main)
If no flags: default to commits mode
Gather Git Information:
# Get current branch
git branch --show-current
# For commits mode: count new commits vs base
git rev-list --count <base-branch>..HEAD
# For staged mode: check if there are staged changes
git diff --cached --stat
# Get repository root
git rev-parse --show-toplevel
Validate Scope:
Commits mode: Ensure there are new commits compared to base branch
If no new commits: inform user and exit
Staged mode: Ensure there are staged changes
If no staged changes: inform user to run git add first and exit
If base branch doesn't exist: inform user and suggest alternatives
Phase 2: Gather Changes for Review
For Commits Mode:
# Get commit log
git log <base-branch>..HEAD --oneline
# Get full diff of all commits
git diff <base-branch>..HEAD
# Get stats (files changed, additions, deletions)
git diff <base-branch>..HEAD --stat
# Get list of changed files
git diff <base-branch>..HEAD --name-only
For Staged Mode:
# Get staged changes diff
git diff --cached
# Get stats of staged changes
git diff --cached --stat
# Get list of staged files
git diff --cached --name-only
Phase 3: Dual AI Review (Parallel Execution)
IMPORTANT: This is a LOCAL review only - nothing is posted to GitHub.
Run both reviews concurrently for efficiency:
CodeRabbit Review (Background - START THIS FIRST):
CodeRabbit analyzes git changes and can take 7-30+ minutes
For Commits Mode: coderabbit --prompt-only --type committed --base <base-branch>
For Staged Mode: coderabbit --prompt-only --type uncommitted
⚠️ Background execution note: Run in background to allow parallel processing, BUT the background output may only show status messages ("Analyzing", "Reviewing"). If no findings appear, run the command again directly to capture actual results.
Flags explained:
--prompt-only: Token-efficient AI-optimized output (does NOT post to GitHub)
Monitor Background Process: Check if CodeRabbit is still running
Read Output: Once complete, read the full CodeRabbit analysis
⚠️ Common Issue: If background execution only shows status messages without findings, run the command again directly: coderabbit --prompt-only --type committed --base <branch>
This ensures you capture the actual AI-generated findings, not just status updates
Handle Timeout: If CodeRabbit takes longer than expected, you can:
Continue waiting (recommended - CodeRabbit is thorough)
Proceed with Claude-only review if time-constrained
Note in the final report if CodeRabbit was incomplete
Phase 5: Cross-Check and Synthesize
Compare Findings:
Identify issues found by both Claude and CodeRabbit (high confidence)
Identify issues found by only one reviewer (needs validation)
CodeRabbit takes 7-30+ minutes - monitor progress and wait for completion
Parse git output to understand scope and context
Handle errors gracefully if git commands fail
Output Format:
Use clear markdown formatting for terminal display
Use color/emphasis sparingly for readability
Group related issues together
Provide actionable next steps
Include links to relevant documentation when applicable
Example Usage
# Review all commits before pushing to PR
/pre-push-review
# Review commits compared to upstream main
/pre-push-review --base upstream/main
# Review only what you've staged
git add src/component.tsx
/pre-push-review --staged
# Review commits on feature branch vs develop
git checkout feature/new-auth
/pre-push-review --base develop
Success Criteria
CodeRabbit is installed and authenticated (or Claude-only review)
Git repository and branch information retrieved successfully
Changes to review are identified (commits or staged)
Both AI reviewers complete their analysis (or Claude-only if CodeRabbit unavailable)
Findings are cross-checked and categorized by severity and confidence
Comprehensive review summary generated in terminal
No reviews posted to GitHub (local-only analysis)
User has clear understanding of:
Which issues are critical vs. actionable vs. minor
Why each issue matters and consequences of not fixing
Specific actionable steps to resolve each issue
Whether changes are ready to push or need fixes
Workflow Tracking
Use TaskCreate to track the 6-8 phases of the review process (including optional implementation and verification phases)
Mark each phase as in_progress when starting and completed when done via TaskUpdate
This gives the user visibility into review progress, especially during CodeRabbit's long analysis
If implementing fixes, track individual fix tasks to show progress
Error Handling
If CodeRabbit is missing:
Inform user that CodeRabbit is not installed
Provide installation command: curl -fsSL https://cli.coderabbit.ai/install.sh | sh
Offer to proceed with Claude-only review
Note in summary that only Claude review was performed
If CodeRabbit authentication fails:
Run coderabbit auth status to check status
Guide user through authentication: coderabbit auth login