Skip to main content
CodeRabbit provides two path controls. Path filters exclude files that don’t benefit from review: lock files, binaries, and generated code. Path instructions apply targeted guidance to specific paths, such as security checks for API controllers, coverage requirements for tests, or clarity rules for documentation.
If your team already has coding guidelines and standards documented, point CodeRabbit to them using Code Guidelines.

Path instructions

Add custom review instructions for specific file paths using glob patterns. Instructions let you tell CodeRabbit exactly what to focus on for any part of the codebase.

Configure path instructions

.coderabbit.yaml
Paths accept glob patterns. See the minimatch documentation for more information.
Path instructions only affect CodeRabbit’s review guidance for matching files. They do not disable other features that inspect the same code. For example, suppressing docstring-related review guidance with reviews.path_instructions does not disable Generate docstrings or the Docstring Coverage pre-merge check.

When to add path instructions

CodeRabbit’s built-in review logic covers a wide range of issues by default. Path instructions work best as a targeted supplement, not a replacement.
  • Observe a few reviews first. If something is consistently missed or needs to be applied differently for a specific part of the codebase, that’s a good candidate for a path instruction.
  • When you identify a gap, consider which mechanism fits best:
    • Path instructions — rules scoped to specific files or directories in CodeRabbit’s review.
    • Code guidelines — existing standards documents (like AGENTS.md or .cursorrules) that CodeRabbit picks up automatically, and that also benefit AI coding agents.
    • Custom checks — pass/fail conditions you define that run as part of every review.
After CodeRabbit has reviewed several pull requests, it may have accumulated path-instruction suggestions. Post @coderabbitai emit path instructions as a PR comment to collect suggestions from the past 7 days and open a pull request that merges them into your .coderabbit.yaml without overwriting existing entries. See the command reference for details.

Path filters

Path filters control which files CodeRabbit includes or excludes from review. Excluding irrelevant files, such as lock files, binaries, and generated code, keeps reviews focused and fast. CodeRabbit ships with sensible defaults, but you can extend the ignore list with your own patterns, or override defaults to force-include paths that would otherwise be skipped.

Configure path filters

Patterns prefixed with ! exclude paths from review (for example, !src/generated/** skips generated code). Patterns without ! include paths.
Path filters define CodeRabbit’s review scope. Files excluded here, or skipped by the default ignored paths below, do not appear in CodeRabbit review surfaces such as the walkthrough or Change Stack. GitHub can still show those files in the pull request’s full file list.
.coderabbit.yaml

How path filters combine

Using only !**/*.json and **/package.json excludes every file: the include limits review to package manifests, then the exclusion removes them. Narrow the exclusion instead of adding an include exception.
Path filters also influence repository checkout. Git’s sparse-checkout rules differ from review matching, so tools may see a different file set.

Default ignored paths

CodeRabbit skips the paths below by default. To override one, copy its exact pattern without the leading !, for example **/*.tsv. Broad patterns such as src/** do not override defaults.

What’s next

AST-based instructions

Write review instructions using ast-grep rules for precise, syntax-aware review instructions.

Code guidelines

Point CodeRabbit to your existing coding standards documents: AGENTS.md, .cursorrules, and similar files.

Custom checks

Define pass/fail conditions that run as part of every review to enforce your team’s standards automatically.