Skip to main content

Prerequisites

Before using Cross Repo Context, make sure you have:
  1. Installed the Augment GitHub App and granted it access to both your primary repository and any external repositories you want to reference. See Install Augment GitHub App for setup instructions.
  2. Configured Augment Code Review for your repositories with review triggers enabled. See the Enterprise Setup Guide or Setup Guide for Other Plans.
  3. Added the Augment MCP server to your Code Review configuration. Navigate to MCP for Code Review and add https://api.augmentcode.com/mcp as a remote MCP server. See MCP Servers for details.

Reviewing code that depends on external repositories

Many projects depend on code that lives in other repositories — SDKs, shared libraries, API contracts, or upstream services. By giving the code review agent visibility into those external codebases, it can provide more accurate and context-aware feedback. Cross Repo Context lets you declare external repositories that Augment Code Review should reference when reviewing pull requests. The code review agent can use external repos to:
  • Understand types and interfaces defined in external SDKs or libraries your code depends on
  • Verify API compatibility by checking how external services define their contracts
  • Validate integration patterns against the source of truth in another repository
  • Catch breaking changes when your code relies on external contracts that may have changed

Configuring Cross Repo Context with AGENTS.md

Cross-repo context is configured through an AGENTS.md file at the root of your repository (<repo-root>/AGENTS.md). If you already have an AGENTS.md, add a cross-repo context section to it.

Example

# External Repositories

Read External Repository descriptions below and whenever the diff relates to or implements
a listed repo, call `augment_code_search` tool with repo_owner, repo_name, and a natural
language query to look up the relevant definitions, get information or have better context
on the changes. Make multiple targeted calls to understand different aspects of the external
code being used. This ensures the review is based on the actual external API. When commenting
on findings, cite the external repo and file path.

- repo: "your-org/payments-sdk"
  description: "Internal SDK for payment processing. Defines transaction types, payment method enums, and refund interfaces. Used as the source of truth for all payment-related API client types."

- repo: "your-org/shared-types"
  description: "Shared TypeScript type definitions used across all services. Includes Order, CartItem, and ShippingAddress interfaces. All services must conform to these shared interfaces."

- repo: "your-org/inventory-service"
  description: "Go microservice for stock reservations and availability checks. The checkout service calls its reservation and stock endpoints during order placement."
The more detail you provide about each external repository, the faster and more efficient the agent’s cross-repo lookups will be.

Customizing the Lookup Instruction

The instruction block at the top of the example tells the code review agent how to use the external repos:
Read External Repository descriptions below and whenever the diff relates to or implements a listed repo, call augment_code_search tool…
This is just a starting point — you can customize it to fit your workflow, and the more specific you make it the more targeted the cross-repo lookups will be.

Best Practices

  • Only add repos that are genuinely relevant. Stick to repos that define interfaces, types, or contracts your code directly depends on.
  • Make sure the Augment GitHub App has access to all external repos. You can update repository access in your GitHub App settings.