Review local changes
The CodeRabbit CLI analyzes local Git changes using the same pattern recognition that powers our PR reviews. By default, it reviews tracked changes: committed changes, staged changes (including new files added withgit add), and unstaged edits to tracked files. Use --uncommitted to review only staged and tracked local edits. Files not added to Git are skipped unless you pass --include-untracked.
Key features
Review local changes
Turn findings into fixes
Context-aware reviews
Install agent skills
coderabbit skills to preview and install or update verified CodeRabbit skills for supported coding agents.Getting started
Install CLI
- Install script
- Homebrew
- Windows (PowerShell)
coderabbit is not available immediately after installation, start a new shell, or run the exact shell-specific reload command printed under Next steps. If the install script offers browser sign-in without first asking for a region, EU users should skip it and authenticate later with an explicit --region eu.Authenticate
cr auth status displays it.If your account has access to multiple CodeRabbit organizations, choose your default organization during sign-in. That choice sets the login/default org for browser-based auth, but CLI reviews still resolve the current repository first. You can change the default later with cr auth org.If browser sign-in is blocked or unavailable, authenticate with an Agentic API key instead:Review your code
--dir flag can target a Git worktree or a subdirectory within one.main, specify your base branch:Verify local setup
Apply suggestions
Organization selection
The active CodeRabbit organization is the login/default org for browser-based CLI auth. It is used when the current repository resolves to that org, but it is not a silent billing fallback for unrelated local repositories. During a review, CodeRabbit resolves the current repository first:- If the repository matches the selected org, the review uses that org.
- If the repository matches a different org you can access, CodeRabbit switches attribution to that org.
- If the repository matches an installed public repo but you do not have access to the owning org, the review uses OSS behavior.
- If the repository cannot be matched to an installed accessible repo, the CLI falls back to limited/free review behavior until CodeRabbit is installed for that repo or org.
cr auth org requires an active browser-based login. If your local session is missing or expired, run cr auth login first, then run cr auth org again. Organization switching is not available for self-hosted mode or API key authentication.
Review modes
The CLI uses plain-text, human-readable output by default, with agent output and an optional lighter policy also available:--agent for structured JSON output.
Usage-based reviews and consent
When an organization sets usage-based reviews to the On demand continuation mode and the included review limit is reached, CodeRabbit shows the number of billable files and the maximum review price before starting paid work. See usage-based add-on pricing for rates. Only developers with an assigned seat can authorize them. This self-serve launch excludes Enterprise organizations. In an interactive terminal, confirm the price prompt to run that one review with usage credits. You can also give explicit consent when starting the review:coderabbit review command never creates a postpaid charge in on_demand mode without this confirmation.
In headless or agent mode, CodeRabbit never waits for or assumes confirmation. Instead, it returns a structured action_required result with status: "awaiting_confirmation", the billable file count, maximum price, confirmationHeadCommitId content identity, and the explicit coderabbit review --use-credits command. Automation can inspect that result and decide whether to start a new authorized review.
Diagnostics
Runcr doctor at any time to verify your local setup. The command checks:
- CLI runtime and version
- Local CodeRabbit storage directory
- Authentication state and auth environment
- Current Git repository and branch metadata
- Auto-update policy
- CodeRabbit backend reachability
- CodeRabbit WebSocket reachability
cr doctor exits with status code 1 when any check fails. Warnings appear in the report but do not cause a non-zero exit code.
Review statistics
Usecr stats to inspect your review statistics from local review history:
Working with review results
CodeRabbit analyzes your code and surfaces specific issues with actionable suggestions. Each finding includes the problem location, explanation, and recommended fix. Example findings include:- Race condition detected: “This goroutine accesses shared state without proper locking”
- Memory leak potential: “Stream not closed in error path - consider using defer”
- Security vulnerability: “SQL query uses string concatenation - switch to parameterized queries”
- Logic error: “Function returns nil without checking error condition first”
Browse and apply suggestions
In plain mode, read each finding in the terminal output and apply the suggested change in your editor or coding agent. For simple issues like missing imports, syntax errors, or formatting problems, use the suggested fix directly. For larger changes, usecr review --agent so your coding agent can consume structured findings.
Use AI coding agents
For AI agent integration, see the AI agent integration section for detailed workflow guidance and integration guides.Replay stored findings
Runcr review findings to read results from the most recent local review that produced findings, without re-running the full analysis. This is useful in multi-step agent loops where a downstream step needs to consume results from a prior review.
Inspect AI prompts
Runcr review --show-prompts to print the AI prompts saved from the most recent local review without triggering a new review. Useful for tuning --config instructions or understanding why the model flagged a particular finding.
AI agent integration
CodeRabbit detects the problems, then your AI coding agent implements the fixes./coderabbit:review instead of
the CLI commands shown below.Integration guides
See detailed workflows for AI coding agents and workflows:CodeRabbit Skills
coderabbit skills to install agent-native Skills and trigger reviews with an explicit request such as “Run a CodeRabbit review.”Claude Code integration
Codex integration
Headless CLI integration
Example prompt for your AI agent
Here’s a complete prompt you can use with Cursor, Codex, or other AI coding agents:Components of a good prompt
Breaking down what makes an effective CodeRabbit + AI agent workflow:1. Run CodeRabbit CLI
1. Run CodeRabbit CLI
--agent flag:2. Run in the background
2. Run in the background
3. Evaluate and implement fixes
3. Evaluate and implement fixes
complete event has status: "review_skipped", there were no file changes in scope.4. Verify with a second pass
4. Verify with a second pass
5. Set loop limits
5. Set loop limits
Pricing and capabilities
See the rate limits table on the Plans and pricing page for current per-plan limits. To increase the limits, consider upgrading your plan or using the Usage-based Add-on.Free tier
Paid plans
- Learnings-powered reviews: Remembers your team’s preferred patterns for error handling, state management, and architecture
- Full contextual analysis: Understands your imports, dependencies, and project structure
- Team standards enforcement: Applies your documented coding guidelines automatically
- Advanced issue detection: Spots subtle race conditions, performance bottlenecks, and security vulnerabilities
Usage-based Add-On (Pay-as-you-Go)
- Assigned-seat users use their plan allowance first
- Usage is billed only for eligible over-limit reviews
- Full control over usage and spending caps through the dashboard
- Postpaid billing — each over-limit file is added to your monthly invoice
CLI with Usage-based Add-on
The usage-based add-on lets eligible CodeRabbit CLI reviews continue after the applicable review limit is reached. Authenticated CLI and agentic API-key reviews use the assigned user’s plan allowance first. Usage is billed only when a review continues over that limit. See usage-based add-on pricing for per-file rates. Usage is added to your monthly invoice. Enable pay-as-you-go and set a spending cap from the Subscription and Billing dashboard for US or EU. This self-serve launch excludes Enterprise organizations.Enable the add-on
Authenticate with your API key
--api-key KEY to a review directly, but if you plan to make multiple calls, it is more convenient to authenticate once with your CodeRabbit API key:Run a CodeRabbit review