# Use CLAUDE.md for always-on rules, skills for on-demand steps, subagents for isolation, hooks for guarantees

> In Claude Code, CLAUDE.md holds rules that always apply, skills hold steps loaded on demand, subagents isolate work in a separate context, hooks run code on events, and MCP servers connect external tools.

## Answer

Put rules Claude must always know in CLAUDE.md. Put steps it needs only sometimes in a skill. Use a subagent when a task would flood your conversation, and a hook when something must happen every time without Claude deciding. Use an MCP server when Claude needs to reach an external system. This page follows the Claude Code docs as checked on 2026-09-28 (Claude Code 2.1.284). The docs carry a dedicated comparison page, which suggests the question is common. I found no search or forum data to say how common.

## Details

### Terms in one line each

- **CLAUDE.md**: a markdown file of instructions that Claude Code loads at the start of every session.
- **Skill**: a markdown file of instructions or a workflow, loaded when you type `/<name>` or when Claude judges it relevant.
- **Subagent**: a worker with its own context window. Only its summary returns to your conversation.
- **Hook**: a script, HTTP request, prompt or subagent that Claude Code runs at a lifecycle event, such as after a file edit.
- **MCP server**: a separate program that gives Claude tools and data from an external service.

### Decision table

| If your sentence is... | Use | Why (per the docs) |
|---|---|---|
| "Claude should always know this" | CLAUDE.md | Loaded every session |
| "Only sometimes needed" or "I paste this playbook again and again" | Skill | Description loads each session, full text only on use |
| "This side task floods my chat" | Subagent | Own context, returns a summary |
| "It must happen every time" or "never do X" | Hook | Fires on its event; instructions are requests, not guarantees |
| "Claude needs data or actions from a system it cannot see" | MCP server | Provides the tools and connection |

### What each one costs in context

| Feature | Loads | Cost |
|---|---|---|
| CLAUDE.md | Session start, full text | Every request |
| Skill | Description at start, body when used | Low; descriptions every request |
| MCP server | Tool names at start, full schemas on demand | Low until a tool is used (tool search is on by default) |
| Subagent | When spawned | Isolated from the main session |
| Hook | On trigger | Zero unless it returns output |

A skill with `disable-model-invocation: true` in its frontmatter is hidden from Claude until you invoke it yourself. The docs recommend this for skills with side effects.

### When several definitions collide

CLAUDE.md files are additive: every level contributes. Skills and subagents override by name, so one definition wins. Hooks merge, so every registered hook fires.

### Worked example: one small repo, all five

1. **CLAUDE.md**: "Use pnpm, not npm. Run the tests before committing." Two lines, true in every session. The docs suggest keeping the file under 200 lines.
2. **Skill** `release`: a checklist for tagging and publishing, with `disable-model-invocation: true` so only you start it with `/release`.
3. **Subagent**: a reviewer that reads many files and returns only its findings.
4. **Hook**: run the linter after every file edit, or block edits to `.env`.
5. **MCP server**: a connection to the issue tracker, so Claude can read tickets.

Start with step 1 only. Add the rest when a trigger appears. The docs' trigger for CLAUDE.md is that Claude gets a convention wrong twice.

### Common mistakes

- Writing "never edit `.env`" in CLAUDE.md and treating it as enforced. Only a hook can block the edit.
- Letting CLAUDE.md grow into reference material. Move it to a skill.
- Vague or overlapping skill descriptions. Claude may load the wrong skill or miss the right one.
- Using a subagent for a small task that needs the whole conversation. It only has the context you pass it.
- Expecting a hook to reason. It runs the same way every time.

## See also

- [[agents-md-vs-claude-md]]
- [[mcp-vs-agent-skills]]
- [[how-to-write-agents-md]]
- [[instruction-file-ignored-by-agent]]
- [[mcp-too-many-tools-context-bloat]]

## Sources

- [Claude Code — Extend Claude Code](https://code.claude.com/docs/en/features-overview)

## Sources

- [Claude Code — Extend Claude Code](https://code.claude.com/docs/en/features-overview)