Beyond CLAUDE.md, three mechanisms shape how Claude Code behaves: rules
(path-scoped instructions that auto-attach), skills (packaged capabilities Claude invokes when
relevant), and hooks (deterministic scripts the harness runs on events). The exam tests which
one to reach for — and the answer hinges on one word: deterministic.
Three ways to teach a helper: rules are sticky notes that appear only when you're in the right room
("in the kitchen, wash your hands"). Skills are little instruction booklets the helper grabs when
the task needs them ("how to bake bread"). Hooks are an automatic machine that always
runs at a moment, no thinking required ("every time the door opens, the light turns on"). If it MUST happen
every single time, that's a job for the machine — a hook.
Which mechanism? Match the task
Pick a goal and see which tool fits — and why the others don't:
The three, compared
Rules
Skills
Hooks
Lives in
.claude/rules/*.md with YAML frontmatter
.claude/skills/<name>/SKILL.md
settings.json → command scripts
Triggered by
path globs (auto-attaches by file scope)
the model, when the task matches its description
events (PreToolUse, PostToolUse, Stop…)
Who decides
harness (by path)
the model (probabilistic)
the harness (deterministic)
Use when
guidance should apply only in part of the repo
a capability is occasionally useful
something MUST happen every time
Skills can declare allowed-tools (restrict what they may call) and context: fork
(run in an isolated sub-context so a big task doesn't pollute the main conversation — closely related to the
multi-agent isolation idea in Domain 1).
Exam trap: the deciding word is deterministic. "Always", "must", "every
time", "block", "enforce" → hook, because the model asking to do something isn't a guarantee.
"When relevant / when asked" → skill. "Only in this folder" → rule. Putting a hard guarantee in a
prompt/skill (which the model can skip) is the classic wrong answer.
Takeaways:rules = path-scoped instructions (harness attaches by glob);
skills = packaged capabilities the model invokes when relevant (can set allowed-tools
+ context: fork); hooks = deterministic scripts the harness runs on events. If it
MUST happen every time, use a hook — prompts and skills are probabilistic, hooks are guaranteed.