> ## 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.

# Fix comments: apply CodeRabbit code fixes to pull requests

> Use CodeRabbit Fix comments to automatically implement code changes for unresolved review findings in your pull request as a commit or stacked PR.

GitHub (This feature is available on GitHub and GitHub Enterprise.) GitLab (This feature is available on GitLab.) Azure (This feature is available on Azure DevOps.) Bitbucket Cloud (This feature is available on Bitbucket Cloud.) | Essentials Plan (This feature is available on Essentials (formerly Pro), Team (formerly Pro+), Advanced, and Enterprise. Please refer to our pricing page for more information about our plans and features.)

Fix comments helps you resolve review feedback faster by applying code changes for unresolved CodeRabbit findings in your pull request. Use Fix comments when you want CodeRabbit to implement fixes automatically, then review the resulting commit or stacked PR.

Fix comments runs as a Coding Agent (Turns a user request, a review finding, a coding plan or a failing CI check into a task that CodeRabbit's agent implements in the cloud, then delivers as a commit or a stacked pull request for you to approve.) task. Open the task to follow its activity, steer the work, and review the proposed patch before delivery. See [Work with a coding task](https://docs.coderabbit.ai/code/work-with-a-task.md).

For ongoing automatic fixes and follow-up repairs, use [Autofix](https://docs.coderabbit.ai/code/deliver-changes.md#autofix) instead. You turn it on from the coding task, with `@coderabbitai autofix`, or, on GitHub, with the **Autofix** checkbox in CodeRabbit's PR Walkthrough (A structured comment posted by CodeRabbit at the top of every pull request, summarizing changes, sequence diagrams, review effort, and more.) comment.

## Usage

You can trigger Fix comments from a pull request comment on GitHub, GitLab, Azure DevOps, or Bitbucket Cloud. On GitHub, you can also select the Fix comments checkbox in CodeRabbit's review comment. See [Review comment controls](#review-comment-controls).

```text Open a separate stacked PR with fixes theme={null}
@coderabbitai fix comments stacked pr
```

```text Apply fixes to your current PR branch theme={null}
@coderabbitai fix comments
```

> [!NOTE]
>
> GitHub, GitLab, Azure DevOps, and Bitbucket Cloud support `@coderabbitai fix comments` for direct commits to the current branch and `@coderabbitai fix comments stacked pr` for a stacked pull request. The Fix comments checkbox is available on GitHub only.

### Review comment controls

When a review posts inline findings with fix instructions, CodeRabbit adds Fix comments to the end of its review comment, the one that starts with **Actionable comments posted**.

* **GitHub:** a **Fix comments** checkbox. Select it to run Fix comments on that review's unresolved findings and push a commit to the current branch. If the run fails or is skipped, CodeRabbit shows the result next to the checkbox so you can select it again to retry.
* **GitLab, Azure DevOps, and Bitbucket Cloud:** a Fix comments section that tells you to post `@coderabbitai fix comments`.

The checkbox commits to the current branch. To get the fixes as a separate stacked PR, post `@coderabbitai fix comments stacked pr` instead.

## How it works

**1. Trigger a fix**

Reply with `@coderabbitai fix comments` inside a CodeRabbit review thread to fix only that thread's unresolved finding. Post `@coderabbitai fix comments` in the pull request conversation to fix all unresolved CodeRabbit review threads, or use `@coderabbitai fix comments stacked pr` to request a separate stacked PR. On GitHub, you can also select the Fix comments checkbox in CodeRabbit's review comment.

**2. Collect fix instructions**

CodeRabbit scans unresolved review threads started by CodeRabbit and gathers fix instructions from the **Prompt for AI Agents** blocks. The scanned set depends on where you issued the command: the current review thread for an inline command, or all unresolved CodeRabbit review threads for a command in the pull request conversation.

**3. Generate and verify fixes**

The coding agent applies fixes, then runs a repository setup + build verification step. Even if verification fails, the generated changes are still delivered so you can continue iterating.

**4. Deliver the result**

CodeRabbit pushes a commit to the current branch, or opens a stacked PR when you use `@coderabbitai fix comments stacked pr`.

## Output options

> [card] Commit to current branch
>
> Use `@coderabbitai fix comments` to push a commit directly to your current branch. This is the fastest path when you want fixes in the same review, and it is supported on GitHub, GitLab, Azure DevOps, and Bitbucket Cloud.

> [card] Create stacked PR
>
> Use `@coderabbitai fix comments stacked pr` to open a new branch off your working branch and submit a separate stacked pull request, which lets you review the generated changes independently.

## Configuration

Fix comments is enabled by default. To turn it off for a repository, set `reviews.finishing_touches.autofix.enabled` to `false` in your `.coderabbit.yaml`:

```yaml theme={null}
reviews:
  finishing_touches:
    autofix:
      enabled: false
```

| Field | Required | Default | Description |
| - | - | - | - |
| `enabled` | No | `true` | Set to `false` to disable Fix comments for the repository. |

When Fix comments is disabled:

* The Fix comments checkbox and Fix comments section are hidden from the review comment.
* The `@coderabbitai fix comments` command is removed from the CodeRabbit help output.
* CodeRabbit declines all one-off repair requests, including `@coderabbitai fix comments` and the `fix-comments`, `fix`, `autofix`, `auto-fix`, and `auto fix` aliases, with or without `stacked pr`, and points to this setting.

Fix comments also requires an **Essentials plan or higher**. The configuration toggle only controls availability once your plan already supports Fix comments.

## Scope and limitations

* Fix comments runs only on pull request events.
* Fix comments scope depends on command location. An inline command scopes to the current review thread only. A pull-request-conversation command scopes to all unresolved CodeRabbit review threads. The checkbox in a review comment scopes to that review's unresolved threads.
* Fix comments only processes unresolved CodeRabbit review threads with valid fix instructions.
* When the pull request has merge conflicts, Fix comments exits without making changes. [Resolve the conflicts](https://docs.coderabbit.ai/finishing-touches/resolve-merge-conflict.md) against the base branch, then trigger Fix comments again.
* If no valid unresolved instructions are found, Fix comments skips execution and reports that no fixes were applied.
* Fix comments may be rate-limited. If limits are exceeded, CodeRabbit responds with a wait time before retrying.

## Command reference

Fixes unresolved CodeRabbit review findings and commits the fixes to the pull request branch.

```text wrap theme={null}
@coderabbitai fix comments
```

* **Post in:** A pull request comment or a reply in a review thread
* **Also accepted:** `fix-comments`, `fix`
* **Also accepted with `stacked pr`:** `autofix`, `auto-fix`, `auto fix`
* **Requires:** write access to the repository; [`reviews.finishing_touches.autofix.enabled`](https://docs.coderabbit.ai/reference/configuration#param-reviews-finishing-touches-autofix-enabled) enabled (on by default)

**stacked pr** `suffix`

Commits the fixes to a new branch and opens a stacked pull request against the current branch, instead of committing to the current branch.

```text Deliver the fixes as a stacked pull request wrap theme={null}
@coderabbitai fix comments stacked pr
```

* Posted as a reply in a review thread, it fixes that thread's finding, whoever posted it. Posted in the pull request conversation, it fixes every unresolved CodeRabbit review thread.
* On GitHub, you can also select the **Fix comments** checkbox in CodeRabbit's review comment.
* On GitHub, Fix comments doesn't run on an open pull request from a fork, whether you post the command or select the checkbox. Push the branch to the upstream repository and run it from there.
* `@coderabbitai autofix stacked pr` runs Fix comments once and delivers the fixes as a stacked pull request. Without `stacked pr`, `@coderabbitai autofix` turns on [Autofix](https://docs.coderabbit.ai/reference/review-commands.md#autofix), which keeps fixing the pull request automatically.

Use `fix comments` in new requests. To turn on [Autofix](https://docs.coderabbit.ai/code/deliver-changes.md#turn-on-autofix-from-a-pull-request), post `@coderabbitai autofix`.

## Troubleshooting

> [accordion] Fix comments says no fixes were found
>
> Fix comments only acts on unresolved CodeRabbit review comments that include structured fix instructions. Resolve state, missing instruction blocks, or non-CodeRabbit threads can lead to no-op runs.

> [accordion] Fix comments completed but verification failed
>
> Build/verification can fail after code edits. In this case, CodeRabbit still keeps and delivers the generated fixes so you can continue iteration.

> [accordion] Fix comments says the review has merge conflicts
>
> Fix comments stops before cloning or generating changes when the platform reports that the pull request cannot be merged. Resolve the conflicts with the base branch, then run Fix comments again.
>
> CodeRabbit will also suggest running `@coderabbitai resolve merge conflict` from the Fix comments reply. See [Resolve merge conflicts](https://docs.coderabbit.ai/finishing-touches/resolve-merge-conflict.md) for details.

> [accordion] Stacked PR creation failed
>
> Stacked PR creation may fail due to platform or API limitations. If this happens, use `@coderabbitai fix comments` to apply the fixes as a direct commit to your current branch instead.

> [accordion] Fix comments commands and checkboxes are missing
>
> If the Fix comments checkbox or Fix comments section is absent from a review comment with findings, the command is missing from help, or CodeRabbit replies that Fix comments is disabled for the repository, Fix comments has been turned off in your configuration. Set `reviews.finishing_touches.autofix.enabled` to `true` in your `.coderabbit.yaml` (see [Configuration](#configuration)). Fix comments also requires an Essentials plan or higher.

## What's next

> [card] [Finishing Touches overview](https://docs.coderabbit.ai/finishing-touches.md)
>
> See all available finishing touches and how to trigger them from any PR

> [card] [Custom recipes](https://docs.coderabbit.ai/finishing-touches/custom-finishing-touches.md)
>
> Define reusable, named recipes that encode your team's repeated tasks into one-click agentic actions

> [card] [Resolve merge conflicts](https://docs.coderabbit.ai/finishing-touches/resolve-merge-conflict.md)
>
> Let CodeRabbit analyze the intent behind conflicting changes and commit a clean resolution to your branch


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.