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

# Create your first configuration

> Decide where your settings live, then set the five settings that change reviews the most.

CodeRabbit's defaults give good reviews without any configuration. You get much more when you tune it to your product: how strict it is, the rules your team follows, and the files and pull requests that matter. This page covers the first decision and the five settings that change reviews the most.

## Decide where your settings live

CodeRabbit serves everyone from one-person startups to enterprises with hundreds of thousands of repositories, so settings can live in many places. For most teams the answer is simple: a `.coderabbit.yaml` file in the repository. Use the web app if you prefer a UI, and reach for central configuration, global overrides and the other places only when you manage many repositories.

You can configure CodeRabbit in the web app or in a `.coderabbit.yaml` file in the repository. Decide first, because the two don't add up.

| | Web app | `.coderabbit.yaml` |
| - | - | - |
| Good for | Trying settings, and one baseline for every repository through **Organization defaults** | Settings that belong to one repository and change with its code |
| How changes are made | Saved in the web app, effective right away | Committed and reviewed in a pull request, like code |
| Applies to | **Organization defaults**: every repository with no configuration file of its own and no central configuration, and repositories whose file turns on inheritance. **Repository settings**: one repository, while its **Use organization settings** toggle is off | The repository that contains it |
| Available on | CodeRabbit Cloud | Every Git platform, on CodeRabbit Cloud and self-hosted CodeRabbit |

> [!WARNING]
>
> A configuration file replaces the web app settings. When a repository has `.coderabbit.yaml`, CodeRabbit ignores that repository's web app settings and **Organization defaults**, unless [inheritance](https://docs.coderabbit.ai/configuration/inheritance-and-merging.md) is on, for example because the file sets `inheritance: true`.

A file also makes it easy to experiment. Push two branches with the same code changes but different `.coderabbit.yaml` settings, open a pull request from each, and compare the reviews. It's a good way to learn how CodeRabbit responds to settings. This works with the default **Configuration source** when both branches are in the same repository and you're a [trusted](https://docs.coderabbit.ai/configuration/branch.md#who-counts-as-trusted) author there, because CodeRabbit then reviews each pull request with the file on its own branch.

To move web app settings into a file later, comment `@coderabbitai generate configuration` on a pull request. CodeRabbit opens a pull request that adds `.coderabbit.yaml` with your current settings. For every other place settings can live, see [Compare every place settings can live](https://docs.coderabbit.ai/configuration.md#compare-every-place-settings-can-live).

> [!NOTE]
>
> For advanced setups, `.coderabbit.config.ts` lets you compute settings in TypeScript, for example by base branch or changed paths, or by composing shared fragments. CodeRabbit uses it only when the repository has no YAML file. See [TypeScript configuration](https://docs.coderabbit.ai/configuration/typescript.md).

## Set how strict reviews are

The review profile decides which findings become inline comments. `chill` is the default. Use `assertive` for every finding, including trivial ones, or `quiet` for critical and major findings only.

> [tab] In the app
>
> Go to **Reviews > General** and choose **Profile**.

> [tab] YAML
>
> ```yaml .coderabbit.yaml theme={null}
> reviews:
>   profile: "assertive"
> ```

More: [Set review strictness, tone and language](https://docs.coderabbit.ai/pr-reviews/review-style.md).

## Teach CodeRabbit your rules

Path instructions are the biggest step from generic reviews to reviews that know your product. Each one pairs a glob pattern with what to check in matching files. Concrete rules work better than general advice.

> [tab] In the app
>
> Go to **Reviews > General** and add entries under **Path instructions**.

> [tab] YAML
>
> ```yaml .coderabbit.yaml theme={null}
> reviews:
>   path_instructions:
>     - path: "src/api/**"
>       instructions: |
>         Check that every endpoint validates input and checks authorization.
>         Flag database queries that bypass the data access layer.
> ```

More: [Teach CodeRabbit your review rules](https://docs.coderabbit.ai/pr-reviews/review-instructions.md) and [Write review instructions that work](https://docs.coderabbit.ai/configuration/guides/write-instructions.md).

## Skip files that don't need review

CodeRabbit already skips lock files, build output, generated code and binary files. Add your own exclusions, such as third-party code in `vendor` or test fixtures.

> [tab] In the app
>
> Go to **Reviews > General** and add patterns under **Path filters**.

> [tab] YAML
>
> ```yaml .coderabbit.yaml theme={null}
> reviews:
>   path_filters:
>     - "!**/vendor/**"
>     - "!**/fixtures/**"
> ```

> [!WARNING]
>
> Start every pattern with `!`. A pattern without `!`, such as `src/**`, turns the list into an allowlist, and CodeRabbit stops reviewing everything else.

More: [Choose which files are reviewed](https://docs.coderabbit.ai/pr-reviews/which-files.md).

## Choose which pull requests get reviewed

By default, CodeRabbit reviews every pull request that targets the default branch, except drafts. Add branches such as release branches, or turn on draft reviews.

> [tab] In the app
>
> Go to **Reviews > Auto review**.

> [tab] YAML
>
> ```yaml .coderabbit.yaml theme={null}
> reviews:
>   auto_review:
>     drafts: false
>     base_branches:
>       - "^release/.*$"
> ```

Each `base_branches` entry is a regular expression, added to the default branch. Use `^` and `$` for an exact match.

> [!NOTE]
>
> Each push to a pull request that CodeRabbit already reviewed starts another review, and each review counts toward your [rate limits](https://docs.coderabbit.ai/management/rate-limits.md). If you hit them often, tune incremental reviews under `reviews.auto_review`. Lower `auto_pause_after_reviewed_commits` (default `5`) so automatic reviews pause sooner, or set `auto_incremental_review` to `false` so only the first push is reviewed automatically. Comment `@coderabbitai review` whenever you want another review.

More: [Control when reviews run](https://docs.coderabbit.ai/pr-reviews/when-reviews-run.md).

## Reuse the rules you already wrote

If your repository has guideline files for coding agents, such as `AGENTS.md`, `CLAUDE.md` or `.cursorrules`, CodeRabbit already uses them as review criteria. There's nothing to set. Each file applies to its own directory and everything below it.

More: [Code guidelines](https://docs.coderabbit.ai/knowledge-base/code-guidelines.md).

## The whole file

With all four settings, a `.coderabbit.yaml` looks like this. The first line gives editors autocomplete and validation.

```yaml .coderabbit.yaml theme={null}
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
reviews:
  profile: "assertive"
  path_instructions:
    - path: "src/api/**"
      instructions: |
        Check that every endpoint validates input and checks authorization.
        Flag database queries that bypass the data access layer.
  path_filters:
    - "!**/vendor/**"
    - "!**/fixtures/**"
  auto_review:
    drafts: false
    base_branches:
      - "^release/.*$"
```

For complete starters by stack, see [Example configurations](https://docs.coderabbit.ai/configuration/examples).

## Check that it worked

Comment `@coderabbitai configuration` on a pull request. CodeRabbit replies with the configuration the review uses. Each value has a `# Source:` comment that names where it came from, such as `Repository YAML` or `defaults`.

With the default **Configuration source**, when a repository member adds the file in a pull request from a branch in the same repository, that pull request is already reviewed with it. Otherwise it applies after it merges. See [Check which configuration a review used](https://docs.coderabbit.ai/configuration/guides/check-effective-configuration.md).

## What's next

> [card] [Write review instructions that work](https://docs.coderabbit.ai/configuration/guides/write-instructions.md)
>
> Turn your team's rules into instructions CodeRabbit follows.

> [card] [Reduce review noise](https://docs.coderabbit.ai/configuration/guides/reduce-noise.md)
>
> Cut comments your team doesn't act on.

> [card] [Apply settings to every repository](https://docs.coderabbit.ai/configuration/guides/all-repositories.md)
>
> Share one baseline across your organization.


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