Claude Code Guide

Claude Code Skills

Everything about Claude Code skills in one place: what a SKILL.md is, the full frontmatter reference, every bundled skill, where skills live, dynamic context injection, and copy-paste examples. Verified against the official Anthropic docs.

By Hasan Aboul Hasan Updated July 2026 Claude Code v2.1.x Part of the Claude Code Guide
Last verified: July 24, 2026 against the official Anthropic Claude Code docs.

What is a Claude Code skill?

The one-paragraph answer, then the details.

A Claude Code skill is a SKILL.md file — YAML frontmatter plus markdown instructions — stored in a .claude/skills/<name>/ folder. Claude loads it automatically when your request matches the skill's description, or you run it directly with /skill-name. Unlike CLAUDE.md, a skill's body loads only when it is used, so long reference material costs almost nothing in context until you need it.

Create a skill when you keep pasting the same instructions, checklist, or multi-step procedure into chat, or when a section of your CLAUDE.md has grown from a fact into a procedure. Claude Code skills follow the open ↗ Agent Skills standard, so the same SKILL.md works across multiple AI tools, and Claude Code adds extras on top: invocation control, subagent execution, and dynamic context injection.

💡 Commands merged into skills
Custom commands and skills are now the same system. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy. Your existing .claude/commands/ files keep working — skills just add supporting files, frontmatter, and auto-loading.

Skill vs command vs subagent vs MCP

Four things people mix up. Here is the clean line between them.

Building blockWhat it isReach for it when
SkillReusable instructions in SKILL.md, loaded on demandYou repeat the same procedure or reference and want Claude to apply it automatically
Slash commandThe same thing — commands merged into skillsYou want a manual /trigger; add frontmatter to upgrade it into a full skill
SubagentA separate context window that does a side-task and reports backYou want focused work done without spending your main context
MCP serverAn external tool/data connector (GitHub, Postgres, Playwright)You need Claude to reach a system outside the repo

They compose: a skill can be set to run in a subagent, and its instructions can tell Claude to call an MCP tool. See subagents and MCP in the main guide.

Where skills live

The folder you choose decides who can use the skill.

ScopePathApplies to
Personal~/.claude/skills/<name>/SKILL.mdAll your projects
Project.claude/skills/<name>/SKILL.mdThis project only (commit it to share with the team)
Plugin<plugin>/skills/<name>/SKILL.mdWherever the plugin is enabled (namespaced plugin:skill)
EnterpriseManaged settingsAll users in your organization
⚡ Precedence & monorepos
When a name clashes, enterprise > personal > project, and any of them overrides a bundled skill of the same name. In a monorepo, a nested .claude/skills/ (e.g. apps/web/.claude/skills/deploy) loads the first time Claude touches a file in that directory and shows up as /apps/web:deploy, so a package can ship its own skills.

Bundled skills

Skills that ship with Claude Code — available in every session.

Bundled skills are prompt-based: they hand Claude a detailed procedure and let it orchestrate the work with its tools. You invoke them with a slash, the same as any skill.

SkillWhat it does
/doctorSetup checkup for your Claude Code install
/code-reviewStructured review of your changes. Runs only when you invoke it (v2.1.215+)
/debugStructured debugging of a failing behavior
/batchParallel work across git worktrees
/loopRepeat a prompt on an interval
/claude-apiAuto-loads the Claude API reference when your code imports the Anthropic SDK
/runv2.1.145+. Launch and drive your app to see a change working
/verifyv2.1.145+. Build and run the app to confirm a change works. Invoke-only (v2.1.215+)
/run-skill-generatorv2.1.145+. Records how to build and launch your project so /run and /verify stop guessing
💡 Turning them off
Disable every bundled skill (except /doctor) with the disableBundledSkills setting. You can also shadow any bundled skill by creating your own skill with the same name — a project code-review replaces the bundled /code-review.

Create your first skill

A real, useful skill in two files. Copy, paste, done.

This skill summarizes your uncommitted changes and flags anything risky. It pulls the live diff into the prompt before Claude reads it, so the answer is grounded in your actual working tree. Claude loads it when you ask what changed, or you invoke it with /summarize-changes.

Step 1 — make the folder (personal, so it works in every project):

terminal
mkdir -p ~/.claude/skills/summarize-changes

Step 2 — write the skill:

~/.claude/skills/summarize-changes/SKILL.md
---
description: Summarizes uncommitted changes and flags anything risky. Use when the user asks what changed, wants a commit message, or asks to review their diff.
---

## Current changes

!`git diff HEAD`

## Instructions

Summarize the changes above in two or three bullet points, then list any
risks you notice such as missing error handling, hardcoded values, or tests
that need updating. If the diff is empty, say there are no uncommitted changes.

The !`git diff HEAD` line is dynamic context injection: Claude Code runs the command and replaces the line with its output before Claude sees the skill, so the instructions arrive with your real diff already inlined. Open a project, make an edit, and ask "what did I change?" — or type /summarize-changes.

💡 Keep the body short
Once a skill loads, its content stays in context across turns, so every line is a recurring token cost. State what to do, not how or why. Move long reference material and examples into separate files in the skill folder and point to them from SKILL.md.

SKILL.md frontmatter reference

Every field is optional. Only description is recommended.

FieldWhat it does
nameDisplay name in skill listings. Defaults to the directory name (which is also the command you type)
descriptionWhat the skill does and when to use it — Claude reads this to decide when to auto-load. Put the key use case first (capped at ~1,536 chars with when_to_use)
when_to_useExtra trigger context: example requests or phrases. Appended to description
disable-model-invocationSet true so Claude never auto-runs it — manual /name only. Ideal for deploys
user-invocableSet false to hide it from the / menu (background knowledge only)
allowed-toolsTools pre-approved without a permission prompt for the invoking turn
disallowed-toolsTools removed from the pool while the skill is active
modelModel override while the skill is active (or inherit)
effortEffort level while active: low / medium / high / xhigh / max
contextSet fork to run the skill in its own subagent context
agentWhich subagent type to use when context: fork is set
backgroundWith fork, set false to wait for the result in the same turn (v2.1.218+)
argument-hintAutocomplete hint for expected arguments, e.g. [issue-number]
argumentsNamed positional args for $name substitution in the body
hooksHooks scoped to this skill's lifecycle
pathsGlob patterns that limit when the skill auto-activates
shellbash (default) or powershell for inline !`command` blocks

Dynamic context & arguments

Feed live data and user input into a skill.

Command injection runs a shell command and inlines its output before Claude reads the skill. Wrap a command in !`…` anywhere in the body:

inside SKILL.md
## Open pull requests

!`gh pr list --limit 20`

## Instructions

Group the PRs above by author and flag any open longer than a week.

Argument substitution passes what the user typed after the command into the body:

PlaceholderExpands to
$ARGUMENTSEverything passed after the command name
$0, $1A single argument by position (shorthand for $ARGUMENTS[N])
$nameA named argument declared in the arguments frontmatter list
${CLAUDE_SKILL_DIR}The skill's own folder — use it to call a bundled script from anywhere
${CLAUDE_PROJECT_DIR}The project root
${CLAUDE_SESSION_ID}The current session ID (logging, session-specific files)

Run a skill in a subagent

Keep heavy or noisy work out of your main context.

Add context: fork and the skill runs in its own subagent with a fresh context window. Pair it with disable-model-invocation: true for workflows you always trigger by hand, agent to pick the subagent type, and background: false when you want the result back in the same turn.

.claude/skills/deploy/SKILL.md
---
name: deploy
description: Deploy the application to production
context: fork
disable-model-invocation: true
---

Deploy the application:
1. Run the test suite
2. Build the application
3. Push to the deployment target

Popular skills & where to find more

Battle-tested skills, and the directories worth bookmarking.

Remotion
Generate motion graphics and videos with code. Auto-activates when Remotion code is detected.
Frontend Design
Anthropic's official skill. Hands Claude a design system and philosophy before it writes any UI code.
Superpowers
A full dev workflow: brainstorming, TDD, code review, and git worktree automation in one skill pack.
Claude API
Bundled. Auto-loads the Claude API reference the moment your code imports the Anthropic SDK.

Browse the ecosystem

↗ awesome-claude-skills Curated GitHub list
↗ AgentSkills.io Open standard directory
↗ SkillsMP.com Skills marketplace

Claude Code Skills FAQ

Quick answers to the questions people actually search.

A skill is a SKILL.md file (YAML frontmatter plus markdown instructions) in a .claude/skills/<name>/ folder. Claude loads it automatically when your request matches the description, or you run it directly with /skill-name. Its body loads only when used, so it costs almost no context until you need it.
They merged. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy. Skills add a folder for supporting files, frontmatter to control invocation, and automatic loading when relevant.
Personal skills go in ~/.claude/skills/<name>/SKILL.md (all your projects); project skills go in .claude/skills/<name>/SKILL.md (that repo only, commit to share). Enterprise and plugin skills are also supported. On a name clash, enterprise beats personal beats project, and any of them beats a bundled skill of the same name.
Prompt-based bundled skills include /doctor, /code-review, /batch, /debug, /loop, and /claude-api, plus the run-and-verify trio /run, /verify, and /run-skill-generator (v2.1.145+). As of v2.1.215, /verify and /code-review run only when you invoke them.
Add disable-model-invocation: true to the frontmatter. Claude won't load it automatically; it runs only when you type /skill-name. Use it for deploys, releases, and other actions you want to trigger by hand.
Yes. Add context: fork and the skill runs in a forked subagent with its own context window. Use agent to pick the subagent type and background: false to wait for the result in the same turn.
← Part of the Claude Code Guide
This is one chapter of the full Claude Code Guide — setup, permissions, commands, hooks, subagents, agent teams, MCP, the Agent SDK, and the workflows that actually work.
By Hasan Aboul Hasan · LearnWithHasan.com · 2026