Claude Code Skills Reference

How to write and run Claude Code skills: where SKILL.md files load from, every frontmatter field, who can invoke a skill, arguments, supporting files, dynamic context with !commands, running in a forked sub-agent, pre-approving tools, how skill content stays in context, bundled skills, and troubleshooting.

On this page

Simple definition#

A skill is a folder with a SKILL.md file: YAML frontmatter saying what it is and when to use it, followed by Markdown instructions. Claude sees every skill’s description in each session and loads the body only when the skill is invoked — by you typing /skill-name, or by Claude deciding it fits the task. Skills hold procedures and team knowledge that would otherwise bloat CLAUDE.md.

How skills and sub-agents load into context · drawn with Archify · zoom, guided views, search and SVG/PNG export. © 2026 Samir Kumar Sahoo, all rights reserved. Open full screen ↗

Your first skill#

---
name: summarize-changes
description: Summarize uncommitted changes and flag risks. Use when asked what changed.
---
## Current changes
!`git diff HEAD`

## Instructions
Summarize the changes above in two or three bullets, then list risks such as missing
error handling, hardcoded values or tests that need updating.

Save as .claude/skills/summarize-changes/SKILL.md. Then either ask “What did I change?” (Claude invokes it) or type /summarize-changes.

Where skills load from#

Location Path Loads in
Enterprise .claude/skills/<name>/SKILL.md in the managed settings directory Every user on managed machines
Personal ~/.claude/skills/<name>/SKILL.md All your projects (not cloud sessions)
Project .claude/skills/<name>/SKILL.md This repository — commit it for the team
Nested <subdir>/.claude/skills/<name>/SKILL.md Sessions in, or working on files under, <subdir> (monorepos)
--add-dir .claude/skills/ in the added directory That session
Plugin <plugin>/skills/<name>/SKILL.md Where enabled, as /plugin-name:skill-name
claude.ai Skills enabled on your account Cowork, cloud, and terminal sessions signed in with that account

.claude/commands/<name>.md is the older single-file format and still works; prefer skills for new work (they support supporting files). Edits on disk apply after /reload-skills.

Frontmatter#

All fields are optional; description is the one that matters. Unknown fields are silently ignored — check spelling.

Field Does
name Command name (defaults to the folder name)
description What it does and when to use it — Claude matches requests against this. Put the key use first; description + when_to_use are truncated at 1,536 characters
when_to_use Extra trigger phrases or example requests
argument-hint Autocomplete hint, e.g. issue-number
arguments Named positional arguments for $name substitution
disable-model-invocation true: only you can run it (/name); its description leaves Claude’s context
user-invocable false: only Claude can use it; hidden from the / menu
allowed-tools Tools pre-approved for the turn that invokes the skill
disallowed-tools Tools removed while the skill is active
model, effort Model and effort for the rest of the current turn (or for the fork)
context: fork Run in a sub-agent with the skill as its prompt
agent Which sub-agent type runs the fork (e.g. Explore)
background With fork: false waits for the result instead of running in the background
hooks Hooks registered when the skill runs, for the rest of the session
paths Glob patterns — auto-load only when working on matching files
shell bash (default) or powershell for ! commands
metadata, license, compatibility Accepted, not acted on (for your tooling and the open spec)

Who can invoke a skill#

Frontmatter You (/name) Claude In context
default Yes Yes Description always; body when invoked
disable-model-invocation: true Yes No Nothing until you invoke it
user-invocable: false No Yes Description always; body when invoked

/deploy staging at the start of a message runs the skill; go ahead and /deploy later in a sentence only permits Claude to run it. You can stack up to six inline skills at the start of one message in the terminal.

Arguments#

Placeholder Becomes
$ARGUMENTS Everything after the skill name
$0, $1… or $ARGUMENTS0… Positional arguments
$name Named argument from arguments:
---
name: migrate-component
description: Migrate a component between languages
argument-hint: component from-lang to-lang
disable-model-invocation: true
---
Migrate the $0 component from $1 to $2. Preserve all existing behaviour and tests.

/migrate-component SearchBar JavaScript TypeScript. If no placeholder is used, Claude Code appends ARGUMENTS: <input> so nothing is lost.

Supporting files and dynamic context#

release/
├── SKILL.md          # overview and steps — keep under 500 lines
├── checklist.md      # loaded only when SKILL.md points Claude to it
└── scripts/bump.sh   # executed, not loaded
  • Reference supporting files from SKILL.md (“for the full checklist, see checklist.md”) so Claude knows when to read them.
  • !`command` runs before Claude sees the skill and inlines the output — live git diff, gh pr view, environment facts. (disableSkillShellExecution turns this off.)

Run a skill in a sub-agent#

---
name: pr-summary
description: Summarize the current pull request
context: fork
agent: Explore
allowed-tools: Bash(gh *)
---
## Pull request
!`gh pr view --json title,body,files`

Summarize what changed and why, list risky files, and suggest reviewers.
  • The sub-agent doesn’t see your conversation — the skill must contain a complete task. A skill of pure guidelines under fork returns nothing useful.
  • Forks run in the background by default (in -p and SDK runs they wait); set background: false to wait.
  • A background fork’s edits are outside your checkpoints — use Git to revert them.
  • To hand over the whole conversation instead, use /subtask (a forked sub-agent), not context: fork.

Tools and permissions#

allowed-tools: Bash(git add *) Bash(git commit *) Bash(git status *)
  • The grant lasts for the turn that invokes the skill and clears on your next message; the skill text stays.
  • Workspace trust does not gate allowed-tools — a project skill can pre-approve tools even in a -p run in an untrusted folder. Review committed skills before scripting over someone else’s repository.
  • allowManagedPermissionRulesOnly makes Claude Code ignore allowed-tools in project and personal skills.
  • Deny Skill(name) in permissions, or use skillOverrides in settings, to hide a skill without editing it.

How skill content behaves over time#

  • The rendered body enters the conversation once and stays across turns — every line is a recurring token cost, so state what to do, not why.
  • Re-invoking with identical content adds a short note, not a second copy.
  • After compaction, Claude Code re-attaches the latest invocation of each skill (first 5,000 tokens each, within a shared budget).
  • Sub-agents with skills: in their definition get the full body at start-up, not just the description.

Bundled skills#

Claude Code ships skills such as /code-review, /simplify, /verify, /run, /debug, /doctor, /loop, /batch, /fewer-permission-prompts, /update-config and /claude-api. Turn them off with disableBundledSkills. See the commands cheatsheet.

Measuring and iterating#

  • /skills lists skills; press t to sort by token cost; Space cycles visibility.
  • /skill-doctor shows each skill’s context cost and how often it’s used — retire the unused.
  • The skill-creator skill runs evals: realistic prompts with and without the skill, scored, to tune descriptions.

Troubleshooting#

Symptom Fix
Never triggers Put the use case first in description; add when_to_use phrases; check frontmatter parses (opening --- on line 1)
Triggers too often Narrow the description, add paths:, or set disable-model-invocation: true
Claude stops following it mid-session The skill was compacted away or contradicted — re-invoke it, or shorten it
Description cut short Too many skills; lower count or raise skillListingBudgetFraction
Personal skills missing Cloud sessions don’t load ~/.claude/skills/; commit to the repo or a plugin

Common mistakes#

Review questions#

What does Claude see about a skill before it’s invoked? Its name and description (unless disable-model-invocation: true, in which case nothing). The body loads only on invocation.

How do you make a release skill that only a human can start? Set disable-model-invocation: true; it then runs only when someone types /release.

Why review allowed-tools in a repository’s skills before running claude -p there? Workspace trust doesn’t gate it, so a committed skill can pre-approve tools in a non-interactive run.

References#