The Claude Code docs describe three primitives — skills, subagents, slash commands — and each documentation page is clear enough about what that primitive does. What the docs don't tell you is when to pick which. We've watched teams pick wrong on this over and over. The wrong choice doesn't usually crash; it just makes everything a little worse in ways that compound. Here's a decision tree that actually holds up in practice.
The observation that started this: when we onboard a new engineer to our Claude Code setup, they build things the wrong shape roughly 70% of the time. Slash commands that should have been subagents. Subagents that should have been skills. Skills that should have been three slash commands. The individual mistakes are recoverable, but a codebase full of miscategorized primitives becomes hard to reason about.
What follows is the tree we've been teaching. It's not the only tree that would work. It IS the one that survives contact with real workflows.
The three primitives in one sentence each
Before the tree, a shared vocabulary. If you know these already, skim past.
A slash command is a named workflow the user invokes explicitly (/deploy-staging). It runs a defined sequence of steps, usually with parameters. Think of it as a Makefile target for a Claude Code session.
A subagent is a specialized assistant the user (or another workflow) invokes by name (@pr-reviewer). It works on a task with its own fresh context, tool restrictions, and often its own model. Think of it as delegating to a colleague who specializes in that thing.
A skill is ambient knowledge Claude picks up when relevant, without being explicitly called. Skills describe how to do a class of things (write PRs in our style, format commit messages, review database migrations). Think of it as a house-style guide Claude reads automatically when the topic comes up.
These sound similar. They're not. The differences drive different design decisions.
The decision tree
Start here for any capability you're thinking about adding to your Claude Code setup:
Q1: Does the user need to invoke this BY NAME each time?
├─ YES → Q2 (slash command or subagent)
└─ NO → SKILL (ambient knowledge Claude picks up)
Q2: Is there judgment or multi-step reasoning involved?
├─ YES → Q3 (subagent territory)
└─ NO → SLASH COMMAND (fixed workflow)
Q3: Does the task benefit from a different model,
tool restrictions, or fresh context?
├─ YES → SUBAGENT (worth the ceremony)
└─ NO → SLASH COMMAND (that invokes reasoning inline)Three questions. Each has a clean binary answer for most cases. When you can't answer one of them cleanly, you've found a case worth thinking about — often the shape of the capability itself is wrong.
Why Q1 comes first
The "does the user invoke this by name" question separates ambient knowledge (skills) from explicit invocation (commands/subagents). Skills apply automatically when their topic comes up; users don't remember them or type their names. Commands and subagents are things users deliberately reach for.
A common failure mode: encoding house-style guidance as a slash command. Users have to remember to invoke /format-commit-message before every commit. They don't remember. The rule gets applied inconsistently. Meanwhile, the same guidance as a skill would kick in automatically whenever commit messages come up. Ambient beats invoke-required for behavior that should be uniform.
The mirror failure: encoding a specific one-shot action as a skill. "Skill: deploy to staging by running these commands." Skills don't run things — they teach patterns. Deploying to staging is a specific action the user should invoke deliberately, not ambient knowledge Claude might act on. This should be a slash command.
Why Q2 comes second
Once we know something needs explicit invocation (from Q1), Q2 splits it by how much judgment is involved.
Fixed workflows — do step A, then B, then C — are what slash commands are for. Format a commit, run tests, publish a package, generate release notes with a specific template. The steps are known; there's no meaningful decision-making mid-workflow.
Multi-step tasks with intermediate judgment call for subagents. Reviewing a PR isn't "do A then B then C" — it's "read the diff, decide what to look at first, dig into anything suspicious, form judgments, produce structured feedback." The path depends on what the subagent finds. Slash commands are the wrong shape for this; they force a fixed workflow onto work that requires branching.
Why Q3 exists at all
By Q3, we know the capability needs explicit invocation and involves judgment. In principle both a slash command (with reasoning inline) and a subagent could handle it. The question is whether the extra ceremony of a subagent pays for itself.
Reasons a subagent earns its ceremony:
- Different model. If this task deserves Opus but your session runs on Sonnet (or vice versa), a subagent lets you route it specifically.
- Tool restrictions. If the task should NOT have access to certain tools (a code reviewer shouldn't deploy; a log analyzer shouldn't write files), a subagent scopes tools explicitly.
- Fresh context. If the task benefits from starting clean (not seeing everything the current session has been up to), a subagent gives it a fresh context window.
- Reusable across sessions. If other subagents or workflows should invoke this too, a subagent name is a stable interface.
If none of these apply, a slash command with reasoning inline is simpler and just as effective. Subagent ceremony is worth paying when it buys you something specific; otherwise it's overhead.
Six scenarios walked through
Enough theory. Here are six capabilities we've actually built, walked through the tree.
Scenario 1: Format commit messages in the team's style
Q1: Does the user invoke this by name each time? No. Commit messages happen frequently and shouldn't require the user to remember a special command.
Answer: skill.
The skill describes our commit message format (Conventional Commits with our specific type list, ticket references, etc.). Claude picks it up whenever it's writing a commit message, regardless of context.
The failure mode we avoided: a slash command /commit-formatted that users had to remember. In practice they'd write commits directly and forget, producing inconsistent history.
Scenario 2: Deploy to staging
Q1: Does the user invoke this by name? Yes — deploying is a deliberate action the user chooses.
Q2: Judgment involved? No. The steps are fixed: run tests, build image, push to registry, update staging config, verify health.
Answer: slash command.
A /deploy-staging command runs the fixed workflow. No reasoning needed; the sequence is known. Any variation (like "deploy only these services") gets handled as command parameters.
Scenario 3: Review a pull request
Q1: Invoked by name? Yes — the user chooses when to trigger a review.
Q2: Judgment involved? Yes — reviewing requires reading the diff, deciding what to focus on, forming opinions about code quality.
Q3: Different model / tool restrictions / fresh context? Yes on all three. We want this on Opus (judgment work), we want it strictly read-only (no code writing during review), and we want it starting fresh (not entangled with whatever the user was working on).
Answer: subagent.
A @pr-reviewer subagent with restricted tools, Opus model, and a clean invocation context. The subagent gets called from various places — directly by the user, or by our /review-pr slash command wrapper that adds standard context.
Scenario 4: Generate release notes from git history
Q1: Invoked by name? Yes — release notes generation happens deliberately at release time.
Q2: Judgment involved? Yes — deciding what's user-facing, what to categorize where, which changes need human review.
Q3: Different model, tools, or fresh context? Yes — this benefits from starting fresh (not carrying whatever the current session was doing) and probably wants Sonnet (categorization + writing, not deep reasoning).
Answer: subagent.
A @release-notes-drafter subagent that gets a git commit range and produces a structured draft. Fresh context matters here because the current session might be mid-feature-work; release notes generation shouldn't drag that context in.
Scenario 5: How to write database migrations for our team
Q1: Invoked by name? No — this is guidance that should kick in whenever migrations come up.
Answer: skill.
A skill describes our migration patterns: reversibility requirements, how we handle large tables, our naming conventions, when backfills need to be a separate migration. When Claude is asked to write or modify a migration, the skill's content applies automatically.
The failure mode we avoided: putting this in CLAUDE.md as a wall of text. See the CLAUDE.md bloat post for why that pattern is worse than a skill.
Scenario 6: Generate a summary of what changed this week
Q1: Invoked by name? Yes — user asks for this on demand.
Q2: Judgment involved? Some — deciding what's important, filtering noise. But it's bounded: gather git activity, filter by importance, summarize.
Q3: Different model / tools / fresh context? Not really. Sonnet is fine, no unusual tool restrictions, doesn't especially benefit from fresh context.
Answer: slash command with reasoning inline.
A /weekly-summary command that runs a script to gather git activity and PRs, then asks Claude to synthesize. No need for subagent ceremony; the reasoning is bounded and doesn't benefit from the extra scaffolding.
The mistakes each choice invites
The tree helps you pick the right primitive. Once you've picked, there are still failure modes worth knowing.
Skill-shaped mistakes
The most common skill mistake: writing something too long. Skills apply ambient — every session that touches the relevant topic loads the skill. A 3000-word skill on "our JavaScript style" is 3000 words of context tax on every JS-touching session. Skills should be tight: a page or less, focused on the specific things Claude gets wrong without the skill.
The second most common: writing a skill that duplicates what Claude already knows. "Skill: how to write good tests" — but Claude already knows how to write good tests in general. What you actually need to encode is where your team differs from the general: your specific test framework choices, your naming patterns, your mock strategies. Skills teach the delta from default behavior, not the default behavior itself.
Subagent-shaped mistakes
The most common subagent mistake: building one that does too many things. "@code-quality" that does reviews AND writes tests AND checks style AND scans security. Each of those is its own subagent; combining them dilutes each capability. If your subagent's description has "and" or "or" in it, it's probably two subagents.
The second most common: no tool restrictions. A subagent with access to every tool the main session has isn't really a subagent — it's just a slash command with extra ceremony. The point of subagents includes scoping what they can do; skipping that scoping wastes the primitive.
Slash-command-shaped mistakes
The most common slash command mistake: encoding logic that has real branching. "Command: review this PR" that tries to embed all the judgment steps of code review in a fixed workflow. Sooner or later the fixed workflow hits a case it can't handle and produces bad output. If your command's description says "then decide whether to..." it wants to be a subagent.
The second most common: writing commands for things that should be scripts. If the command has no reasoning at all — just "run these bash commands in this order" — you probably don't need Claude in the loop. A shell script or Makefile target is simpler, faster, and doesn't consume tokens.
What the tree doesn't answer
The tree tells you which primitive to use. It doesn't tell you whether the capability is worth building at all. That's a separate question and it's often the more important one.
Before applying the tree, ask: does this capability need to exist? A lot of proposed skills/subagents/commands are solutions in search of problems. A skill for a pattern that comes up twice a year, a subagent for a task that takes 30 seconds manually, a slash command for a workflow one person runs monthly — these accumulate cost (maintenance, cognitive load, token overhead) without paying much back.
The tree also doesn't handle multi-primitive capabilities well. Some real workflows combine primitives: a slash command that invokes a subagent that draws on a skill. That's fine, but it's not one decision — it's three decisions in coordination. The tree tells you what each piece should be; you have to orchestrate them yourself.
The meta-point
The three primitives feel similar in the docs because they all extend Claude Code with team-specific behavior. In practice, they solve different classes of problems, and picking the wrong one produces subtle degradation that's hard to attribute.
Skills that should have been commands get applied inconsistently. Commands that should have been subagents produce brittle output on unexpected inputs. Subagents that should have been skills add friction to routine work. Each individual case is recoverable; a codebase that's made these mistakes systematically is much harder to fix later.
Take the ten minutes to walk through the tree before shipping a new primitive. In our experience, roughly a third of proposals shift shape once we walk them through — usually collapsing from "skill AND command AND subagent" to just one of those, or discovering that the capability shouldn't exist at all. Ten minutes now saves months of unwinding later.
Get cctk running in one command
85 slash commands, 12 subagents, 12 MCP integrations, 12 hooks. All the patterns from this post are shipped in cctk.