CONCEPT Three ways to package behaviour — one axis separates them
Subagents, skills, and slash commands all extend Claude Code, but they differ on two questions: who invokes it and which context window it runs in.
| Mechanism | Invoked by | Runs in | Adds |
|---|---|---|---|
| Subagent | Claude (auto-delegate) or you (explicit) | Its own isolated context window | Context isolation + tool restriction + optionally a different model |
| Skill | Claude (model-invoked) | The same (main) context window | Reusable prompts / workflows / instructions in-context |
| Slash command | You (typed /name) | The same (main) context window | A user-triggered, reusable prompt |
CONCEPT Choosing between them
The official guidance is direct: consider a Skill instead of a subagent when you want reusable prompts or workflows that run in the main conversation context rather than in an isolated subagent context. So:
- Reach for a subagent when the work is verbose or self-contained and you want it out of the main window, or when you need to restrict tools / route to a cheaper model.
- Reach for a skill when you want a reusable capability Claude invokes on its own, but the work should stay in the main conversation with full shared context.
- Reach for a slash command when you want to trigger a reusable prompt on
demand by typing
/name.
DIAGRAM A decision path
SEPARATE context window?
(or restrict tools / model)"} Q1 -->|"yes"| SUB["🟢 Subagent
isolated context + tool/model control"] Q1 -->|"no — keep shared context"| Q2{"Who should trigger it?"} Q2 -->|"Claude, on its own"| SKILL["🔵 Skill
model-invoked, same context"] Q2 -->|"You, by typing /name"| CMD["🟣 Slash command
user-invoked prompt, same context"] classDef ok fill:#d4edda,stroke:#28a745,color:#155724; classDef skill fill:#e7f1ff,stroke:#4a90d9,color:#1a3a5a; classDef cmd fill:#efe3fb,stroke:#9b59b6,color:#5b2a86; class SUB ok; class SKILL skill; class CMD cmd;
CODE Same idea, three packagings
A "code review" capability, expressed each way — note where each lives and who fires it.
# SUBAGENT — .claude/agents/code-reviewer.md # Claude delegates when the task matches; runs in its OWN context. --- name: code-reviewer description: Expert code reviewer. Use proactively after code changes. tools: Read, Grep, Glob --- You are a senior code reviewer... # SKILL — model-invoked, runs in the MAIN context (shares your conversation) # SLASH COMMAND — you type /review to fire a reusable prompt in the MAIN context
TRADE-OFFS Isolated subagent vs. in-context skill/command
✅ Subagent (isolated)
- Keeps verbose work out of the main window
- Can restrict tools and pin a different model
- Independent permissions per agent
⚠️ Skill / command (shared context)
- Full shared context — no re-explaining the situation
- Lower latency; no fresh-start context gathering
- But verbose output lands in your main conversation
EXAM TRAPS
PRACTICE
Q1 · What is the defining difference between a subagent and a skill?
A subagent runs in its own isolated context window (and can restrict tools / use a different model); a skill is model-invoked and runs in the same context as the main conversation.
Q2 · You want a reusable workflow that stays in the main conversation. Which mechanism?
A Skill — the docs specifically recommend a skill over a subagent when you want reusable prompts/workflows in the main context rather than isolated subagent context.
Q3 · What does a subagent add over a slash command?
Context isolation (its own window), tool restriction, and optionally a different model. A slash command is a user-invoked prompt that runs in the main context with no isolation.