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, !dist/** skips the dist folder). Patterns without ! include paths explicitly, which is useful for overriding a default exclusion.
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 CodeRabbit Review. GitHub can still show those files in the pull request’s full file list.
.coderabbit.yaml

Default ignored paths

By default, CodeRabbit intentionally skips certain file paths and extensions — things like lock files, binaries, generated code, and media assets. If you want CodeRabbit to review any of these, you can explicitly include them in your Path Filters configuration.

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.