Cram 01 · Domain 3 · 20% of exam

Which mechanism? The config decision, in one pass.

Built from your 2026-08-28 mock: Domain 3 scored 7/12 (58%), and four of the five misses were the same underlying question — advice or enforcement? Lifting D3 to ~92% is worth about +68 points, four times either other gap.

1 · The procedure — two questions, asked in order

Don't recall six mechanisms. Recall two questions. The second one is the one you got wrong.

  1. When should this apply? Always · only for certain files · only when I ask · at the moment a tool runs.
  2. Is it advice or a guarantee? Can Claude reasonably decide not to follow it — or must it be impossible to violate?

Everything in the first family — CLAUDE.md, .claude/rules/, skills, commands — is context: it shapes behaviour probabilistically. Everything in the second — hooks, settings permissions — is enforcement: deterministic, applied by the client. The moment a question says must, guarantee, prevent, never, or names a compliance rule, you have left the CLAUDE.md family entirely.

Must it be impossible to violate?  (policy, compliance, "never", "guarantee")
│
├─ YES → is it a blanket allow / deny of a tool or path?
│         ├─ YES → settings permissions
│         └─ NO — it needs logic (thresholds, prerequisites, transforms)
│                 └─ hook   ·  before the call = PreToolUse
│                           ·  after the call  = PostToolUse
│
└─ NO, it's guidance → WHEN is it relevant?
          ├─ every task ....................... CLAUDE.md
          ├─ only certain files ............... .claude/rules/ + paths glob
          └─ only when I ask for it
                    ├─ carries heavy context ... skill
                    └─ a named repeatable prompt  command

The trap you fell for — both directions

Q34: you treated CLAUDE.md scope as a precedence chain and stayed in the advice family when the requirement was guaranteed. Q26: you jumped to a .claude/rules/ ban when the instruction was merely vague. Enforcement is not "the strong answer" — it's the answer when a violation is unacceptable. A vague requirement gets specified, not enforced.

2 · The six mechanisms

Recognition matters more than authoring: a favourite distractor is invented syntax (.claude/config.json with a commands array, .claude/config.yaml). Neither exists.

MechanismAppliesBindingReach for it when
CLAUDE.md Always loaded Advice Universal standards relevant to every task in scope
.claude/rules/*.md Always — or conditionally with a paths glob Advice Topic-splitting a bloated CLAUDE.md; conventions tied to a file type spread across directories
.claude/skills/
SKILL.md
On demand — only when invoked Advice A workflow with heavy context that is useless for other tasks
.claude/commands/ On demand — typed as /name Advice A repeatable prompt the team runs by name
Hooks At a fixed lifecycle event Guarantee Block a call, or transform its result, deterministically
Settings permissions At tool-call time Guarantee Allow / deny / ask for a tool or path outright

Load order and scope

Broadest scope first, most specific last — this is load order, not precedence (see §3):

ScopeLocationShared
Managed policyIT-deployed (e.g. /Library/Application Support/ClaudeCode/CLAUDE.md)Whole org — cannot be excluded
User~/.claude/CLAUDE.mdJust you, all projects
Project./CLAUDE.md or ./.claude/CLAUDE.mdTeam, via version control
Local./CLAUDE.local.mdJust you, this project — gitignored

Two more facts worth holding: user-level rules load before project rules, and a rule without a paths field loads unconditionally — that single key is the whole difference between a rule file and CLAUDE.md.

3 · Five sentences that decide questions

Verbatim from the official memory docs. Q34 was written directly against the first three — the question's correct answer quoted them. Read these until they're reflexive.

All discovered files are concatenated into context rather than overriding each other.

code.claude.com/docs/en/memory — How CLAUDE.md files load

Kills: "the more specific CLAUDE.md wins on conflicts." It doesn't. There is no precedence chain.

If two rules contradict each other, Claude may pick one arbitrarily.

code.claude.com/docs/en/memory — Write effective instructions

Kills: any answer that resolves a conflict by moving the rule to a different CLAUDE.md file.

Settings rules are enforced by the client regardless of what Claude decides to do. CLAUDE.md instructions shape Claude's behavior but are not a hard enforcement layer.

code.claude.com/docs/en/memory — Manage CLAUDE.md for large teams

This is the Q34 answer in one sentence. Rule that must hold every time → settings.json or a hook.

CLAUDE.md content is delivered as a user message after the system prompt, not as part of the system prompt itself… there's no guarantee of strict compliance.

code.claude.com/docs/en/memory — Troubleshoot

Kills: "put it in bold / in caps / at the top of CLAUDE.md." Escalating emphasis on a probabilistic mechanism doesn't make it deterministic.

Hooks execute as shell commands at fixed lifecycle events and apply regardless of what Claude decides to do.

code.claude.com/docs/en/memory — Troubleshoot

Note "fixed lifecycle events" — not "tool calls." That phrasing is the whole of §4.

Also verified, and useful if compaction comes up: project-root CLAUDE.md survives /compact — Claude re-reads it from disk and re-injects it. Instructions that vanish after compaction were conversation-only, or in a nested/path-scoped file that hasn't re-matched yet.

4 · Hooks — scoped to what's actually tested

The live docs list roughly 26 hook events. The exam guide's appendix names exactly one: hooks (PostToolUse, tool call interception). Spend your time accordingly.

Pre = prevent  ·  Post = process

PreToolUse Core

Fires before the tool executes. Can block.

Policy gates, prerequisites, thresholds. The guide's example: blocking refunds over $500; blocking process_refund until get_customer returns a verified ID.

Blocks via exit code 2, or "permissionDecision": "deny".

PostToolUse Core

Fires after the tool succeeds. Cannot block — it already ran.

Transform, normalise, validate, log. The guide's example: normalising heterogeneous data formats (Unix timestamps, ISO 8601, numeric status codes) before the agent processes them.

Also the right answer for "format the file after it's written."

Q51 — you picked PreToolUse for formatting

Checkstyle on every written Java file → PostToolUse. PreToolUse fires before the write, so there is no file on disk to format yet. If the requirement contains the words "before being saved", that describes the goal, not the hook — ask instead: does the artefact need to exist for this to work?

Beyond the guide, but on your mock

These cost you Q20 here and Q50 on the 08-24 run. Worth ten minutes of recognition, not memorisation.

EventFiresNotes
PreCompact Edge Before compaction runs Matcher distinguishes manual (you ran /compact) from auto. Not a tool — it has no PreToolUse matcher.
SessionStart Edge Session begins Matcher: startup, resume, clear, compact, fork.
UserPromptSubmit Edge You submit a prompt No matcher. Can block.
Stop / SubagentStop Edge Turn / subagent ends Can block — i.e. force continuation.
Everything else Skip — FileChanged, ConfigChange, WorktreeCreate, TaskCreated… real, but far outside guide scope. Don't study these tonight.

Q20 — the transferable rule

You invented a Compact tool and hung a PreToolUse matcher on it. Compaction is a lifecycle operation, not a model-invoked tool. Generalise: if the trigger is something the session does (starting, compacting, ending, stopping) rather than something Claude calls, it has its own dedicated event and is never reachable through PreToolUse.

Q50 (08-24): a PreToolUse hook that keeps returning deny invites retry loops. It can also rewrite the call's input via updatedInput rather than only refusing it. The field is real and documented; its exact semantics are not fully spelled out in the hooks reference — treat the "rewrite, don't just deny" idea as the takeaway, not the syntax.

The shapes, for recognition

// settings.json → permissions          // blanket allow / deny / ask
{ "permissions": {
    "allow": ["Bash(npm run test *)"],
    "deny":  ["Read(./.env)"],
    "ask":   ["Write(./src/**)"] } }
// ToolName(pattern) in one of three arrays. Deny wins across scopes.

// settings.json → hooks                 // enforcement with logic
{ "hooks": {
    "PreToolUse": [
      { "matcher": "Bash",
        "hooks": [ { "type": "command", "command": "./.claude/hooks/gate.sh" } ] } ] } }
// event → matcher → handlers array.

5 · The three look-alike pairs

These generate most D3 distractors. Each turns on a single question.

a) Skill vs path-scoped rule — why does it load?

Exemplar endpoints that help generate new endpoints but are dead weight during a bug fix in the same directory → skill. A path rule would load them on every bug fix too. "Only useful for task X" → skill. "Applies to file type Y" → path rule.

b) .claude/rules/ vs a subdirectory CLAUDE.md — directory or file type?

Nested CLAUDE.md files supplement their parents. "Each one overrides the parent" is always wrong.

c) Project vs user directory — who needs it?

The phrase "when they clone the repository" makes this a one-second question — anything under ~/.claude/ is wrong by definition.

Skill frontmatter — the three fields

FieldBuys you
context: forkRuns the skill in an isolated sub-agent context, so verbose output never pollutes the main conversation. Tell: "the analysis floods the session."
allowed-toolsRestricts tool access during the skill — e.g. no writes, to prevent destructive actions.
argument-hintPrompts the developer for required parameters when they invoke it bare.

6 · CI/CD (3.6) — where Q47 lived

Session context isolation: why the same Claude session that generated code is less effective at reviewing its own changes compared to an independent review instance.

Exam guide v1.0 — Task Statement 3.6, Knowledge of

This is a named knowledge item, which is why it was the answer. Generate → review → analyse in one shared session means steps 2 and 3 inherit step 1's reasoning and stop being able to see its gaps.

The rest of 3.6, compressed:

Q26 — the mirror image

Claude writes mocked unit tests instead of the required integration tests → tighten CLAUDE.md with concrete criteria (real DB connections, contract assertions), not a rule-file ban on mocks. The guide names this verbatim: Documenting testing standards, valuable test criteria, and available fixtures in CLAUDE.md to improve test generation quality. Diagnostic: the existing instruction wasn't disobeyed, it was under-specified. Nobody violated a rule — "integration test" just never got defined.

7 · Plan mode, direct execution, Explore

ChooseWhen
Plan modeLarge-scale changes, multiple valid approaches, architectural decisions, multi-file modifications. Safe exploration before committing to a change.
Direct executionSimple, well-scoped changes — a single-file bug fix with a clear stack trace, one validation conditional.
Explore subagentVerbose discovery of existing behaviour. Isolates the noise and returns a summary, preserving main-conversation context.

Q29 (flagged, correct): the split between the last two is understanding vs deciding. "Explain this pipeline before we refactor it" is discovery → Explore subagent. Plan mode also explores, but it runs in the main conversation and drives toward a change plan.

8 · Your five D3 misses, one line each

If you read nothing else again, read this.

QThe rule
Q20Session lifecycle events (compact, start, stop) have dedicated hooks. They are not tools and never reachable via PreToolUse.
Q26Output is wrong because the spec was vague → add concrete criteria to CLAUDE.md. Don't escalate to enforcement.
Q34CLAUDE.md files are concatenated, not ranked. A rule that must hold every time goes in settings.json or a hook.
Q47A reviewer that shares context with the generator inherits its blind spots. Isolate the session.
Q51Act on a file that must already exist → PostToolUse. Pre = prevent, Post = process.

Four of these five reduce to one habit: before choosing a mechanism, name the failure. Was the instruction unclear (Q26), unenforceable (Q34), mistimed (Q51), misattributed to a tool (Q20), or biased by shared context (Q47)? The failure names the mechanism. Choosing the mechanism first is how you got these wrong.

9 · Phrase → answer

The question tells you the answer in its own words. Underline the constraint phrase before reading the options.

If the question says…Answer
"must never happen", "guarantee", "compliance", "policy"Hook or settings permissions — never CLAUDE.md
blanket allow/deny of a tool or pathsettings.json → permissions
needs a threshold, prerequisite, or transformHook
"stop it before it happens", block a callPreToolUse
normalise / format / validate a result or written filePostToolUse
before /compact, on session startDedicated lifecycle hook (PreCompact, SessionStart)
output inconsistent, instruction was vagueConcrete criteria in CLAUDE.md
"every task in the project"CLAUDE.md
"when they clone the repository"Project-scoped, in the repo
"without affecting teammates", personal~/.claude/…
all *.test.tsx wherever they live.claude/rules/ + paths glob
conventions for one subtreeSubdirectory CLAUDE.md
"only useful when doing X"Skill
verbose output floods the sessioncontext: fork (skill) · Explore subagent (discovery)
restrict tools during the workflowallowed-tools in SKILL.md
repeatable prompt run by name.claude/commands/
"which memory files loaded?" / inconsistent across sessions/memory
review step misses what it generatedIndependent session — context isolation
CI hangs waiting for input-p / --print
machine-parseable CI findings--output-format json + --json-schema
architectural, multi-approach, 45+ filesPlan mode
single-file fix, clear stack traceDirect execution

One note on /memory

The exam guide names it explicitly: Using the /memory command to verify which memory files are loaded and diagnose inconsistent behavior across sessions. Answer /memory. For your own awareness only — current docs have since split this: /memory lists file locations, while /context shows what actually loaded this session. If both appear as options, the guide's wording governs.