coderabbit-cli

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.

7 stars

Best use case

coderabbit-cli is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using coderabbit-cli should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/coderabbit-cli/SKILL.md --create-dirs "https://raw.githubusercontent.com/lambda-curry/devagent/main/ai-rules/skills/coderabbit-cli/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/coderabbit-cli/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How coderabbit-cli Compares

Feature / Agentcoderabbit-cliStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# CodeRabbit CLI

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.

## Prerequisites

- CodeRabbit CLI installed: `npm install -g @coderabbitai/cli` or see [docs.coderabbit.ai](https://docs.coderabbit.ai)
- Authenticated: `coderabbit auth login` (one-time setup)
- Git repository: Run commands from within a git repository. CodeRabbit reviews: unstaged working-tree changes, staged-but-uncommitted changes, and local commits not yet pushed. Does not run on a clean working tree with no local changes.
- Repository context: CodeRabbit needs access to repository metadata (can be configured via `.coderabbit.yaml`)

## Quick Start

**Run review on current changes:**
```bash
coderabbit review --plain
```

**Get token-efficient summary:**
```bash
coderabbit review --prompt-only
```

**Limit scope to local changes:**
```bash
coderabbit review --plain --type uncommitted
```

**Limit scope by base branch or commit:**
```bash
coderabbit review --plain --base main
```

## AI Agent Review Workflow

### 1. Implement Code

Write the requested code or changes following project conventions and requirements.

### 2. Run CodeRabbit Review

Choose the appropriate review mode based on context:

**Detailed feedback mode** (recommended for active development):
```bash
coderabbit review --plain
```

**Token-efficient mode** (for tight token budgets):
```bash
coderabbit review --prompt-only
```

**Limit scope** (when focusing on particular changes):
- Use `--type uncommitted` to review only local changes
- Use `--base` or `--base-commit` to compare against a specific baseline

### 3. Analyze Feedback

CodeRabbit provides feedback in several categories:

- **Correctness issues**: Bugs, logic errors, type safety problems
- **Readability improvements**: Code clarity, naming, structure
- **Maintainability suggestions**: Best practices, patterns, technical debt
- **Security concerns**: Vulnerabilities, unsafe patterns
- **Performance optimizations**: Efficiency improvements

**Key principles for analyzing feedback:**
- Treat CodeRabbit as a senior reviewer: reason about suggestions, don't blindly apply them
- Prioritize correctness and security issues first
- Consider maintainability and readability improvements
- Evaluate performance suggestions in context of actual requirements
- Some suggestions may be stylistic or context-dependent

### 4. Revise Code

Apply meaningful improvements based on CodeRabbit's feedback:

- Fix correctness issues immediately
- Address security concerns
- Improve readability where it adds value
- Apply maintainability suggestions that align with project patterns
- Consider performance optimizations if they're relevant

**Document rationale** for significant changes or when choosing not to apply suggestions.

### 5. Re-review (Optional)

For significant changes or when addressing critical issues, re-run CodeRabbit to validate improvements:

```bash
coderabbit review --plain
```

This creates an iterative improvement loop until code quality meets standards.

## Usage Patterns

### After Feature Implementation

When implementing new features:

1. Complete the feature implementation
2. Run `coderabbit review --plain` for comprehensive feedback
3. Address critical and major issues
4. Re-review if significant changes were made
5. Proceed with submission when quality gates pass

### Before PR Submission

When preparing code for human review:

1. Stage all changes: `git add .`
2. Run `coderabbit review --plain` to catch issues early
3. Fix all actionable feedback
4. Re-run review to confirm fixes
5. Submit PR with confidence that basic quality checks pass

### Exploring Unfamiliar Domains

When working with new languages, frameworks, or patterns:

1. Implement initial solution
2. Run `coderabbit review --plain` to learn best practices
3. Study feedback to understand domain conventions
4. Revise code applying learned patterns
5. Use as learning tool to understand idiomatic code

### Refactoring Existing Code

When improving existing code:

1. Make refactoring changes
2. Run `coderabbit review --plain` to ensure no regressions
3. Verify feedback aligns with refactoring goals
4. Address any new issues introduced
5. Confirm code quality improved or maintained

## Command Reference

### Basic Review Commands

**Review all uncommitted changes:**
```bash
coderabbit review
```

**Plain text output (detailed):**
```bash
coderabbit review --plain
```

**Prompt-only output (token-efficient):**
```bash
coderabbit review --prompt-only
```

**Review only uncommitted changes:**
```bash
coderabbit review --type uncommitted
```

**Review changes against a base:**
```bash
coderabbit review --base main
```

**Review staged changes:**

```bash
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 `--files` option. 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.

### Authentication

**Login to CodeRabbit:**
```bash
coderabbit auth login
```

**Check authentication status:**
```bash
coderabbit auth status
```

### Configuration

CodeRabbit can be configured via `.coderabbit.yaml` in the repository root:

```yaml
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](https://docs.coderabbit.ai/configuration) for full options.

## Integration with Development Workflow

### With Git Workflow

1. Make code changes
2. Stage changes: `git add .`
3. Run CodeRabbit review
4. Fix issues
5. Commit with confidence: `git commit -m "feat: implement feature"`
6. Push and create PR

### With AI Agent Workflows

1. Agent implements code based on requirements
2. Agent runs `coderabbit review --plain`
3. Agent analyzes feedback and identifies actionable issues
4. Agent revises code addressing feedback
5. Agent optionally re-runs review to validate fixes
6. Agent documents changes and rationale
7. Agent proceeds with next steps (tests, documentation, etc.)

## Quality Bar

When using CodeRabbit in an agent workflow:

- **Address correctness issues**: All bugs and logic errors must be fixed
- **Consider security concerns**: Security issues should be addressed or documented
- **Evaluate maintainability**: Apply suggestions that align with project patterns
- **Reason about feedback**: Don't blindly apply all suggestions; understand intent
- **Document decisions**: When choosing not to apply suggestions, note rationale

## When Not to Use

- **Trivial changes**: Typos, formatting-only edits, simple renames
- **Rapid prototyping**: When speed is more important than quality
- **Repository not initialized**: CodeRabbit needs git context
- **No local changes**: Nothing to review if working tree is clean (no unstaged, staged, or uncommitted local changes)

## Best Practices

### Token Management

- Use `--prompt-only` when operating under tight token budgets
- Use `--plain` during active development for detailed feedback
- Focus on actionable feedback rather than reading all suggestions

### Feedback Analysis

- Prioritize critical and major issues
- Group similar suggestions for efficient addressing
- Consider context when evaluating stylistic suggestions
- Some suggestions may conflict with project conventions

### Iterative Improvement

- Don't try to address all feedback in one pass
- Focus on correctness and security first
- Re-review after significant changes
- Use feedback as learning opportunity

## Reference Documentation

- **CodeRabbit CLI Docs**: [docs.coderabbit.ai/cli](https://docs.coderabbit.ai/cli)
- **Configuration Reference**: [docs.coderabbit.ai/configuration](https://docs.coderabbit.ai/configuration)
- **Review Guidelines**: See [references/cli-commands.md](references/cli-commands.md) for complete command reference

Related Skills

ai-rules-cli

7
from lambda-curry/devagent

Use ai-rules CLI to manage and synchronize AI coding rules across multiple AI assistants (Cursor, Claude Code, GitHub Copilot, Opencode, etc.). Use when: (1) Setting up ai-rules in a new project, (2) Updating AI coding guidelines and best practices, (3) Generating platform-specific rule files from source, (4) Checking if generated files are in sync with source files, (5) Managing multi-agent rule consistency, or (6) Adding new rules or modifying existing ones. Requires ai-rules CLI installed. The ai-rules/ directory serves as the single source of truth for all AI coding guidelines.

worktree-setup-hook

7
from lambda-curry/devagent

Post-checkout git hook for automatic worktree setup. Use when: (1) Setting up automatic configuration for new git worktrees, (2) Creating post-checkout hooks that detect new worktrees and run setup tasks, (3) Configuring worktrees to automatically copy env files and install dependencies

skill-creator

7
from lambda-curry/devagent

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

GitHub CLI Operations

7
from lambda-curry/devagent

Use GitHub CLI (gh) to interact with GitHub repositories, pull requests, issues, and workflows. Use when: (1) Reading PR details, diffs, or metadata, (2) Listing or filtering PRs and issues, (3) Creating PR comments or linking to issues, (4) Checking CI status or mergeability, (5) Extracting issue references from PR descriptions, or (6) Any GitHub repository operation via command line. Requires GitHub CLI installed and authenticated.

git-workspace

7
from lambda-curry/devagent

Work with git worktrees and workspaces for concurrent development. Use when: (1) Creating new workspaces with \`git worktree add\`, (2) Listing existing worktrees with \`git worktree list\`, (3) Removing worktrees with \`git worktree remove\`, (4) Pruning stale worktree metadata with \`git worktree prune\`, (5) Managing multiple checked-out branches simultaneously, (6) Migrating uncommitted work between workspaces, or (7) Any git workspace/worktree operation. Requires Git 2.5+ for worktree support.

create-slash-command

7
from lambda-curry/devagent

Create new slash commands for DevAgent workflows. Use when you need to create a new command file in .agents/commands/ and symlink it to .cursor/commands/ for Cursor IDE integration. This skill handles the complete command creation workflow including file generation, symlink creation, and structure validation.

coderabbit-webhooks-events

1868
from jeremylongshore/claude-code-plugins-plus-skills

Implement CodeRabbit webhook signature validation and event handling. Use when setting up webhook endpoints, implementing signature verification, or handling CodeRabbit event notifications securely. Trigger with phrases like "coderabbit webhook", "coderabbit events", "coderabbit webhook signature", "handle coderabbit events", "coderabbit notifications".

coderabbit-upgrade-migration

1868
from jeremylongshore/claude-code-plugins-plus-skills

Update CodeRabbit configuration for new features, migrate between plans, and adopt new capabilities. Use when CodeRabbit releases new features, upgrading from Free to Pro plan, or updating .coderabbit.yaml schema for new options. Trigger with phrases like "upgrade coderabbit", "coderabbit new features", "update coderabbit config", "coderabbit plan upgrade", "coderabbit changelog".

coderabbit-security-basics

1868
from jeremylongshore/claude-code-plugins-plus-skills

Configure CodeRabbit for security-focused code review with secret detection and vulnerability scanning. Use when setting up security review rules, configuring secret detection in PRs, or hardening CodeRabbit configuration for compliance requirements. Trigger with phrases like "coderabbit security", "coderabbit secrets", "secure coderabbit", "coderabbit vulnerability detection", "coderabbit security review".

coderabbit-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Apply production-ready CodeRabbit automation patterns using GitHub API and PR comments. Use when building automation around CodeRabbit reviews, processing review feedback programmatically, or integrating CodeRabbit into custom workflows. Trigger with phrases like "coderabbit automation", "coderabbit API patterns", "automate coderabbit", "coderabbit github api", "process coderabbit reviews".

coderabbit-reference-architecture

1868
from jeremylongshore/claude-code-plugins-plus-skills

Implement CodeRabbit reference architecture with production-grade .coderabbit.yaml configuration. Use when designing review configuration for a new project, establishing team standards, or building a comprehensive review setup from scratch. Trigger with phrases like "coderabbit architecture", "coderabbit best practices", "coderabbit project structure", "coderabbit reference config", "coderabbit full setup".

coderabbit-rate-limits

1868
from jeremylongshore/claude-code-plugins-plus-skills

Understand and handle CodeRabbit and GitHub API rate limits for review automation. Use when hitting rate limits on @coderabbitai commands, automating review queries, or building scripts that interact with CodeRabbit via the GitHub API. Trigger with phrases like "coderabbit rate limit", "coderabbit throttling", "coderabbit too many requests", "github api rate limit coderabbit".