Key Takeaway
Claude Code offers four extension mechanisms that people constantly confuse. Skills are on-demand procedures the model loads when relevant, hooks are deterministic scripts that fire on events, subagents are isolated helpers with their own context, and MCP connects external tools and data. Each solves a different problem, and the trick is matching mechanism to intent.
If you have spent any time steering Claude Code, you have met skills, hooks, subagents, and MCP servers. They overlap enough to be confusing and differ enough that using the wrong one quietly wastes effort. This guide draws the line between them so you can reach for the right mechanism on the first try.
The short version is that they answer four different questions. Skills answer how should I do this task; hooks answer what must always happen; subagents answer who should handle this in isolation; and MCP answers where the data and tooling come from. Keep those questions in mind and the decision usually makes itself.
| Mechanism | What it is | When it runs | Best for |
|---|---|---|---|
| Skills | Reusable instructions and scripts the model loads on demand | Model decides, based on task relevance | Encoding a repeatable procedure or house style |
| Hooks | Shell commands wired to lifecycle events | Deterministically, on a matching event | Guardrails like formatting, linting, or blocking edits |
| Subagents | A separate assistant with its own context and tools | When the main session delegates a task | Isolating noisy research or adversarial review |
| MCP | A protocol connecting external tools, data, and services | When the model calls a connected tool | Reaching systems outside the local repo |
Skills: procedures the model reaches for
A skill packages a chunk of know-how into a folder that Claude discovers and loads only when a task looks relevant. Instead of pasting the same setup steps or coding conventions into every prompt, you write them once as a skill and let the model pull them in when needed. This keeps the base context lean while the procedure stays one trigger away.
Skills shine when the knowledge is reusable but not always needed. Good candidates share a few traits:
- A well-defined procedure with clear steps, such as cutting a release or generating a migration.
- A house style or checklist you want applied consistently without repeating yourself.
- Optional helper scripts the skill can run, so the model executes proven commands rather than improvising.
Hooks: deterministic guardrails
A hook is a shell command that fires automatically on a lifecycle event, such as before a tool runs or after a file is edited. Unlike a skill, a hook is not a suggestion the model may or may not follow; it runs every time its event matches, which makes it the right tool for rules that must never be skipped.
Use hooks to format code on save, run a linter before a commit, block edits to protected paths, or log every command for later audit. Because they are deterministic, they turn fuzzy instructions like please always run the formatter into a guarantee the model cannot forget.
When you catch yourself writing always or never in a prompt, that is usually a hook, not a skill. Prompts persuade; hooks enforce. Move hard rules into a hook and free the model to focus on judgment calls instead.
Subagents and MCP: isolation and reach
The last two mechanisms extend Claude beyond the current chat. Subagents extend it inward into parallel contexts, while MCP extends it outward into external systems.
- A subagent runs a task in its own context window and returns only a summary, so bulky file reads or an adversarial review never crowd your main conversation.
- MCP is an open protocol that connects the model to external tools, data sources, and services through a standard interface, so the same server works across different clients.
- The two compose well: a subagent can call MCP tools inside its isolated context, keeping both the noise and the external calls out of the main session.
Do not reach for MCP when a local script would do. Every connected server adds tool definitions to the context and a new surface to secure. If a plain command or a skill can accomplish the task inside the repo, that is almost always the cheaper and safer choice.
Choosing the right mechanism
Start from intent. If you want the model to follow a repeatable procedure, write a skill. If you want something to happen every time without exception, write a hook. If a task will flood the context or benefits from a fresh perspective, delegate to a subagent. If you need data or actions from outside the repository, connect an MCP server.
These are not mutually exclusive, and mature setups layer them. A hook can enforce a gate, a skill can describe the workflow, a subagent can run the heavy lifting, and an MCP server can supply the external data all in the same project. The skill is knowing which job each one is actually doing.
Skills, hooks, subagents, and MCP are not competing features but four answers to four different questions. Match the mechanism to the intent, layer them deliberately, and Claude Code stops feeling like a black box and starts behaving like a system you designed on purpose.

