Back to all rules / Drift between files

path-rule-matches-nothing

A rule's paths, globs or applyTo match no file in the project.

warning by default Drift between files Needs the whole project Inline suppression allowed

Source: Claude Code docs: How Claude remembers your project (code.claude.com), read 14 October 2026.

On GitHub: the rule doc and the tests.

Jump to another rule89

What it catches#

A rule's paths, globs or applyTo match no file in the project.

A Claude Code rule with paths, a Cursor rule with globs or a Copilot instructions file with applyTo whose patterns match no file in the project. These files load only for matching files, so this one never loads. It usually happens after a folder is renamed. Only runs when the whole folder is linted, and only for patterns that name a folder. It stays quiet when the folder walk was cut short, when a pattern points into a folder AsItIs does not walk (such as node_modules or dist), and for extension-only patterns like **/*.py: a language pack with nothing to match is harmless. On a sparse checkout, files that are not checked out count as missing.

Why it matters#

Claude Code rules with paths, Cursor rules with globs and Copilot instructions with applyTo load only for matching files. When no file matches, usually after a folder was renamed, the rule never loads. Silent when the folder walk was cut short or a pattern points into a folder AsItIs does not walk.

Bad example#

---
paths:
  - "src/legacy-api/**/*.ts"
---
# API rules

The API moved to src/api/ last year. Nothing matches src/legacy-api/, so Claude never sees these rules.

Good example#

---
paths:
  - "src/api/**/*.ts"
---
# API rules

How to fix#

Point the pattern at the files it is meant for, or delete the rule if the code is gone. A pattern with no slash, like *.sql, matches that file name in any folder; one with a slash is relative to the folder that holds .claude (Claude Code), .cursor (Cursor) or the workspace root (Copilot).

Suppress or configure#

For one finding, put a comment on the line above it. The reason after -- is optional but worth writing:

<!-- asitis-disable-next-line path-rule-matches-nothing -- why this one is fine -->

For a whole file:

<!-- asitis-disable-file path-rule-matches-nothing -- why this file is an exception -->

For every file, turn it off or change its severity in .asitisrc.json:

{ "rules": { "path-rule-matches-nothing": "off" } }

A .asitisrc.json overrides entry limits a change to some paths, and a baseline (asitis lint --format json --write-baseline) accepts today's findings so only new ones fail the build.

Source#

Claude Code docs: How Claude remembers your project, read on 14 October 2026.

See what an agent changed in your CLAUDE.md. Keep or revert each change.

The linter is free and needs no signup. I'm also building a desktop editor for the markdown your agents write and read. It shows what an agent changed since you last looked, lets you keep or revert each change, and never touches a line you didn't edit. No release date yet. One email to confirm, one when the paid beta opens, one when 1.0 ships. $29 once for a founding licence, with 24 months of updates.

Or add the linter to CI, no email needed.

Your address is stored with Cloudflare, which hosts this site. No IP address is kept. See the privacy policy.

Back to all rules

This page is generated from the plugin's rule registry. Edit it on GitHub. False positive? Open an issue with the line it fired on.