Skills vs. tools vs. hooks vs. subagents vs. prompts: when to use what
Agentic coding assistants offer half a dozen extension mechanisms, and picking wrong wastes context or bites silently. One decision table for instructions, skills, MCP tools, hooks, subagents, and slash commands.
Modern agentic coding tools — Claude Code being the deepest example, with Cursor, Codex-style CLIs, and others converging on the same ideas — give you at least six ways to customize behavior. They overlap enough to confuse and differ enough that the wrong pick costs you context, money, or reliability. Here’s the sorting logic.
The six mechanisms in one table
| Mechanism | Lives where | Triggered by | Costs context? |
|---|---|---|---|
| Instructions file (CLAUDE.md / AGENTS.md) | Repo root | Every session, always | Always — keep it lean |
| Skill | Skills directory | Model decides it’s relevant | Only when loaded |
| MCP tool | A server you run | Model calls it | Schema always; calls as used |
| Hook | Settings config | An event, deterministically | No — runs outside the model |
| Subagent | Agents directory | Model (or you) delegates | Isolated — its own window |
| Slash command / prompt | Commands directory | You type it | Only when invoked |
The decision logic
Is it true in every session? → Instructions file. Project facts, commands, conventions, boundaries. The test: would you tell a new teammate this on day one? Then it belongs there — and only such things, because you pay its token cost every single session. Grab the template.
Is it expertise needed only sometimes? → Skill. A how-to the agent should pull in when the situation matches: “how we write migrations,” “how to cut a release,” “our PDF-report styling.” Skills keep the always-loaded footprint at one line of description each, with the full playbook loaded on demand — the difference between a bookshelf and carrying every book.
Does it act on the world outside the conversation? → MCP tool. Databases, ticket systems, internal APIs. Tools are also your enforcement point — validation, redaction, audit — which is why wrapping the API properly matters more than wrapping it quickly.
Must it happen every time, no judgment involved? → Hook. Format on save, lint before commit, block writes to protected paths. The key insight: a hook is deterministic — the model can forget an instruction, but it cannot skip a hook. Anything you’d phrase as “always/never do X before Y” is a hook wearing an instruction’s clothing.
Is it a big, noisy, separable chunk of work? → Subagent. Broad codebase searches, independent reviews, parallel explorations. The subagent burns its own context window and returns only conclusions — your main session stays clean. This is the orchestrator pattern applied to your own working session.
Is it a workflow you start, the same way each time? → Slash command / saved prompt. Reusable parameterized prompts: “prep a release note,” “review this PR against our checklist.” If you’ve typed essentially the same paragraph three times, it’s a command.
The failure modes of choosing wrong
- Situational knowledge in the instructions file → every session pays for expertise used in one session in ten; the file bloats until the model starts skimming it.
- A “never do this” rule as an instruction instead of a hook → it holds until one long session where it doesn’t. Determinism is a feature; use it.
- An MCP tool where a hook belongs → you gave the model discretion over something that shouldn’t be discretionary.
- Main-session searches that belong in a subagent → context fills with file dumps and the actual task degrades.
The meta-rule
Instructions and prompts are suggestions the model weighs; hooks and tool-layer validation are guarantees your infrastructure enforces; skills and subagents are economics — they manage the context budget. Classify what you need (suggestion, guarantee, or economics) and the mechanism usually picks itself.
Was this guide useful?
Thanks — noted. It shapes what gets written next.
newsletter
One practical agentic-AI guide in your inbox. No news, no hype.
Tutorials and decision frameworks as they ship. Unsubscribe anytime.