> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex integration

> AI-powered code review in Codex through the CodeRabbit plugin. Let AI code, review, and fix issues autonomously without human intervention.

## Get continuous code review with Codex

The CodeRabbit plugin for Codex creates autonomous AI development workflows. Codex can trigger CodeRabbit reviews directly through natural-language prompts, enabling you to build features, run code reviews, and fix issues without manual context switching.

This integration makes AI coding more independent, with built-in quality gates that catch issues before they reach production.

<Info>
  This guide covers using the CodeRabbit plugin with Codex. For standalone CLI
  usage, see [CLI overview](/cli/index).
</Info>

CodeRabbit analyzes your code changes and surfaces specific issues, then Codex applies fixes based on that review context.

## Why integrate these tools

<CardGroup cols={2}>
  <Card title="Expert issue detection" icon="search-code">
    CodeRabbit spots race conditions, memory leaks, and logic errors that generic linters miss. Get the same pattern recognition that powers our PR reviews.
  </Card>

  <Card title="AI-powered fixes" icon="wand-sparkles">
    Codex implements fixes with full context from CodeRabbit's analysis. Complex architectural changes handled intelligently.
  </Card>

  <Card title="Context preservation" icon="brain">
    The plugin keeps review context inside Codex so findings can be turned into follow-up fixes without re-explaining the problem.
  </Card>

  <Card title="Continuous workflow" icon="refresh-cw">
    Stay in development flow - run reviews, apply fixes, and iterate without switching tools or losing mental context.
  </Card>
</CardGroup>

## Installation

<Steps>
  <Step title="Install Codex">
    Install Codex following the [platform-specific instructions](https://developers.openai.com/codex/cli). Ensure you can launch Codex from your terminal.
  </Step>

  <Step title="Install and authenticate CodeRabbit CLI">
    Install and authenticate the CodeRabbit CLI:

    <CodeGroup>
      ```bash Installation script theme={null}
      curl -fsSL https://cli.coderabbit.ai/install.sh | sh
      ```

      ```bash Homebrew theme={null}
      brew install coderabbit
      ```
    </CodeGroup>

    ```bash Authenticate theme={null}
    coderabbit auth login
    ```

    A browser window opens automatically. Sign in to CodeRabbit and the authentication completes in the browser.
  </Step>

  <Step title="Install CodeRabbit plugin">
    <Tabs>
      <Tab title="Codex app">
        Open the [plugin marketplace](https://developers.openai.com/codex/plugins), search for `coderabbit`, and install the CodeRabbit plugin.
      </Tab>

      <Tab title="Codex CLI">
        Open the [plugin directory](https://developers.openai.com/codex/plugins#plugin-directory-in-the-cli) inside Codex using the `/plugins` command, then search for `coderabbit` and install the CodeRabbit plugin.

        ```text theme={null}
        /plugins
        ```
      </Tab>
    </Tabs>

    <Info>
      If the plugin does not appear immediately after installation, reload or restart Codex so it refreshes the local plugin catalog.
    </Info>
  </Step>

  <Step title="Verify installation">
    Ask Codex to run a CodeRabbit review:

    ```text theme={null}
    Review my current changes with CodeRabbit
    ```

    The plugin will verify your CodeRabbit CLI installation and authentication when first used.
  </Step>
</Steps>

## Usage

### Running code reviews

<Tabs>
  <Tab title="Natural language">
    Use natural language to trigger the plugin from Codex:

    ```text theme={null}
    Review my current changes with CodeRabbit
    ```
  </Tab>

  <Tab title="@ mention">
    Type `@` to invoke the plugin or one of its bundled skills explicitly. Use this when you want to be specific about which plugin or skill Codex should use.

    ```text theme={null}
    @coderabbit Review my current changes
    ```
  </Tab>
</Tabs>

The plugin will:

* verify CLI installation and authentication
* run the review
* summarize the diff first
* report how many findings CodeRabbit found
* present findings with severity, file path, impact, and recommended fix direction

Customize your review by being explicit about scope:

```text theme={null}
Review my committed changes with CodeRabbit
Review my uncommitted changes with CodeRabbit
Review this branch against main with CodeRabbit
Check my branch for security issues with CodeRabbit
What are the highest-risk issues in these changes?
```

For longer reviews, Codex should wait quietly for completion rather than narrating intermediate polling or processing states.

## Integration workflow

### Use CodeRabbit while building new features

<Steps>
  <Step title="Request implementation + review">
    Ask Codex to implement a feature and run a CodeRabbit review:

    ```text Sample prompt wrap theme={null}
    Please implement phase 7.3 of the planning doc and then review it with CodeRabbit. Fix any issues that are found.
    ```

    Key components:

    * **Implement the feature**: Codex codes the requested functionality
    * **Run CodeRabbit review**: Uses the plugin to analyze code
    * **Fix issues**: Codex addresses the problems CodeRabbit identifies
  </Step>

  <Step title="Codex implements and triggers review">
    Codex:

    1. Implements the requested feature
    2. Runs the CodeRabbit plugin review flow
    3. Waits for the analysis to complete
  </Step>

  <Step title="CodeRabbit analysis and task creation">
    When CodeRabbit completes, Codex:

    1. Summarizes the changes in the diff
    2. Reports how many findings were found
    3. Works through each finding with severity, file path, impact, and fix direction
  </Step>

  <Step title="Automated issue resolution">
    Codex systematically works through the findings, implementing fixes and iterating until the important issues are resolved.
  </Step>
</Steps>

## Advanced usage

### CLI output modes

When running the CodeRabbit CLI directly outside the plugin, use the output mode that best fits your workflow:

```bash theme={null}
# Agent mode - structured JSON output for agent workflows
coderabbit --agent

# Plain mode - detailed terminal output
coderabbit --plain

# Interactive mode - terminal UI for manual review
coderabbit --interactive
```

| Mode            | Best for                                               |
| --------------- | ------------------------------------------------------ |
| `--agent`       | Agent workflows and structured output consumers        |
| `--plain`       | Human-readable terminal output during manual workflows |
| `--interactive` | Manual review in an interactive terminal UI            |

The Codex plugin chooses the appropriate review flow automatically, so direct CLI usage is mainly useful for debugging or manual review.

### Configure CodeRabbit for Codex

CodeRabbit automatically reads your `AGENTS.md` file, so you can add context there on how code reviews should run, your coding standards, and architectural preferences.

<Info>This is a Pro paid plan feature.</Info>

## Remove or turn off a plugin

To remove the CodeRabbit plugin, reopen it from the plugin browser and select **Uninstall plugin**.

<Info>
  Uninstalling the plugin removes the plugin bundle from Codex, but the CodeRabbit CLI remains installed and continues to work independently.
</Info>

To keep the plugin installed but disable it temporarily, set its entry in `~/.codex/config.toml` to `enabled = false`, then restart Codex.

## Troubleshooting

### Plugin not found

If the plugin isn't available:

1. **Reload Codex**: Restart or reload Codex after installation so it refreshes the plugin catalog
2. **Check plugin installation**: Confirm `CodeRabbit` appears in the Codex plugin marketplace and is enabled
3. **Reinstall if needed**: Remove and reinstall the plugin from the marketplace

### CLI not authenticated

If you see authentication errors:

1. **Check CLI authentication**: Run `coderabbit auth status --agent`
2. **Re-authenticate**: Run `coderabbit auth login --agent`
3. **Verify CLI installation**: Ensure the CLI is in your PATH and accessible from Codex's environment

### CodeRabbit not finding issues

If CodeRabbit isn't detecting expected issues:

1. **Check git status**: CodeRabbit analyzes tracked changes - run `git status` to verify
2. **Specify review scope**: Ask Codex to review committed, uncommitted, or base-branch changes explicitly
3. **Review file types**: CodeRabbit focuses on code files, not docs or configuration
4. **Run the CLI directly**: Use `coderabbit --plain` if you want to inspect findings outside the plugin flow

### Review taking too long

CodeRabbit reviews may take several minutes depending on the scope of changes:

1. **Review smaller changesets**: Work on focused branches and smaller diffs
2. **Limit the scope**: Ask Codex to review only committed or uncommitted changes
3. **Set the right base branch**: Be explicit when your comparison point is not `main`
4. **Let the review finish**: Long-running reviews are expected; the plugin should wait quietly rather than reporting intermediate polling states

<Info>
  The integration creates a more thorough review process than either tool alone.
  Expect comprehensive analysis that catches issues that would otherwise reach
  production.
</Info>

## What's next

<CardGroup cols={1}>
  <Card title="Claude Code integration" href="/cli/claude-code-integration" icon="bot" horizontal>
    Compare the Codex plugin flow with the Claude Code plugin workflow and command surface.
  </Card>

  <Card title="Command-Line Review Tool" href="/cli/index" icon="terminal" horizontal>
    Use the standalone CodeRabbit CLI directly when you want manual review workflows outside Codex.
  </Card>

  <Card title="CodeRabbit Skills" href="/cli/skills" icon="wand-sparkles" horizontal>
    Explore the skill-based integration path for other AI coding agents that support Skills.
  </Card>
</CardGroup>
