CLAUDE.md, skill, hook or subagent: which one do you need?
Claude Code has several places to put an instruction. They look alike, but they load at different times, cost different amounts of context, and only some of them are enforced.
The short answer
- CLAUDE.mdThings Claude should always know: build commands, conventions, "never do X". Loaded every session.
- SkillReference material or a workflow you only need sometimes, such as a release checklist. Loaded when used, or when you type its name.
- HookSomething that must happen the same way every time without the model deciding, such as formatting after an edit or blocking a file.
- SubagentA side job that would flood your conversation. It works in its own context and sends back a summary.
- MCP serverA connection to something outside, such as a database or a browser.
- PluginA package of the above, so a second repository can reuse the same setup.
Start from what went wrong
Anthropic's overview suggests adding each piece when a specific thing keeps happening, not all at once:
- Claude gets a convention or command wrong twice: put it in CLAUDE.md.
- You paste the same playbook into the chat for the third time: make it a skill.
- You want something to happen every time without asking: write a hook.
- A side task fills the conversation with output you will not look at again: send it through a subagent.
- You keep copying data from a tab Claude cannot see: connect it as an MCP server.
- A second repository needs the same setup: package it as a plugin.
CLAUDE.md or skill?
Both hold instructions. CLAUDE.md loads at the start of every session. A skill loads its short description each session and its full text only when it is used. So the question is how often Claude needs it.
The documentation gives a rule of thumb: keep CLAUDE.md under 200 lines, and when it grows, move reference material into skills or into .claude/rules/ files. A rule file with a paths entry in its frontmatter only loads when Claude works on matching files. If you want help trimming, our ten-point CLAUDE.md checklist covers it.
Skill or subagent?
A skill adds its text to your main conversation. A subagent has its own context window and returns only a summary. Use a subagent when the work reads many files and you only want the conclusion. Use a skill when the content should sit next to the conversation.
They also combine: a subagent can preload skills, and a skill can run in an isolated context. See how to write a SKILL.md for the file itself.
Instruction or lock?
This is the one that costs people most. "Never edit .env" in CLAUDE.md or in a skill is a request. The model usually follows it, but nothing stops it. A PreToolUse hook that blocks the edit is enforcement. The documentation says to put guardrails in hooks if a rule has to hold every time.
Two guides on this site cover the enforced side: a starter list of permission rules and three hooks to paste.
What each one costs in context
- CLAUDE.md: its full text is in every request.
- Skill: the description is in every request, the full text only when used. A skill with side effects can set
disable-model-invocation: trueso it runs only when you name it. - Hook: nothing, unless the hook prints something back.
- Subagent: kept out of your main window; only the summary comes back.
- MCP server: low until a tool is used, because tool search is on by default.
Four small examples
- "Use pnpm, not npm": a line in CLAUDE.md.
- "Our release checklist": a skill, called with its name when you release.
- "Run Prettier on every file Claude edits": a hook.
- "Find where this error comes from across forty files": a subagent, so only the answer lands in your conversation.
Limits
- The categories overlap and Anthropic's documentation is the authority. Features and limits may change.
- We did not measure token savings. The costs above are how the documentation describes loading.
- This page does not cover plugins, MCP servers or output styles in depth.
This follows Anthropic's "Extend Claude Code" overview as we read it in October 2026. That page is the authority, and we are not affiliated with Anthropic. We wrote this from the documentation and have not tested every claim.
If you want a second pair of eyes on your CLAUDE.md and settings, the Tune-Up Kit is a checklist for exactly that.