Skip to content

Skills5 min readBy Startpacks

Claude Code Skills vs Subagents vs Commands

Skills add know-how to the current chat, subagents work in their own context, and commands are now skills. A decision table plus files to copy.

Claude Code gives you several ways to package instructions: skills, subagents, slash commands and CLAUDE.md. They overlap enough to be confusing. Here's the short version, checked against Claude Code's docs on 20 Oct 2026: a skill adds know-how to the conversation you're in, a subagent does a job in its own separate context, and custom commands have been merged into skills. The rest of this guide shows when to pick which, with files you can copy. Browse ready-made skill packs on the Claude Code skills hub.

The comparison in one table

SkillSubagentCommand (.claude/commands/)CLAUDE.md
File.claude/skills/<name>/SKILL.md.claude/agents/<name>.md.claude/commands/<name>.mdCLAUDE.md
Runs inYour current conversationIts own context windowYour current conversationEvery session
LoadedDescription always; full text when invokedWhen Claude delegates or you @-mention itWhen invokedAt session start
Who triggers itYou (/name) or ClaudeClaude, or you by nameYou (/name) or ClaudeAlways on
Own tools / modelCan pre-approve tools for a turnYes: tools, model, permissionsSame fields as skillsNo
Best forProcedures and reference knowledgeNoisy or isolated jobs that return a summaryExisting command filesShort, always-true project rules

Skills: know-how that loads on demand

A skill is a folder with a SKILL.md file: YAML frontmatter that says when to use it, then the instructions. In a normal session Claude sees only the skill descriptions; the full content loads when the skill is invoked. That's what makes skills cheap compared with putting everything in CLAUDE.md.

Here's a real skill from our free Supabase Vite SaaS pack, abridged:

---
name: rls-first-migration
description: Use whenever adding or changing a Supabase table, policy, view or function. Produces a migration with RLS, grants and a pgTAP test together.
---
# RLS-first migration
1. `supabase migration new add_<table>`; edit only the new file.
2. In the same file: create table, enable row level security, revoke all from anon
   and authenticated, grant back the minimum.
3. One policy per operation, each with `to <role>`.
...
8. `supabase db reset && supabase test db`. Fix until green.

The description is written as a trigger ("Use whenever..."), which is what Claude matches against your request. The docs truncate long descriptions in the skill listing, so put the key use case first.

Two frontmatter fields control who can invoke a skill:

FrontmatterYou can invokeClaude can invoke
(default)YesYes
disable-model-invocation: trueYesNo; use it for side effects like /deploy
user-invocable: falseNoYes; use it for background knowledge

Commands: now just skills

According to the docs, custom commands have been merged into skills. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy and work the same way. Your existing command files keep working; if both exist with the same name, the skill wins. For new work the docs recommend skills, because a skill folder can hold supporting files such as templates and scripts.

A manual-only "command" written as a skill:

---
name: release-notes
description: Draft release notes from merged PRs since the last tag
disable-model-invocation: true
allowed-tools: Bash(git log *) Bash(git tag *)
---
1. Find the last tag with `git tag --sort=-creatordate | head -1`.
2. List commits since then with `git log <tag>..HEAD --oneline`.
3. Group them into Features, Fixes and Internal. Draft only; do not tag or push.

allowed-tools pre-approves those commands for the turn that invokes the skill. It doesn't restrict other tools; your permission settings still apply.

Subagents: a separate worker with its own context

A subagent is a Markdown file in .claude/agents/ with its own system prompt, tool list and optional model. It starts with a fresh context, does the work and returns a summary. Use one when the job would flood your conversation with logs or search results, or when you want hard tool limits, like a reviewer with no Edit tool.

---
name: pr-reviewer
description: Reviews the current branch's diff for correctness, tests and security. Use before opening a PR.
tools: Read, Grep, Glob, Bash
model: inherit
---
Review `git diff main...HEAD`. Every blocker cites file:line and evidence.
Max ~10 comments. Draft only: never post, approve or merge.

That role comes from our free Pull Request Reviewer agent. Our subagents examples guide has four complete files.

Combining them

The two features connect in both directions:

  • Subagent loads skills: list skills under skills: in a subagent's frontmatter and their full content is injected at startup. The free Test-First Engineer works well this way, with its red-green-refactor-loop skill preloaded.
  • Skill runs in a subagent: add context: fork to a skill, and optionally agent: <type>, to run it in a separate subagent context instead of your conversation.

How to decide

Ask these in order:

  1. Is it true for every task in this repo? Put it in CLAUDE.md (or AGENTS.md imported by it), and keep it short. The docs suggest under 200 lines.
  2. Is it a procedure or reference you need sometimes? Make it a skill.
  3. Should only you be able to trigger it, because it has side effects? A skill with disable-model-invocation: true.
  4. Does it produce lots of output, need different tools, or a cheaper model? Make it a subagent.
  5. Do you need it to always happen, not just be suggested? Use a hook or CI. The memory docs are explicit that CLAUDE.md is context, not enforced configuration.

Common mistakes

  • Putting long procedures in CLAUDE.md. It loads every session. Move them to skills.
  • Vague skill descriptions. "Database helper" won't match. "Use whenever adding or changing a Supabase table" will.
  • Giant SKILL.md files. The docs suggest keeping SKILL.md under 500 lines and moving reference material into supporting files in the same folder.
  • A subagent for a two-line task. A fresh context has to rediscover things. Use the main conversation for quick, iterative work.

FAQ

Are Claude Code skills the same as agents? No. A skill adds instructions to the current conversation. A subagent is a separate worker with its own context, tools and model that returns a summary.

Do my old slash commands still work? Yes. Files in .claude/commands/ keep working and create the same /name command.

Where do I install a skill? .claude/skills/<name>/SKILL.md for one project (commit it), or ~/.claude/skills/<name>/SKILL.md for all your projects.

Can Claude run a skill without me typing /name? Yes, by default, when your request matches the description. Set disable-model-invocation: true to stop that.

Should skills go in CLAUDE.md instead? Only if they apply to every task. Otherwise a skill keeps your always-on context small.

Try it

Copy the skills/ folder of a free pack into .claude/skills/, for example from Supabase Vite SaaS, and ask Claude for a task that matches one description. Then turn the Pull Request Reviewer into a subagent and compare how much stays out of your chat. Our earlier guide on using skills effectively covers writing your own.

  • #claude code skills
  • #subagents
  • #slash commands
  • #skill.md
  • #claude code skills vs agents

Sources

The packs, agents and prompts used in this guide.

Browse all packs

More guides