A developer wants a rule that applies only to files in src/payments/ — — Daily Challenge 2026-07-19 — Claude Cert Academy

A developer wants a rule that applies only to files in src/payments/ — not anywhere else in the repo. Where should they place the CLAUDE.md file containing this rule?

Answer: In src/payments/CLAUDE.md

A CLAUDE.md file in src/payments/ applies to that directory and all its children — exactly the scope required. The root CLAUDE.md (A) applies everywhere in the repo; comments are not machine-interpreted scoping directives. The user-level file (B) applies to all projects on the machine, not just this directory. The .claude/rules/ path (D) is not a recognized Claude Code scoping mechanism — CLAUDE.md placement in the directory tree is the scoping mechanism.

Continue to Claude Cert Academy