Answer: Claude Code loads every CLAUDE.md file from your working directory and every parent directory at launch, then loads each subdirectory's file on demand, so a root CLAUDE.md sets repository-wide rules and each subdirectory (e.g., one per package in a monorepo) adds its own conventions. Status: Confirmed Entry: tool/claude-code/memory-and-context/layer-claude-md-files-by-directory Revision: 1 Digest: sha256:fd0c4af5aa3b08b5 (changes whenever the content changes) Timeline: Created: 2026-11-16T12:09:42Z Last changed: 2026-11-16T12:09:42Z Last verified: 2026-11-20T12:21:36Z Next check: 2026-11-21T12:21:36Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of root file role | A root file sets repository-wide rules and each subdirectory adds its own. | [1] | 2026-11-20 monorepo split | In a monorepo that's one per package. | [1] | 2026-11-20 example subdirectory file | packages/api/CLAUDE.md | [1] | 2026-11-20 start from package | When you start Claude from `packages/api/`, it loads both `packages/api/CLAUDE.md` and the root `CLAUDE.md`. | [1] | 2026-11-20 verify loaded files | /context all | [1] | 2026-11-20 Sources: [1] Anthropic. "Set up Claude Code in a monorepo or large codebase". https://code.claude.com/docs/en/large-codebases.md Role: primary. Accessed: 2026-11-20T12:21:36Z Quote: "A root file sets repository-wide rules and each subdirectory adds its own." (Supports: root file role) Quote: "In a monorepo that's one per package." (Supports: monorepo split) Quote: "Each subdirectory's `CLAUDE.md`, here `packages/api/CLAUDE.md`, adds the conventions specific to that area:" (Supports: example subdirectory file) Quote: "When you start Claude from `packages/api/`, it loads both `packages/api/CLAUDE.md` and the root `CLAUDE.md`." (Supports: start from package) Quote: "To confirm which files loaded, run [`/context all`](https://code.claude.com/docs/en/commands#all-commands) and check the list under **Memory files**." (Supports: verify loaded files) Published: 2026-11-20T02:54:02Z Snapshot SHA-256: f5d723ccd1962a060db8f6b5991b4e98d8d0623bfbd75ff9dab2d1d62870d8d9 (captured 2026-11-20T12:21:36Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:21:36Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:21:36Z Last attempt: 2026-11-20T12:21:36Z Notes and limitations: Extracted automatically from a single official source (section "Layer CLAUDE.md files by directory"). Related: https://latestn.com/tool/claude-code/memory-and-context/lower-always-on-plugin-cost How can I reduce the always-on token cost of a Claude Code plugin? https://latestn.com/tool/claude-code/memory-and-context/tool-search-default-tools-loaded How many tools does Claude Code tool search load into context by default? https://latestn.com/tool/claude-code/memory-and-context/what-is-claude-md What is CLAUDE.md in Claude Code? https://latestn.com/tool/claude-code/memory-and-context/exclude-irrelevant-claude-md-files How do I exclude irrelevant CLAUDE.md files in Claude Code? https://latestn.com/tool/claude-code/memory-and-context/extension-context-cost How much context do Claude Code extensions like CLAUDE.md, Skills, and MCP cost, and how do they load? https://latestn.com/tool/claude-code/memory-and-context/keep-claude-md-short How do I keep CLAUDE.md short in Claude Code? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-16T12:09:42Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/memory-and-context/layer-claude-md-files-by-directory/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/memory-and-context/layer-claude-md-files-by-directory POST: https://latestn.com/dispute/tool/claude-code/memory-and-context/layer-claude-md-files-by-directory with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/memory-and-context/layer-claude-md-files-by-directory?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I layer CLAUDE.md files by directory in Claude Code for a monorepo? Revision 1, last verified 2026-11-20T12:21:36Z. https://latestn.com/tool/claude-code/memory-and-context/layer-claude-md-files-by-directory (accessed 2026-11-21T10:01:58Z). @misc{LatestN_tool_claude_code_memory_and_context_layer_claude_md_files_by_directory_r1, title = {How do I layer CLAUDE.md files by directory in Claude Code for a monorepo?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/memory-and-context/layer-claude-md-files-by-directory}}, note = {Revision 1; digest sha256:fd0c4af5aa3b08b5; last verified 2026-11-20T12:21:36Z; accessed 2026-11-21T10:01:58Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/memory-and-context/layer-claude-md-files-by-directory