A developer has a project CLAUDE.md at the repo root saying 'use 2-spa — Daily Challenge 2026-07-18 — Claude Cert Academy

A developer has a project CLAUDE.md at the repo root saying 'use 2-space indentation' and a subdirectory CLAUDE.md in src/api/ saying 'require explicit return types on all functions.' When Claude Code is working in src/api/, which rules are active?

Answer: Both — project-level and subdirectory rules are merged, both apply in src/api/

CLAUDE.md files compose — they don't override. When Claude Code works in src/api/, it loads the project-level CLAUDE.md (2-space indentation) AND the src/api/ CLAUDE.md (explicit return types), and both rules are active simultaneously. Subdirectory files add to the active rule set; they don't replace higher-level files. This is why placement is the scoping mechanism: rules at each level are additive.

Continue to Claude Cert Academy