Path-scoped rules
Also called path-specific rules, .claude/rules
Instruction files in Claude Code's .claude/rules/ folder that load only when Claude works on files matching their patterns.
A project's CLAUDE.md goes into every session, whether today's task needs all of it or not. Path-scoped rules split conventions out by the files they apply to. Each rule names its files with glob patterns, and Claude Code loads it only when Claude reads, writes or edits a matching file.
That keeps the session lighter and brings the right rule in at the right moment: Terraform conventions with .tf files, API rules with the handlers, testing rules with tests that sit in every folder.
For example
A rule file with paths set to **/*.test.tsx holds the team's testing conventions, so they load whenever Claude edits a test, in whichever folder it sits.
Put it to use
Where you'll meet path-scoped rules in ChatGPT, Gemini and Claude, how to use it there, and the mix-up most people make.
Daily Bytes Plus is in the Android app.