Rules and path scoping

You'll finish with: Instructions that load only when relevant.

Your CLAUDE.md is over 200 lines and still growing. Splitting it is the fix — but the clever part is that some of it only needs to load sometimes.

What loads when

Always
Sometimes
On demand
CLAUDE.md
Rules, no paths
Rules, with paths
Skills

Rules that only wake up when needed

A rule file can be tied to particular files. It sits dormant until Claude touches something matching, costing you nothing the rest of the time.

smith-plumbing/
├── CLAUDE.md
└── .claude/rules/
    ├── brand-voice.md
    └── client-data.md
Do this now
  1. Open your CLAUDE.md and find the section that's longest.
  2. Cut it into .claude/rules/ as its own file.
  3. If it only matters for certain files, add the paths block at the top.
---
paths:
  - "clients/**"
---

# Client data rules

- Real names and figures never go in anything public
- Anonymise before using a client story externally:
  sector and size only, never the name
- Never substitute a fake number for a real one. If it
  can't be shared, say it can't be shared
- Unsure whether it's safe to share? It isn't. Ask.
How to know it worked

It depends on whether you added the paths block, and this trips people up.

No paths block. The rule loads the moment you start. Run /context and it should be listed under Memory files alongside CLAUDE.md, with the main file noticeably shorter.

With a paths block. It will not be in /context at the start, and that is correct — it is waiting. To see it wake up, ask Claude to read one of the files it covers: “read clients/henderson/notes.md”. A one-line notice appears in the terminal at that moment: Loaded .claude/rules/client-data.md.

If that line never appears, the pattern isn’t matching. clients/** only covers files inside a folder actually called clients, in the folder you started Claude from. Take the paths block off and check the rule shows up in /context — if it does, the rule is fine and only the pattern is wrong.

All courses · Start here · Privacy