Claude Certification Guides
CCAR-F/Domain 39 min read

Lesson 3.4

Subagents, Skills and Slash Commands

The three ways to package reusable behaviour in Claude Code, what each one is for, and how they are stored, invoked and scoped.

Claude Code offers three packaging mechanisms for behaviour you want to reuse: slash commands (a prompt you invoke by name), skills (a folder of instructions and supporting files that Claude can load when relevant), and subagents (a separate agent with its own context, prompt and tools). They overlap enough to be confused and differ enough that the exam tests which to pick. The short version: a command is a prompt, a skill is knowledge plus procedure, a subagent is a worker.

Slash commands

A custom command is a Markdown file whose content becomes the prompt when you type /name. Project commands live in .claude/commands/, personal ones in ~/.claude/commands/; subdirectories namespace them for display. Frontmatter can set description, argument-hint, allowed-tools and model.

---
description: Review a pull request by number
argument-hint: [pr-number]
allowed-tools: Bash(gh pr view:*), Bash(gh pr diff:*)
---
Review PR #$ARGUMENTS. Summarise the change, then list risks.
Current diff: !`gh pr diff $ARGUMENTS`

$ARGUMENTS receives everything typed after the command; $1, $2 address positional arguments. A line of the form !`command` runs the shell command before the prompt is sent and splices in its output, which is how a command gathers live context. @path references include files. Commands are user-invoked only; Claude does not trigger them itself.

Skills

A skill is a directory containing a SKILL.md with frontmatter and instructions, plus any supporting files (reference documents, scripts, templates). Skills live in .claude/skills/<name>/ (project), ~/.claude/skills/<name>/ (personal), or inside plugins, and follow the open Agent Skills format that also works in the API, the Agent SDK and Claude.ai.

---
name: release-notes
description: Draft release notes from merged PRs since the last tag. Use when asked to prepare a release or changelog.
allowed-tools: Bash(git log:*), Bash(gh pr list:*), Read
---
1. Find the last tag with `git describe --tags --abbrev=0`.
2. List merged PRs since then.
3. Group by area using the categories in reference.md.
4. Write to CHANGELOG.md in the house style shown in template.md.

The defining property is progressive disclosure: at session start only each skill's name and description are loaded into context. When a task matches the description, Claude loads the full SKILL.md, and reads supporting files only if the instructions direct it to. A library of fifty skills therefore costs a few hundred tokens until one is needed. Supporting scripts let a skill carry deterministic code (a validator, a generator) that Claude runs rather than re-derives.

Skills can be invoked by Claude automatically when relevant, or explicitly as /skill-name. Frontmatter options control this: disable-model-invocation: true makes a skill user-only (appropriate for deploy or publish workflows), while user-invocable: false hides it from the menu so only Claude triggers it. context: fork runs the skill in a separate subagent context, and paths scopes activation to matching files. Slash commands and skills have converged: a skill with a description behaves like a command with a folder behind it, and the documentation treats custom commands as the simpler legacy form.

Subagents

A subagent is a Markdown file in .claude/agents/ or ~/.claude/agents/ with a name, description, optional tools, model, permissionMode and skills, followed by a system prompt. Claude delegates to it through the Agent tool when the description matches, or when the user asks for it by name. It runs in its own context window and returns a summary. Subagents are the mechanism for isolation (keep the main context clean), parallelism (several run at once) and restriction (a reviewer that cannot edit). They are also the slowest to start, because each one pays for its own system prompt and must rediscover context from its brief.

Choosing between them

NeedUse
A prompt you type often, with argumentsSlash command
Domain knowledge and a multi-step procedure Claude should apply when relevantSkill
Reference material too large for CLAUDE.md that is only sometimes neededSkill with supporting files
Work that should not pollute the main context, run in parallel, or use restricted toolsSubagent
A workflow with a side effect that only a human should triggerSkill with disable-model-invocation or a command
Shared team distribution with versioningPlugin bundling any of the above

Combinations are normal: a subagent can preload skills via its skills frontmatter, and a skill can delegate steps to a subagent.

Plugins

Plugins package commands, skills, subagents, hooks and MCP server configuration into an installable unit distributed through a marketplace. They are the recommended way to share configuration across teams, because a plugin updates as a whole and its components are namespaced (/plugin-name:command). Enterprise administrators can preinstall plugins through managed settings.

Exam focus

  • Commands are prompts invoked by the user with /name; $ARGUMENTS and !command`` splice in arguments and shell output.
  • Skills are folders with SKILL.md; only name and description load at start, the rest on demand (progressive disclosure).
  • disable-model-invocation makes a skill user-only; user-invocable: false makes it Claude-only; context: fork runs it in a subagent.
  • Subagents have their own context, tools and model, run in parallel and return a summary; they cost more to start.
  • Project scope (.claude/) is shared and committed; user scope (~/.claude/) is personal; project wins on name conflicts.
  • Plugins bundle all of these with hooks and MCP servers for team distribution.

Check yourself

5 questions

  1. 1.A team wants a shared code-reviewer subagent that is read-only and uses a cheaper model than the main conversation. Which definition is correct?

  2. 2.Where does a project-scoped skill live?

  3. 3.A deploy skill must only ever run when a human types /deploy, never because Claude decides it is relevant. Which frontmatter setting achieves this?

  4. 4.How does progressive disclosure work for skills in Claude Code?

  5. 5.A repository contains both a legacy .claude/commands/review.md and a newer .claude/skills/review/SKILL.md. What happens when the user types /review, and how are the two related?