What You Need to Know
Claude Code reads configuration from CLAUDE.md files at three distinct levels. Understanding which level applies where — and diagnosing when the wrong level has been used — is one of the most frequently tested concepts in the exam.
The Three-Level Hierarchy
User-level: ~/.claude/CLAUDE.md
This file applies only to you. It is stored in your home directory, outside any repository. It is not version-controlled. It is not shared via git. When a new team member clones your repository, they do not get these instructions. Use this level for strictly personal preferences — verbosity settings, preferred output style, personal shortcuts.
Project-level: .claude/CLAUDE.md or root CLAUDE.md
This file applies to everyone working on the project. It lives inside the repository and is version-controlled. Every developer who clones or pulls the repo receives these instructions automatically. Team-wide standards belong here: naming conventions, error handling patterns, testing requirements, architecture decisions, code review checklists.
Both .claude/CLAUDE.md (inside the .claude directory) and a CLAUDE.md at the repository root are valid project-level locations. The exam may present either path.
Directory-level: subdirectory CLAUDE.md files
These files apply when working in that specific directory. Use them for package-specific conventions that differ from the project root. For example, a /packages/api/CLAUDE.md might contain REST-specific conventions that do not apply to the frontend package.
Modular Organisation with @import
A single monolithic CLAUDE.md file becomes unwieldy as project conventions grow. The @import syntax lets you reference external files from CLAUDE.md, pulling in only the standards relevant to each context.
The syntax looks like this in your CLAUDE.md file:
.claude/CLAUDE.md
@import ./standards/naming-conventions.md @import ./standards/error-handling.md @import ./standards/testing-requirements.md
Each package can import only the standards files relevant to its domain. The API package imports API conventions; the frontend package imports component conventions. No duplication, no drift.
The .claude/rules/ Directory
As an alternative to a single CLAUDE.md file, the .claude/rules/ directory holds topic-specific rule files:
testing.md— test naming, assertion patterns, fixture usageapi-conventions.md— endpoint naming, request/response schemasdeployment.md— deployment checklist, environment configuration
Each file can optionally include YAML frontmatter with path scoping (covered in detail in Task Statement 3.3). Without frontmatter, rules files load for all sessions.
The /memory Command
The /memory command verifies which memory files are currently loaded in your session. This is the debugging tool for inconsistent behaviour across sessions or developers. When Claude Code behaves differently for different team members, /memory reveals whether the expected configuration files are actually loaded.
Key Concept
The /memory command does not load configuration files — it reveals which ones are already loaded. Configuration files load automatically based on their level and location. Use /memory to diagnose, not to activate.
The Critical Exam Scenario: New Team Member Not Receiving Instructions
This is the exam's favourite trap for Task Statement 3.1. The scenario presents itself as follows:
Developer A has been on the team for months. Claude Code follows all the team's conventions perfectly — API naming, test structure, error handling. Developer B joins the team, clones the repository, and Claude Code produces inconsistent results that ignore the conventions.
The root cause is always the same: the conventions are stored in Developer A's user-level config (~/.claude/CLAUDE.md) instead of the project-level config (.claude/CLAUDE.md or root CLAUDE.md). User-level config is not shared via git. Developer B never received the instructions.
The fix: move instructions from user-level to project-level configuration.
You must diagnose this instantly on the exam. When you see "new team member" and "inconsistent behaviour," check where the configuration lives.
Exam Traps
New team member not receiving Claude Code instructions despite working on the same repo and branch
The instructions are in user-level config (~/.claude/CLAUDE.md) instead of project-level. User-level is not version-controlled or shared via git. Move to .claude/CLAUDE.md for team-wide application.
Thinking /memory triggers configuration loading
/memory is a diagnostic command that shows which files are loaded. Configuration files load automatically based on their location in the hierarchy. /memory helps you debug — it does not activate anything.
Assuming directory-level CLAUDE.md is the best solution for cross-directory conventions
Directory-level CLAUDE.md applies to one directory only. For conventions spanning many directories (like test files spread throughout a codebase), use path-specific rules in .claude/rules/ with glob patterns instead.
Practice Scenario
Developer A's Claude Code follows the team's API naming conventions perfectly. Developer B, who joined last week, gets inconsistent naming from Claude Code. Both work on the same repo and branch. What is the most likely root cause?
Build Exercise
Build a Multi-Level CLAUDE.md Configuration
What you'll learn
- Understand the three-level CLAUDE.md hierarchy (user, project, directory) and when to use each
- Configure modular project standards using @import syntax
- Use .claude/rules/ for topic-specific rule files
- Diagnose configuration scoping issues with the /memory command
- Identify root cause when a new team member does not receive instructions
- Create a project-level .claude/CLAUDE.md with universal coding standards: naming conventions, error handling patterns, and a code review checklist
Why: Project-level configuration is the foundation of team-wide standards. The exam tests whether you place shared conventions here rather than in user-level config, which is the most common misconfiguration scenario.
You should see: A .claude/CLAUDE.md file at the repository root containing at least three sections: naming conventions, error handling patterns, and a code review checklist. Running /memory in the project root shows this file as loaded.
- Create a directory-level CLAUDE.md in a /packages/api/ subdirectory with API-specific conventions (REST endpoint naming, request/response schema requirements)
Why: Directory-level configuration scopes conventions to a specific package. The exam tests whether you know that directory-level CLAUDE.md applies only within that directory, not across the entire project.
You should see: A CLAUDE.md file inside /packages/api/ containing REST-specific conventions. When you run /memory while working in /packages/api/, both the project-level and directory-level files appear as loaded.
- Create .claude/rules/testing.md with test-specific conventions (test naming pattern, assertion style, fixture usage)
Why: The .claude/rules/ directory holds topic-specific rule files that can optionally include YAML frontmatter for path scoping. Understanding this mechanism is tested alongside path-specific rules in Task Statement 3.3.
You should see: A testing.md file inside .claude/rules/ containing at least three test conventions. Running /memory shows this rules file as loaded in your session.
- Use @import in the project-level CLAUDE.md to reference a shared standards file from ./standards/naming.md
Why: The @import syntax enables modular organisation of conventions. Each package can import only relevant standards, reducing duplication and drift. The exam tests whether you know this mechanism exists and how it works.
You should see: The project-level .claude/CLAUDE.md contains an @import directive pointing to ./standards/naming.md. A separate file at .claude/standards/naming.md (or standards/naming.md relative to the CLAUDE.md) exists with naming conventions. Running /memory confirms the imported content is loaded.
- Run /memory in different directories to verify the correct files are loaded in each context
Why: The /memory command is the diagnostic tool for verifying which configuration files are active. The exam specifically tests that /memory reveals loaded files but does not trigger loading — configuration loads automatically based on location.
You should see: In the project root, /memory shows the project-level CLAUDE.md and rules files. In /packages/api/, /memory additionally shows the directory-level CLAUDE.md. The imported standards file content appears as part of the project-level configuration.
- Move one convention from project-level to user-level (~/.claude/CLAUDE.md) and verify that a different user session does NOT pick it up — confirming the scoping boundary
Why: This is the exam favourite trap scenario. When conventions live in user-level config, new team members who clone the repo do not receive them. Proving this boundary experimentally cements the concept.
You should see: After moving a convention to ~/.claude/CLAUDE.md, your own /memory shows it loaded. A simulated second user session (or a fresh clone without your home directory config) does NOT show that convention. This confirms the scoping boundary.