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
reviews:
  path_instructions:
    - path: "src/controllers/**"
      instructions: |
        - Focus on authentication, authorization, and input validation.
        - Flag any direct database queries that bypass the ORM layer.
    - path: "tests/**"
      instructions: |
        Review the following unit test code written using the Mocha test library. Ensure that:
        - The code adheres to best practices associated with Mocha.
        - Descriptive test names are used to clearly convey the intent of each test.
        - Edge cases and error paths are covered.
    - path: "docs/**.md"
      instructions: |
        Check for clarity, accuracy, and completeness.
        Flag any references to deprecated APIs or outdated behavior.
Paths accept glob patterns. See the minimatch documentation for more information.

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.

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.
.coderabbit.yaml
reviews:
  path_filters:
    - "!dist/**"
    - "!node_modules/**"
    - "src/**"

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.
Path PatternDescription
!**/dist/**Build output directory
!**/node_modules/**Node.js dependencies
!**/.svelte-kit/**SvelteKit build directory
!**/.webpack/**Webpack build directory
!**/.yarn/**Yarn cache directory
!**/.docusaurus/**Docusaurus build directory
!**/.temp/**Temporary files directory
!**/.cache/**Cache directory
!**/.next/**Next.js build directory
!**/.nuxt/**Nuxt.js build directory
Path PatternDescription
!**/package-lock.jsonnpm lock file
!**/yarn.lockYarn lock file
!**/pnpm-lock.yamlpnpm lock file
!**/bun.lockbBun lock file
!**/*.lockGeneric lock files
Path PatternDescription
!**/generated/**Generated code directory
!**/@generated/**Generated code directory (alternative)
!**/__generated__/**Generated code directory (alternative)
!**/__generated/**Generated code directory (alternative)
!**/_generated/**Generated code directory (alternative)
!**/gen/**Generated code directory (alternative)
!**/@gen/**Generated code directory (alternative)
!**/__gen__/**Generated code directory (alternative)
!**/__gen/**Generated code directory (alternative)
!**/_gen/**Generated code directory (alternative)
Path PatternDescription
!**/*.appApplication bundle
!**/*.binBinary file
!**/*.classJava compiled class
!**/*.dllWindows dynamic library
!**/*.dylibmacOS dynamic library
!**/*.exeWindows executable
!**/*.oObject file
!**/*.soShared object file
!**/*.wasmWebAssembly file
Path PatternDescription
!**/*.bz2Bzip2 archive
!**/*.gzGzip archive
!**/*.xzXZ archive
!**/*.zipZIP archive
!**/*.7z7-Zip archive
!**/*.rarRAR archive
!**/*.zstZstandard archive
!**/*.tarTAR archive
!**/*.jarJava archive
!**/*.warWeb application archive
!**/*.narNAR archive
Path PatternDescription
!**/*.mp3MP3 audio
!**/*.wavWAV audio
!**/*.wmaWMA audio
!**/*.mp4MP4 video
!**/*.aviAVI video
!**/*.mkvMKV video
!**/*.wmvWMV video
!**/*.m4aM4A audio
!**/*.m4vM4V video
!**/*.3gp3GP video
!**/*.3g23G2 video
!**/*.rmRealMedia video
!**/*.movQuickTime video
!**/*.flvFlash video
!**/*.swfFlash animation
!**/*.flacFLAC audio
!**/*.oggOGG audio
Path PatternDescription
!**/*.icoIcon file
!**/*.svgSVG image
!**/*.jpegJPEG image
!**/*.jpgJPEG image
!**/*.pngPNG image
!**/*.gifGIF image
!**/*.bmpBMP image
!**/*.tiffTIFF image
!**/*.webmWebM image
!**/*.ttfTrueType font
!**/*.otfOpenType font
!**/*.woffWeb Open Font Format
!**/*.woff2Web Open Font Format 2
!**/*.eotEmbedded OpenType font
Path PatternDescription
!**/*.pdfPDF document
!**/*.docWord document
!**/*.docxWord document
!**/*.xlsExcel spreadsheet
!**/*.xlsxExcel spreadsheet
!**/*.pptPowerPoint presentation
!**/*.pptxPowerPoint presentation
!**/*.csvCSV data file
!**/*.tsvTSV data file
!**/*.datData file
!**/*.dbDatabase file
!**/*.parquetParquet data file
Path PatternDescription
!**/tagsTags file
!**/.tagsTags file
!**/TAGSTags file
!**/.TAGSTags file
!**/.DS_StoremacOS system file
!**/.cscope.filesCscope files
!**/.cscope.outCscope output
!**/.cscope.in.outCscope input/output
!**/.cscope.po.outCscope output
!**/*.logLog file
!**/*.mapSource map
!**/*.outOutput file
!**/*.sumChecksum file
!**/*.workWork file
!**/*.md5sumMD5 checksum file
Path PatternDescription
!**/*.tgaTarga image
!**/*.ddsDirectDraw surface
!**/*.psdPhotoshop document
!**/*.fbxFBX 3D model
!**/*.objOBJ 3D model
!**/*.blendBlender file
!**/*.daeCOLLADA 3D model
!**/*.gltfGL Transmission Format
!**/*.hlslHLSL shader
!**/*.glslGLSL shader
!**/*.unityUnity scene
!**/*.umapUnreal map
!**/*.prefabUnity prefab
!**/*.matMaterial file
!**/*.shaderShader file
!**/*.shadergraphShader graph
!**/*.savSave file
!**/*.sceneScene file
!**/*.assetAsset file
Path PatternDescription
!**/*.pycPython compiled file
!**/*.pydPython dynamic module
!**/*.pyoPython optimized file
!**/*.pklPython pickle file
!**/*.picklePython pickle file
Path PatternDescription
!**/*.pb.goProtocol buffer Go file
!**/*.pb.gw.goProtocol buffer gateway Go file
Path PatternDescription
!**/*.tfstateTerraform state file
!**/*.tfstate.backupTerraform state backup
Path PatternDescription
!**/*.min.jsMinified JavaScript
!**/*.min.js.mapMinified JavaScript source map
!**/*.min.cssMinified CSS

What’s next