Claude Code — Agent Skills
Agent Skills are reusable, composable capabilities: a directory containing a SKILL.md file with YAML frontmatter plus a markdown body, optionally alongside supporting files (templates, examples, scripts). Claude discovers them automatically and invokes them when their description matches the task — or you invoke them directly with /<name>.
Custom slash commands were merged into Skills: .claude/commands/review.md and .claude/skills/review/SKILL.md both create /review and behave the same. On a name conflict, the skill wins.
Locations and precedence
| Location | Scope |
|---|---|
| Managed settings (enterprise) | Organization-wide |
~/.claude/skills/<name>/SKILL.md | Personal, all projects |
.claude/skills/<name>/SKILL.md | Project, committed |
<plugin>/skills/<name>/SKILL.md | Plugin-bundled, namespaced plugin-name:skill-name |
Precedence on the same name: enterprise > personal > project.
Discovery extras:
- Monorepos: editing files in
packages/frontend/also loadspackages/frontend/.claude/skills/. - Skills in
--add-dirdirectories load with live change detection.
SKILL.md structure
---
name: changelog
description: Drafts a user-facing changelog entry from the commits since the last tag. Use when preparing a release.
argument-hint: "[version]"
allowed-tools: Bash(git log *), Bash(git tag *)
---
Draft a changelog entry for version $ARGUMENTS.
1. Run `git tag` to find the latest tag.
2. Run `git log <tag>..HEAD --oneline` for the commits.
3. Group them into Added / Changed / Fixed, written for users, not developers.
Current git status for context:
!`git status --short`
Keep SKILL.md under 500 lines; put longer reference material in supporting files next to it and link to them from the body.
Frontmatter fields
All optional, but description is strongly recommended — it drives auto-invocation.
| Field | Purpose |
|---|---|
name | Defaults to the directory name; lowercase letters, numbers, hyphens; max 64 chars |
description | What the skill does and when to use it |
argument-hint | Shown in the / autocomplete |
disable-model-invocation | Default false; true = only the user can invoke it |
user-invocable | Default true; false = hidden from the / menu |
allowed-tools | Tools the skill may use |
model | Model override |
context: fork | Run the skill in a forked subagent |
agent | Subagent type for the fork (e.g. Explore) |
hooks | Skill-scoped hooks |
Invocation
- Type
/<name>— autocomplete shows everything available. - Or let Claude invoke it automatically from the
description. - Chain skills at the start of a message (v2.1.199+):
/skill-a /skill-b do XYZ, up to six.
Argument substitution
| Placeholder | Replaced with |
|---|---|
$ARGUMENTS | Everything after the command |
$ARGUMENTS[N] | The Nth argument |
$N | Shorthand for $ARGUMENTS[N] |
${CLAUDE_SESSION_ID} | The current session ID |
If $ARGUMENTS doesn’t appear anywhere in the body, the arguments are appended as ARGUMENTS: <value>.
Dynamic context injection
A !`command` placeholder runs the shell command before the skill content reaches Claude; the command’s output replaces the placeholder. Including the word ultrathink in the body enables extended thinking.
Permissions and budget
- Permission rules:
Skill(deny all skills),Skill(commit)(exact),Skill(review-pr *)(prefix). - Skill descriptions share a budget of 2% of the context window (fallback 16,000 chars); override with
SLASH_COMMAND_TOOL_CHAR_BUDGET. Check consumption with/context.
Last verified: 2026-09-07
Official sources:
AI coding tools evolve quickly. If you find outdated information, please open an issue or pull request.