OS-specific system path (e.g. /etc/claude-code/CLAUDE.md)
N/A — cannot be excluded
User
~/.claude/CLAUDE.md
No
Project
.claude/CLAUDE.md or root CLAUDE.md
Yes
Directory
subdirectory CLAUDE.md
Yes (loads on demand)
Local
CLAUDE.local.md (any level)
No — gitignore it
Load order: broadest → most specific; CLAUDE.local.md loads after CLAUDE.md at the same level.
Conflict handling: files are concatenated, never overridden. "Claude may pick one arbitrarily" on a real conflict.
Enforcement: CLAUDE.md is guidance, not enforcement — for a rule that must hold every time, use settings.json or a hook.
Exam trap: new teammate gets inconsistent behaviour after cloning → conventions are almost always sitting in someone's ~/.claude/CLAUDE.md instead of project-level.
@ import syntax
Directive is a bare @path on its own line — no @import keyword in current docs (the exam guide calls the feature "@import" anyway).
Max recursion depth: 4 hops (older docs said 5).
Skips markdown code spans/fenced blocks — backtick a path to mention without importing.
Cross-worktree personal prefs: import a home-directory file, e.g. @~/.claude/my-project-instructions.md.
settings.json precedence (separate system from CLAUDE.md!)
managed > CLI args > local > project > user (strict — a deny at any level can't be overridden by any other level)
File
Scope
Shared?
~/.claude/settings.json
User
No
.claude/settings.json
Project
Yes
.claude/settings.local.json
Project-personal
No
enterprise managed-settings.json
OS-specific path
N/A
/init — generates/improves CLAUDE.md from codebase analysis.
/memory — diagnostic only, shows loaded files, never triggers loading.
$ARGUMENTS — all args; auto-appended as ARGUMENTS: <value> if unreferenced.
$N / $ARGUMENTS[N] — positional, 0-based ($0 = first arg).
!`cmd` — runs shell command pre-send; placeholder becomes real output.
context: fork — isolated subagent context, no parent history; pair with agent: (Explore/Plan/general-purpose, default general-purpose).
allowed-tools — current docs: pre-approves for the invoking turn only (NOT a restriction). Exam-guide answer: restricts tool access. Real boundary: disallowed-tools.
argument-hint — autocomplete hint, e.g. [issue-number].
disable-model-invocation: true — user-only invocation, description hidden from context.
user-invocable: false — Claude-only invocation, hidden from / menu.
Skill(name) exact match / Skill(name *) prefix match — permission rule syntax.
MCP prompts as commands: /mcp__servername__promptname.
Session isolation: same session that wrote code reviews it worse (retains self-justifying reasoning) — use an independent claude -p invocation to review.
Incremental review: feed prior findings back in; report only new/unaddressed issues.
CLAUDE.md in CI: loads exactly as interactive — the way to supply testing standards, fixtures, review criteria.
Batch API: 50% cheaper, up to 24h, no latency SLA → never for pre-merge (blocking) checks; fine for nightly/weekly.
GitHub Actions: built on Agent SDK; @claude mention (default trigger_phrase); app needs read & write on Contents/Issues/Pull requests; claude_args = full CLI passthrough; action --max-turns default 10.
CI gate idea: fail on non-empty plugin_errors / mcp_server_errors in the stream-jsonsystem/init event.
Known exam-guide vs current-docs divergences
See research/divergences/domain-3.md for full detail. Quick list:
allowed-tools restricts (exam guide) vs pre-approves (current docs; disallowed-tools is the real boundary).
"@import syntax" (exam guide's name) vs bare @path, no keyword (current docs).
@ import depth: 4 hops now (was 5 in older docs).
Slash commands and skills are one merged system in current docs; the exam guide still frames them as two separate features.
Positional arguments ($N) are 0-based in current docs.
Permission modes now also include auto and dontAsk, beyond the plan/direct binary the exam guide frames.