# CLAUDE.md hierarchy, imports and scoping

*Claude Certified Architect - Foundations Study Guide · Claude Code Configuration & Workflows · Last updated October 22, 2026 · https://www.certifyforce.com/study-guide/claude-certified-architect-foundations/claude-code-configuration-and-workflows/claude-md-hierarchy-imports-and-scoping*

Where each CLAUDE.md lives (managed, user, project, local, subdirectory), how the files concatenate instead of overriding, what @path imports and the .claude/rules/ directory do and do not save, and how to diagnose loading with /memory, /context and claudeMdExcludes.

- Certification: Claude Certified Architect - Foundations
- Exam section: Claude Code Configuration & Workflows
- Study guide: https://www.certifyforce.com/study-guide/claude-certified-architect-foundations

**Official exam objective:**

> Configure CLAUDE.md files with appropriate hierarchy, scoping, and modular organization

## What the exam expects

- Place an instruction at the right CLAUDE.md scope given who must receive it: the whole organization, one developer in every project, the team in one repository, or one developer in one repository.
- Diagnose hierarchy problems, such as a new teammate missing conventions that live in someone's user-level file, or two files giving contradictory instructions.
- Use `@path` imports so each package's CLAUDE.md pulls in only the standards files its maintainer considers relevant, knowing imports organize but do not save context.
- Split a monolithic CLAUDE.md into topic files under `.claude/rules/`, and share rule files across repositories with symlinks.
- Verify memory files with `/memory` and `/context`, and silence irrelevant ones with `claudeMdExcludes`.

Key terms: **CLAUDE.md** (Markdown instructions Claude reads at session start); **scope** (managed policy, user, project or local location that decides who shares a file); **import** (`@path/to/file` inside a CLAUDE.md that expands the file into context); **rules directory** (`.claude/rules/`, auto-discovered topic files); **on-demand loading** (subdirectory files that load only when Claude touches a file there).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Project CLAUDE.md locations | `./CLAUDE.md` or `./.claude/CLAUDE.md`, shared via source control | [How Claude remembers your project](https://code.claude.com/docs/en/memory) |
| Personal, one project | `./CLAUDE.local.md`, gitignored | [Explore the .claude directory](https://code.claude.com/docs/en/claude-directory) |
| Conflicting files | Concatenated, not overridden; Claude may pick either instruction | [How Claude remembers your project](https://code.claude.com/docs/en/memory) |
| Subdirectory CLAUDE.md | Loads when Claude reads, writes or edits a file there; not listed at launch | [How Claude remembers your project](https://code.claude.com/docs/en/memory) |
| Import path resolution | Relative to the importing file; maximum depth four hops | [How Claude remembers your project](https://code.claude.com/docs/en/memory) |
| Imports and context cost | Load at launch, so no saving | [How Claude remembers your project](https://code.claude.com/docs/en/memory) |
| Unscoped rule files | Auto-discovered recursively; load at launch like `.claude/CLAUDE.md` | [How Claude remembers your project](https://code.claude.com/docs/en/memory) |
| Hard enforcement | Managed settings such as `permissions.deny`, not CLAUDE.md | [How Claude remembers your project](https://code.claude.com/docs/en/memory) |
| `claudeMdExcludes` | Globs on absolute paths; any settings layer; cannot skip managed CLAUDE.md | [Set up Claude Code in a monorepo](https://code.claude.com/docs/en/large-codebases) |
| SDK loading | Project CLAUDE.md and rules need `"project"` in `settingSources` | [Use Claude Code features in the SDK](https://code.claude.com/docs/en/agent-sdk/claude-code-features) |

## Check yourself

- Why does a teammate miss instructions that work for you, although you both use the same repository?
- When does `packages/api/CLAUDE.md` load in a session started at the repository root?
- Why does replacing CLAUDE.md sections with `@` imports not shrink context?
- How do you stop another team's package CLAUDE.md loading only on your machine?

## Sources

- [How Claude remembers your project](https://code.claude.com/docs/en/memory)
- [Set up Claude Code in a monorepo or large codebase](https://code.claude.com/docs/en/large-codebases)
- [Best practices for Claude Code](https://code.claude.com/docs/en/best-practices)
- [Explore the .claude directory](https://code.claude.com/docs/en/claude-directory)
- [Use Claude Code features in the SDK](https://code.claude.com/docs/en/agent-sdk/claude-code-features)
- [Claude Certified Architect – Foundations Exam Guide v1.0](https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F6nizmqk8tpzpfjvt6qmmav7rh%2Fpublic%2F1783542750%2FClaude+Certified+Architect+%E2%80%93+Foundations+Exam+Guide.pdf)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 10 linked practice questions, and unlimited timed mock exams are included with the Claude Certified Architect - Foundations pack (USD $19): https://www.certifyforce.com/practice-exams
