A parks-and-recreation engineering team has a root-level CLAUDE.md with general repository conventions and a service-specific CLAUDE.md inside packages/reservations/ with rules just for that booking service. When Claude Code works inside packages/reservations/, how do these two files combine?
Select an answer to reveal the explanation.
Short Explanation
Root CLAUDE.md is parks-department-wide policy; the reservations file is that one facility's house rules. Both apply, and where they disagree the more specific house rules win.
Full Explanation
Instruction files in Claude Code compose by directory rather than replacing one another. A parks engineering team gets repository-wide conventions from the root file and booking-service specifics from the nested one, so the only interesting question is what happens where the two disagree.
Both files load when work happens inside packages/reservations/, and the nested file's guidance takes precedence on conflict because it is scoped more tightly to the work at hand. That is the same specificity rule most layered configuration follows, and it lets the team state a general convention once while carving out the booking service's exceptions in the place those exceptions belong.
Loading only the root file would silently discard the rules the team deliberately wrote for the reservations service. Loading only the nested file would strip the repository-wide conventions that still apply inside that package, leaving the booking service without shared standards. Merging alphabetically by filename ignores directory nesting entirely, which is the very thing that establishes which rules are more specific.
Exam caveat: precedence resolves conflicts, but it will not rescue two files that contradict each other in spirit—drift between them still costs review time. Operational check: place a deliberately conflicting instruction in both files, run a task inside packages/reservations/, and confirm the nested rule is the one followed.