
Skills, MCP, Subagents, Hooks or Plugins? Picking the Right Extension
- كاتب موثّق
- Claude Code 2.x
محتويات المقال
/triage skill. It holds everything: a curl command with the error tracker's API token pasted in, "read every file in logs/ until you find the request", the triage playbook, and "ALWAYS run the regression suite before you finish!!!". It half works. The token gets committed with .claude/skills/. The log reads fill the conversation until it compacts. Claude skips the regression suite on days it decides a fix is trivial. And when a second team wants the same thing, they copy the folder and the two versions drift apart.
The common misconception
They really do overlap. A skill can run in a subagent, a subagent can preload skills, a hook can call an MCP tool, and a plugin can contain all of them. A skill can run shell commands, so it looks like it could stand in for an MCP server or a hook. They all live as files under .claude/or in settings, and several show up in the same/menu.Installing a plugin adds skills, agents, hooks and servers in one step, so "plugin" sounds like a capability itself.
What actually happens
Five questions, five answers
What should Claude know, or how should it do a task? A : a SKILL.mdfile of instructions or reference material. The docs call skills "the most flexible extension".What can Claude reach? An server: tools for an external system, "with the connection and authentication handled by the server". The docs' trigger: you keep copying data into chat from another tool. Where should the work happen? A : its own context window and instructions. It can read dozens of files, and your conversation receives only its summary. What must happen every time? A : Claude Code runs it at a lifecycle event, such as after every edit, without Claude deciding. How does this reach another repo or team? A : the packaging layer. It bundles skills, agents, hooks and MCP servers into one installable unit.
Who pulls the trigger
/name, or Claude matches its description to your task. Claude decides when to call an MCP tool or delegate to a subagent. Nobody decides when a hook runs; its event fires and Claude Code runs it. That's why "always run the regression suite" fails inside a skill: a skill is instructions Claude interprets, and the docs say plainly that its outcome can vary.
What each one costs in context
/name) or Claude, from the description | |||
The triage skill, split up
---description: Triage a bug ticket---1. Fetch the error: curl -H "Authorization: Bearer sntrys_EXAMPLE" \ "https://errors.example.com/api/issues/$ARGUMENTS/latest"2. Read every file in logs/ until you find the request.3. Find the root cause and fix it.4. ALWAYS run pnpm test:regression before you finish!!!---description: Triage a bug ticket from its error-tracker issue. Use when the user shares a ticket ID or an issue link.---1. Get the issue and its latest event with the tracker's MCP tools.2. Hand the log search to the log-digger subagent. Ask it for the failing request and its trace ID, nothing else.3. Write the root cause, the fix and how you checked it.curl call and its token became an MCP server, which handles the connection; the credential comes from an OAuth sign-in or an environment variable, not a committed file. The log search became a subagent, so forty log files no longer pass through the main conversation. The ALWAYS line became a Stop hook that runs the regression suite whenever Claude tries to finish. What's left in the skill is what only a skill does well: the judgment steps.
triage-kit/├── .claude-plugin/plugin.json # manifest: the name "triage-kit"├── skills/triage/SKILL.md # the playbook: /triage-kit:triage├── agents/log-digger.md # subagent: searches logs, returns a summary├── hooks/hooks.json # Stop hook: runs the regression suite└── .mcp.json # the error tracker's MCP server/triage-kit:triage and can't collide with a team's own /triage. Both teams now update one plugin instead of two copies.
How to apply it in your project
Take inventory Run /hooks,/mcpand/pluginto see what's configured, and/contextto see what it costs.Ask the five questions of each piece Knowledge, reach, isolation, guarantee or packaging? A skill that does two of those is two things. Move secrets out of skills Credentials belong in an MCP server's configuration, at local scope if they shouldn't be committed. Move "always" out of skills A skill line that must hold every time becomes a hook, and the skill keeps the steps that need judgment. Package only when it travels Skills, subagents, hooks and MCP servers all work without a plugin. Build one when a second repo or team needs the setup.
Key takeaways
A skill changes what Claude knows or how it works; Claude or you decide when it loads. An MCP server changes what Claude can reach, with auth handled by the server. A subagent changes where the work happens; only its summary comes back. A hook changes what always happens, because Claude Code runs it on an event. A plugin changes nothing on its own: it ships the other four, and it costs context in every session it's enabled.
التعليقات (0)