Use CodeRabbit CLI to perform automated code review and iterative improvement in an AI agent workflow. Use when: (1) After generating non-trivial code (new features, refactors, algorithms), (2) Improving code quality, maintainability, or readability before submission, (3) Validating code changes against best practices, (4) Exploring unfamiliar languages, patterns, or domains, or (5) Creating a self-reviewing coding loop. Requires CodeRabbit CLI installed and authenticated. Not for trivial changes (typos, formatting-only) or rapid prototyping without quality constraints.
Use CodeRabbit CLI to perform structured, automated code review and iterative improvement, enabling AI agents to write, review, and refine code in a tight feedback loop.
npm install -g @coderabbitai/cli or see docs.coderabbit.aicoderabbit auth login (one-time setup).coderabbit.yaml)Run review on current changes:
coderabbit review --plain
Get token-efficient summary:
coderabbit review --prompt-only
Limit scope to local changes:
coderabbit review --plain --type uncommitted
Limit scope by base branch or commit:
coderabbit review --plain --base main
Write the requested code or changes following project conventions and requirements.
Choose the appropriate review mode based on context:
Detailed feedback mode (recommended for active development):
coderabbit review --plain
Token-efficient mode (for tight token budgets):
coderabbit review --prompt-only
Limit scope (when focusing on particular changes):
--type uncommitted to review only local changes--base or --base-commit to compare against a specific baselineCodeRabbit provides feedback in several categories:
Key principles for analyzing feedback:
Apply meaningful improvements based on CodeRabbit's feedback:
Document rationale for significant changes or when choosing not to apply suggestions.
For significant changes or when addressing critical issues, re-run CodeRabbit to validate improvements:
coderabbit review --plain
This creates an iterative improvement loop until code quality meets standards.
When implementing new features:
coderabbit review --plain for comprehensive feedbackWhen preparing code for human review:
git add .coderabbit review --plain to catch issues earlyWhen working with new languages, frameworks, or patterns:
coderabbit review --plain to learn best practicesWhen improving existing code:
coderabbit review --plain to ensure no regressionsReview all uncommitted changes:
coderabbit review
Plain text output (detailed):
coderabbit review --plain
Prompt-only output (token-efficient):
coderabbit review --prompt-only
Review only uncommitted changes:
coderabbit review --type uncommitted
Review changes against a base:
coderabbit review --base main
Review staged changes:
git add .
coderabbit review
CodeRabbit automatically detects and reviews staged changes when they exist. The coderabbit review command will review all uncommitted changes (both staged and unstaged) by default.
Note: the current CodeRabbit CLI does not support a
--filesoption. To limit scope (or avoid file-count limits), rely on--type,--base, or--base-commit, or use git to stage only the changes you want reviewed.
Login to CodeRabbit:
coderabbit auth login
Check authentication status:
coderabbit auth status
CodeRabbit can be configured via .coderabbit.yaml in the repository root:
language: "en-US"
reviews:
review_status: false # Suppress auto-generated status comments
pre_merge_checks:
docstrings:
mode: "off" # Disable docstring coverage checks
See CodeRabbit Configuration for full options.
git add .git commit -m "feat: implement feature"coderabbit review --plainWhen using CodeRabbit in an agent workflow:
--prompt-only when operating under tight token budgets--plain during active development for detailed feedbackSearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer