Grounded reference578 words

Reference: CLAUDE.md, rules and memory

Claude Certified Architect - Foundations (CCAR-F) › Domain 3: Claude Code Configuration & Workflows

CLAUDE.md, rules and memory, from the Claude Code documentation

Domain 3 examines where configuration lives and who receives it. The exam guide names three levels. The documentation describes four, plus a second memory system the guide does not mention at all.

Every CLAUDE.md location

Listed in load order, broadest first, so a project instruction lands in context after a user instruction.

ScopeLocationShared with
Managed policymacOS /Library/Application Support/ClaudeCode/CLAUDE.md · Linux/WSL /etc/claude-code/CLAUDE.md · Windows: under Program Files/ClaudeCode/Everyone on the machine
User~/.claude/CLAUDE.mdJust you, every project
Project./CLAUDE.md or ./.claude/CLAUDE.mdThe team, via source control
Local./CLAUDE.local.mdJust you, this project — gitignore it

Files are concatenated, not overridden. Across a directory tree, content is ordered from the filesystem root down to your working directory, so the file closest to where you launched Claude is read last. Within a directory, CLAUDE.local.md is appended after CLAUDE.md.

Subdirectory files are discovered but load on demand, when Claude reads a file in that directory — not at launch.

The limits worth memorising

Documented limits

under 200 lines per CLAUDE.md
a file over 4 MiB is not loaded
four hops maximum
first 200 lines or 25KB of MEMORY.md

Imports

@path/to/import pulls another file in. Relative paths resolve against the file containing the import, not the working directory. Imported files can import further files, to a maximum depth of four hops.

Import parsing skips code spans and fenced blocks, so a path wrapped in backticks stays literal text while the same path outside them imports the file. That is the documented way to mention a path in a CLAUDE.md without pulling it in.

Path-scoped rules

.claude/rules/ holds topic files. A rule with no paths frontmatter loads at launch with the same priority as .claude/CLAUDE.md. A rule with paths loads only when Claude reads a matching file.

code
--- paths: - "src/api/**/*.ts" ---

Brace expansion works — src/**/*.{ts,tsx} — and a rule's whole paths list shares a budget of 1,000 expanded patterns. User-level rules live in ~/.claude/rules/ and load before project rules, giving project rules the higher priority.

/memory and /context

/init generates a starting CLAUDE.md from the codebase, and suggests improvements rather than overwriting if one already exists.

What survives /compact

A project-root CLAUDE.md is re-read from disk after compaction and re-injected. Nested CLAUDE.md files and path-scoped rules reload as Claude reads files they apply to. An instruction that disappears after /compact was given only in conversation — which is the argument for writing it down.

Skills and commands, as documented

Two facts worth holding beside the guide's account.

Custom commands have been merged into skills. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy and work the same way. Existing command files keep working; skills add a directory for supporting files, frontmatter, and automatic invocation.

argument-hint does not do what the guide says. The documentation describes it as a hint shown during autocomplete to indicate expected arguments — not a prompt raised when a skill is invoked without any. The exam grades the guide's version.

FrontmatterDocumented behaviour
context: forkRuns the skill in a forked subagent context
allowed-toolsGrants go through the normal permission flow
argument-hintHint shown during autocomplete
disable-model-invocationStops Claude invoking the skill on its own

The CLI flags this exam names

FlagDocumented behaviour
-p / --printPrint response without interactive mode
--output-formatPrint mode only. Values: text, json, stream-json
--json-schemaValidated JSON matching a schema. Print mode only
--resume / -rResume a session by ID or name, or pick interactively
--continue / -cLoad the most recent conversation in this directory

Sources

Ready to study Claude Certified Architect - Foundations (CCAR-F)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free