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

# Multi-Repo Analysis

> Link related repositories so CodeRabbit can detect breaking changes, API mismatches, and dependency issues that cross repository boundaries during code review.

export const ProPlusPlanBadge = ({tip = "This feature is available as part of the Pro+ plan and Enterprise plan. Please refer to our pricing page for more information about our plans and features.", title = "Pro+ Plan", cta = "Read more", href = "https://coderabbit.ai/pricing", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="shield-plus" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

export const ProPlanBadge = ({tip = "This feature is available as part of the Pro, Pro+ and Enterprise plans. Please refer to our pricing page for more information about our plans and features.", title = "Pro Plan", cta = "Read more", href = "https://coderabbit.ai/pricing", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="shield-check" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

export const AllPlatformsBadge = ({tip = "This feature is available on all supported platforms: GitHub, GitLab, Azure DevOps, and Bitbucket.", title = "All Platforms", cta, href, disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="globe" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

<AllPlatformsBadge /> | <ProPlanBadge /> <ProPlusPlanBadge />

Many projects are built from multiple interdependent subprojects, for example: a backend service, a frontend app, a mobile client — that share APIs, type definitions, or database schemas. When they're in separate repositories, a change in one can silently break another. To enable CodeRabbit to detect these cross-repository impacts during code review, configure linked repositories for the repositories that depend on each other.

<Info>
  The number of linked repositories you can configure depends on your plan. See [Plans and pricing](/management/plans#linked-repositories) for details.
</Info>

## Use cases

Multi-repo analysis is most valuable when your codebase is split across several repositories that share contracts or dependencies:

* **API contracts** — When a backend API changes, frontend or mobile repositories may need coordinated updates.
* **Microservices architectures** — A change to a service's REST API may break consumers in other repositories.
* **Shared libraries** — Modifications to a shared utility or type definition can have ripple effects across multiple repositories.
* **Database schemas** — Schema changes can affect all services that query the same data model.

## How it works during reviews

When you submit a pull request, CodeRabbit inspects the changes and determines whether they may affect the linked repositories. If the research agent finds relevant cross-repository impact, it includes those findings in the review. If the changes are self-contained and have no cross-repo effect, the agent does not produce findings — this is expected behavior and does not indicate a misconfiguration.

## Where findings appear

Cross-repository findings appear in the pull request review summary comment under **Review details** > **Additional context used**, grouped by linked repository name. Findings also surface in inline review comments and comment replies when relevant.

To see the **Review details** section, enable [`review_details`](/reference/configuration) in your configuration:

```yaml .coderabbit.yaml theme={null}
reviews:
  review_details: true
```

## Setting it up

Linked repositories are configured through the CodeRabbit web interface or via your `.coderabbit.yaml` file.

In most cases, you want to configure this at the **repository level** — for example, linking your frontend repository to your backend, or your client repository to your server. Configuring linked repositories at the organization level applies the same linked repository to *every* repository in your organization, which is rarely what you want. If you need to share a default linked repository across repos while still allowing per-repo overrides, see [configuration inheritance](/configuration/configuration-inheritance).

<Tabs>
  <Tab title="YAML Configuration">
    Add a `linked_repositories` section under `knowledge_base` in your `.coderabbit.yaml` file inside the repository you want to configure (for example, your frontend repo):

    ```yaml .coderabbit.yaml theme={null}
    # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
    knowledge_base:
      linked_repositories:
        - repository: "myorg/backend-api"
          instructions: "Contains REST API endpoints and database models"
    ```
  </Tab>

  <Tab title="Web Interface">
    <Steps>
      <Step title="Open the repository's Knowledge Base settings">
        In the [CodeRabbit app](https://app.coderabbit.ai), navigate to the specific repository you want to configure (for example, your frontend repo), then go to **Knowledge Base** > **Linked Repositories**.
      </Step>

      <Step title="Add a linked repository">
        Click **Add** and enter the repository path in the format used by your platform:
        `org/repo` for GitHub and Bitbucket, `project/repo` for Azure DevOps, or
        `group/subgroup/repo` for GitLab.
      </Step>

      <Step title="Add a description (optional)">
        Optionally provide a description and guidance on what this repository contains so CodeRabbit knows where to focus its search. For example: *"Contains REST API endpoints and database models."*
      </Step>
    </Steps>
  </Tab>
</Tabs>

### Configuration fields

| Field          | Required | Description                                                                                                                            |
| -------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `repository`   | Yes      | Repository in `org/repo` format (GitHub and Bitbucket), `project/repo` format (Azure DevOps), or `group/subgroup/repo` format (GitLab) |
| `instructions` | No       | Description and guidance on what the repository contains (max 2,000 characters)                                                        |

## Platform requirements

The CodeRabbit bot must have read access to all linked repositories.

**Same platform only**: All linked repositories must be on the same platform as the pull request under review. You cannot link a GitHub repository to a GitLab repository, because access tokens are platform-specific.

| Platform                  | Requirement                                                                                                                                                 |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **GitHub**                | The CodeRabbit GitHub App must be installed on all linked repositories. Inaccessible repositories are skipped, and a warning appears in the review summary. |
| **GitLab**                | The bot token must have read access. Tokens are typically scoped to the group or instance.                                                                  |
| **Bitbucket Cloud**       | The bot token must have read access. Tokens are scoped to the workspace.                                                                                    |
| **Bitbucket Data Center** | The HTTP access token must have read access. Tokens are scoped to the project or repository.                                                                |
| **Azure DevOps**          | The PAT must have read access. Tokens are scoped to the organization.                                                                                       |

<Info>
  On GitHub, linked repositories can span multiple organizations as long as the CodeRabbit GitHub App is installed in each organization. Other platforms scope access tokens to the group, workspace, or organization.
</Info>

## Configuration inheritance

When [configuration inheritance](/configuration/configuration-inheritance) is enabled, organization-level and repository-level `linked_repositories` settings are merged. Repository-level entries take priority: if both levels define the same repository, the repository-level instructions are used.

After merging, the list is truncated to your plan's limit, with repository-level entries preserved. If any repositories are dropped during this process, a warning appears in the review summary showing which repositories were kept and which were skipped.

## Plan limits

The number of linked repositories you can activate depends on your plan. See [Plans and pricing](/management/plans#linked-repositories) for current limits.

If your `.coderabbit.yaml` defines more linked repositories than your plan allows:

* **Your configuration is preserved.** CodeRabbit does not delete or reject entries that exceed your plan's limit.
* **Only the first N items are active.** CodeRabbit evaluates entries in the order they appear in your configuration, up to your plan's limit. Entries beyond the limit are ignored during reviews.
* **Upgrade to restore full access.** Moving to a higher plan immediately activates all configured entries up to the new limit.

## Troubleshooting

If cross-repository context is not appearing in reviews, work through these checks in order:

<AccordionGroup>
  <Accordion title="Linked repositories not configured?">
    Check your `.coderabbit.yaml` or the **Settings** UI for a `linked_repositories` section. The feature requires explicit configuration — it is not enabled by default.
  </Accordion>

  <Accordion title="Linked repository is the same as the current repo?">
    Multi-repo analysis filters out the repository currently being reviewed. Make sure you have linked a *different* repository.
  </Accordion>

  <Accordion title="Bot does not have access?">
    On GitHub, the CodeRabbit App must be installed on the linked repository. On other platforms, the bot token must have read access. If a linked repository is inaccessible, a warning appears in the review summary identifying the repository and the specific error.
  </Accordion>

  <Accordion title="Pull request has no cross-repo impact?">
    If the changes in the pull request are self-contained, the research agent will not produce cross-repository findings. This is expected — the absence of findings does not mean the feature is broken.
  </Accordion>
</AccordionGroup>

## What's next

<CardGroup cols={1}>
  <Card title="Knowledge Base overview" href="/knowledge-base" icon="book" horizontal>
    Return to the Knowledge Base overview for all adaptive review features
  </Card>

  <Card title="CodeRabbit Learnings" href="/knowledge-base/learnings" icon="brain" horizontal>
    Use learnings to train CodeRabbit on your team's specific preferences
  </Card>

  <Card title="Model Context Protocol" href="/knowledge-base/mcp-context" icon="plug" horizontal>
    Extend CodeRabbit's understanding with external tools via the MCP
  </Card>
</CardGroup>
