Guide · Compare · ★☆☆☆☆
Claude Code skills vs subagents vs hooks vs slash commands
Four features, four folders. Pick by asking one question: who should start it, you, Claude, or an event?
By Arthur Hsiao · Last updated · 4 min read
The short answer. A slash command runs when you type it. A skill loads when Claude sees a matching task. A subagent is a second Claude that the main one hands a job to. A hook runs on an event, every time, whether Claude wants it or not.
Compare them side by side
| Tool | Where it lives | Who starts it | Best for |
|---|---|---|---|
| Slash command | .claude/commands/review.md | You, by typing /review | A prompt you type often |
| Skill | .claude/skills/<name>/SKILL.md | Claude, when the task matches the description | A long "how to do X" with files and steps |
| Subagent | .claude/agents/<name>.md | Claude, when the job matches the description | Big jobs that need their own context or model |
| Hook | settings.json plus a script | An event, such as before or after a tool call | Rules that must run every time |
Each folder also works in your home folder (~/.claude/...), which makes it available in every project.
1Use a slash command for a prompt you repeat
A slash command is one Markdown file. Its content becomes the prompt when you type / and the file name. No code and no settings.
--- description: Review my uncommitted changes --- Review the changes in my current git diff. Look for bugs, security problems and style issues. Don't edit any files.
Reach for it when you catch yourself typing the same prompt again. Full steps: Claude Code custom slash commands.
2Use a skill for a workflow Claude should pick up by itself
A skill is a folder with a SKILL.md. Only its name and one-line description sit in the session. Claude reads the rest when a task matches.
--- name: arttie-reels description: Make an Instagram Reel (short 9:16 video) of Arttie with a hook, on-screen text, original background music and a Minion-style gibberish voice. Use when Arthur asks for a reel, a video, or an animated post for @arttie_0629. ---
That is the skill I use to make short videos. I never type its name. I ask for a reel, and Claude loads it.
Reach for a skill when the instructions are too long for a command, or come with scripts and reference files. Full steps: how to write Claude Code skills.
3Use a subagent for a job that needs its own context
A subagent is a second Claude with its own instructions and its own context window. The main Claude sends it a job, and only the final answer comes back. Long reading and searching stays out of your chat.
--- name: deep-think-master description: Use for complex or planning-heavy tasks: multi-step implementation plans, architecture decisions, hard debugging, or changes spanning 5+ files. Do NOT use for simple edits, quick questions or lookups. model: claude-opus-5-5 ---
This is mine. It plans and debugs on the strongest model, whatever model my chat is on.
Reach for a subagent when the job needs a different model, a fresh pair of eyes, or a lot of reading you don't want in your main chat. Full steps: how to create a Claude Code agent.
4Use a hook for a rule that must never be skipped
A hook is a command Claude Code runs at a fixed moment, such as before a tool call (PreToolUse) or after one (PostToolUse). Claude can forget a line in CLAUDE.md. It can't skip a hook.
"PreToolUse": [
{
"matcher": "mcp__gemini-cli__.*",
"hooks": [
{ "type": "command", "command": "node", "args": ["C:/Users/<you>/.claude/hooks/gemini-secret-scan.js"] }
]
}
]I run two. This one scans every prompt going to Gemini for keys and passwords: Claude Code hooks, with examples. The other runs Prettier after every file Claude edits. Both are in Claude Code hooks, with examples.
5Pick one with three questions
- Must it run every time, with no exceptions? Hook.
- Do you want to start it yourself, by name? Slash command.
- Should Claude decide when it's needed? A skill if it's instructions for the main chat. A subagent if the job should run apart from it.
They also combine. My CLAUDE.md tells Claude to hand every review to a subagent, and a skill can be called like a command by typing / and its name.
Plan mode is not one of them
Plan mode is a setting, not a file. It stops Claude from editing until you approve its plan. You switch it on with Shift+Tab: Claude Code plan mode.
Don't install everything. Each skill's description sits in every session, so hundreds of vague ones cost tokens and make Claude pick the wrong one. Start with one command or one hook that fixes a real annoyance. More in how to save tokens in Claude Code.
Which model a subagent should run on, and how to set it: which Claude Code model to use.