AnthropicClaude Certified Architect – Foundations2026-103.1 Configure CLAUDE.md files with appropriate hierarchy, scoping, and modular organization
Inspect instruction loading before rewriting rules
Completed by the knowledge check
Learning objective
Use /memory to inspect loaded instruction files and troubleshoot inconsistent behavior across sessions.
Core idea
Separate an instruction’s existence, its delivery to context, and Claude’s adherence to it. These are different claims with different evidence. A file available through an editor may not have loaded, and a loaded file may contain ambiguous or contradictory guidance.
Use /memory to locate and edit instruction files. Use /context to check which instruction files loaded at launch. For a nested file that loads on demand, inspect its terminal loading evidence or an InstructionsLoaded hook. Diagnose the missing step before changing the wording of a rule that one session follows and another ignores.
How it works
Use /memory as the editing entry point
The /memory command lists CLAUDE.md, CLAUDE.local.md, and other memory-file locations across user and project scopes. It includes user and project CLAUDE.md entries for files that do not exist yet. Selecting a file opens it in your editor; selecting a nonexistent entry creates the file first.
That creation behavior makes the list useful for configuration, but means a listed location is not proof that its contents entered the session. You can use it to find a rule accidentally stored in a personal file, or to open the shared project file where the corrected convention belongs. Keep the audience distinctions from 3.1.1: editing a home file does not distribute the change to teammates.
The command also provides an auto-memory toggle and an option to open the auto-memory folder. Auto memory contains notes Claude writes; it is distinct from the standing instructions you maintain in CLAUDE.md. Asking Claude to remember a preference saves it to auto memory. To add a shared instruction, explicitly ask for a CLAUDE.md edit or edit that file through /memory.
Use /context for launch evidence
Run /context and inspect Memory files to verify the CLAUDE.md, CLAUDE.local.md, and rules files expected at launch. If an expected launch file is missing, its instruction text was not delivered through that file. Use /memory to inspect the content and location rather than asking Claude to repeat a rule from memory.
Compare equivalent sessions: the same repository content does not guarantee the same working directory, personal files, import approval, or settings-source selection. Starting at the root and starting in a package can produce different initial instruction sets. A teammate’s private files can explain “works for me” even when both people use the same committed project files.
A subdirectory CLAUDE.md does not appear under Memory files, because it loads on demand rather than at launch. Anthropic documents a terminal Loaded line with the path when it loads. To test a nested instruction, create it from your shell rather than asking Claude to write it, then ask Claude to read another file in that subdirectory. The path on the loading line is the evidence to inspect.
Do not infer that a nested instruction is broken merely because it is absent from the launch list. Equally, do not infer that it governed an earlier decision merely because Claude accessed the directory later. Scope and timing both matter when reconstructing inconsistent behavior.
Trace loading when a snapshot is insufficient
For a personal loading audit, configure the hooks settings key in .claude/settings.local.json with the InstructionsLoaded event and a command hook that logs its input. This settings file applies only to you in the project; if you create it by hand, add it to .gitignore so it stays uncommitted. This event fires for CLAUDE.md and rule files at startup and when they load lazily. The hook input names the absolute file_path, the memory_type, and the load_reason.
The documented load_reason values are session_start, nested_traversal, path_glob_match, include, and compact. For lazy-load diagnosis, matcher: "path_glob_match|nested_traversal" selects those reasons. trigger_file_path identifies the accessed file behind a lazy load; parent_file_path identifies the importing instruction file for an include load.
This event is observability, not enforcement. It runs asynchronously and has no decision control: it cannot block or modify instruction loading. It also does not fire for AGENTS.md read directly through the Project instructions setting, although it does fire when CLAUDE.md imports that file. Keep any audit conclusion within what the selected event actually records.
Distinguish missing context from weak guidance
Once loading is established, inspect the text for ambiguity and conflicts. “Use 2-space indentation” is more testable than “format code nicely.” Contradictory guidance in personal and shared files can produce inconsistent choices even when every file loads correctly. Remove the conflict rather than assume the more specific file overrides the other.
The memory page also explains apparent loss after /compact: project-root CLAUDE.md is re-read from disk and re-injected, while nested instructions and path-scoped rules load again on demand. A conversation-only instruction or a nested rule that has not reloaded can therefore explain a changed response after compaction. Put an always-needed convention in an appropriate persistent file; do not assume a rule stated only in chat survives as standing guidance.
Key distinctions and trade-offs
Editing inventory versus loaded context: /memory helps locate, create, and edit files. /context verifies launch-loaded instructions. Check /context before concluding from /memory that a file loaded.
Launch snapshot versus event evidence: The Memory files list answers what loaded at launch. A terminal Loaded line or InstructionsLoaded record answers when a nested or conditional file entered context. Logging adds audit detail but cannot enforce compliance.
Loading versus adherence: An absent instruction needs a delivery fix. A loaded instruction that conflicts with another needs a content fix. A requirement to execute a formatter needs a hook, as described in 3.1.1, rather than stronger wording in the same file.
Architecture / decision scenario
A developer-productivity team observes that Claude Code follows an API database convention in one session and misses it in another. Both sessions use the same repository revision. The rule lives in packages/api/src/db/CLAUDE.md, and the engineers start their sessions at different levels.
Use /memory to open the instruction files and establish where the rule lives. Use /context to compare launch-loaded files. A session launched inside the database directory receives its ancestor instructions at launch; a root session does not receive that nested file initially. In the root session, ask Claude to read a database file and inspect the terminal Loaded line.
If every API task needs the rule before accessing the database subtree, move it to packages/api/CLAUDE.md. If only database-file work needs it, keep the nested scope and use InstructionsLoaded logging to verify the triggering file and nested_traversal reason. These are different design requirements, not two competing guesses about a command.
A separate teammate’s test command is missing because it exists only in another developer’s home file. Moving it into committed project instructions fixes distribution. If the database rule still disappears after /compact, check whether the nested file has reloaded. If both conflicting test commands appear in loaded files, remove the contradiction. Rewriting every rule in capitals would address none of these documented causes.
Common exam traps
- Treating every location listed by
/memoryas an existing, loaded file. - Using
/memoryalone as evidence of the launch instruction set. - Expecting
/contextto list a lazily loaded subdirectoryCLAUDE.md. - Assuming consistent repository content means consistent personal configuration and launch scope.
- Treating
InstructionsLoadedas a hook that can reject instruction loading. - Rewriting a rule before distinguishing missing delivery, conflicting guidance, and post-compaction reloads.
Where the exam guide differs
The exam guide describes “Using the /memory command to verify which memory files are loaded.” Claude Code’s memory documentation assigns launch verification to /context and file opening and editing to /memory. For subdirectory instructions, it documents a terminal Loaded line rather than inclusion in the launch list. When an exam item asks which memory files are loaded, the option naming /memory is the guide’s intended answer; in the product, /context › Memory files shows the launch-loaded files and /memory lists the memory locations and opens them for editing.
What to remember
Inspect first, then repair the specific failure. /memory locates and edits files; /context verifies launch-loaded instructions. Nested loading needs its terminal line or event record. A missing file, a delayed load, a contradiction, and a convention requiring deterministic execution each call for a different fix.
Knowledge check
Claude Code followed a naming rule in yesterday’s session and ignores it today, in the same repository. Before changing anything, an engineer wants evidence of which instruction files this session loaded at launch. What should they run?
/memory , then treat every location it lists as a file this session loaded/compact , then check whether the naming rule reappears in the answers/context , then look for the file that holds the rule under Memory files/memory , then open the file that holds the rule and strengthen the wording of it/context › Memory files lists the CLAUDE.md , CLAUDE.local.md and rules files that loaded at launch. /memory lists memory locations across scopes, including entries for files that do not exist yet, and opens them for editing, so its list is not evidence of loading. The exam guide attributes the check to /memory ; the product assigns it to /context . Rewording comes only after delivery is confirmed.Engineers launch at the repository root. A new packages/api/src/db/CLAUDE.md is absent from Memory files in /context. How should an engineer check whether the file loads?
CLAUDE.mdLoaded line/memory and treat its listing of the file as proof that it loadedCLAUDE.md and rerun /contextCLAUDE.md loads on demand, not at launch, so it never appears under Memory files . When Claude reads a file in that directory, the nested file loads and the terminal shows a Loaded line with its path. Moving or importing it would change when it loads instead of testing the design.An engineer wants a personal record of when and why nested CLAUDE.md files and path-scoped rules load during their sessions, without affecting teammates. Which configuration fits?
InstructionsLoaded hook with matcher path_glob_match|nested_traversal in .claude/settings.local.jsonInstructionsLoaded hook with matcher path_glob_match|nested_traversal in .claude/settings.jsonPostToolUse hook matching Read in .claude/settings.local.json that logs each file readInstructionsLoaded hook in .claude/settings.local.json that exits with code 2 to stop unexpected loadsInstructionsLoaded fires when a CLAUDE.md or rules file loads, and its matcher runs against load_reason , so those two values select lazy loads; the input carries the file path and reason. .claude/settings.local.json applies only to this engineer, unlike the committed .claude/settings.json . The event has no decision control, and a Read log records file access rather than instruction loading.Engineers launch at the repository root. After /compact, Claude stops following a rule from packages/api/src/db/CLAUDE.md, although rules from the project-root CLAUDE.md still apply. What explains the change?
/compact , Claude Code re-reads the project-root CLAUDE.md from disk and re-injects it, while nested files and path-scoped rules load again on demand. Until Claude touches a database file again, the nested rule is absent. If every API task needs that rule up front, it belongs higher in the tree.References
- Anthropic, How Claude remembers your project
- Anthropic, Settings files and precedence
- Anthropic, Hooks reference
- Anthropic, Claude Certified Architect – Foundations Exam Guide