The short answer: use a hook when something must happen every single time, a subagent when a side task would flood your conversation, a skill when you keep pasting the same procedure or reference, and CLAUDE.md for short rules that apply to everything. The line people miss is guarantee versus request: Anthropic’s docs describe hooks as deterministic, while instructions in CLAUDE.md or a skill are things Claude interprets, so “never edit .env” belongs in a hook if it truly must hold.
The decision table
Compiled from Anthropic’s documentation, checked 29 September 2026.
| Attribute | CLAUDE.md | Skill | Subagent | Hook |
|---|---|---|---|---|
| What it is | Standing instructions | Instructions or a workflow in a SKILL.md | An isolated worker with its own context | A command, HTTP call, prompt or agent run on a lifecycle event |
| Where it lives | Project root, and nested folders | .claude/skills/<name>/SKILL.md (project) or ~/.claude/skills/<name>/SKILL.md (personal) | .claude/agents/ (project) or ~/.claude/agents/ (user) | A hooks block in .claude/settings.json or ~/.claude/settings.json |
| Guaranteed to run? | No, advisory | No, Claude interprets it | No, Claude decides to delegate (or you name it) | Yes, fires on its event |
| Context cost | Full file, every request | Description each session; body only when used | Its own window; only a summary returns | None, unless the hook prints output |
| Invoked by | Automatically | /name, or Claude matches the description | Named in the prompt, an @-mention, or claude --agent name | The event itself |
| Best for | Build commands, conventions | Repeatable playbooks, reference | Big searches, parallel work, reviews | Formatting, blocking, logging, notifications |
Job by job
| The job | Use | Why, per the docs |
|---|---|---|
| Run Prettier or ESLint after every edit | Hook on PostToolUse with an Edit|Write matcher | It must run every time, and it needs no thinking |
| Block writes to a folder such as migrations | Hook on PreToolUse | That event “can block” the tool call; a rule in prose is only a request |
| Get a desktop notification when Claude needs input | Hook on Notification | Docs give macOS, Linux and Windows commands |
| Re-inject key facts after context compaction | Hook on SessionStart with a compact matcher | Text the hook prints lands in Claude’s context |
| Stop Claude ending a turn until tests pass | Hook on Stop | Runs your check as a script and can block finishing |
| “Always use pnpm, run tests before committing” | CLAUDE.md | Short, universal, worth the every-request cost |
| A release or deploy checklist you trigger by hand | Skill with disable-model-invocation: true | Loads only when you type /name, and Claude cannot fire it on its own |
| An API style guide Claude needs sometimes | Skill | Costs almost nothing until used |
| Read forty files to answer one question | Subagent | Work stays out of your main context |
| Independent review of a diff | Subagent | Fresh context, so it is not biased by the reasoning that wrote the code |
Details worth knowing before you build one
Hooks. Events include SessionStart, PreToolUse, PostToolUse, PostToolUseFailure, SubagentStop and Stop. Most hooks are type: "command"; http, prompt and agent types also exist, with agent hooks flagged experimental. When several hooks match one event they all run, so one hook denying an action does not stop side effects in another. Claude can write hooks for you if you describe them, and /hooks lists what is configured.
Subagents. Only name and description are required in the frontmatter; tools, model, skills, permissionMode, maxTurns and isolation: worktree are optional. Claude Code ships built-in Explore, Plan and general-purpose agents. Subagents can spawn their own down to a default depth of three layers.
Skills. Custom commands have been merged into skills: .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy. If a skill exists at more than one level, enterprise beats personal and personal beats project. Skills in personal folders are not read by cloud sessions or routines.
Build them in order of pain. Anthropic’s advice is to add each extension when a trigger appears, not up front: a repeated mistake goes into CLAUDE.md, a repeated prompt becomes a skill, a noisy side task becomes a subagent, and a “must always” becomes a hook.
The setup steps for the tool itself are in how to use Claude Code; writing the CLAUDE.md side well is in CLAUDE.md best practices; and Cursor’s counterpart to standing instructions is Cursor rules. The connection layer is covered in Claude Code MCP servers.
Method
Researched from Anthropic’s Claude Code documentation on 29 September 2026. We have not built and timed these setups, so nothing here measures how reliably Claude follows a skill or delegates to a subagent. Version details change quickly; the docs are the reference. Re-checked every 60 days.
Common questions
Should a rule go in CLAUDE.md or a hook?
If Claude ignoring it once is acceptable, CLAUDE.md. If it must hold every time, a hook.
Do hooks use up my context window?
Not by default. A hook costs nothing unless it prints output that gets added to the conversation.
Can a skill run in isolation like a subagent?
Yes: Anthropic’s extension docs say a skill can run in an isolated context with context: fork, and a subagent can preload skills.