AI agents

Claude Code

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

LocationScope
Managed settings (enterprise)Organization-wide
~/.claude/skills/<name>/SKILL.mdPersonal, all projects
.claude/skills/<name>/SKILL.mdProject, committed
<plugin>/skills/<name>/SKILL.mdPlugin-bundled, namespaced plugin-name:skill-name

Precedence on the same name: enterprise > personal > project.

Discovery extras:

  • Monorepos: editing files in packages/frontend/ also loads packages/frontend/.claude/skills/.
  • Skills in --add-dir directories 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.

FieldPurpose
nameDefaults to the directory name; lowercase letters, numbers, hyphens; max 64 chars
descriptionWhat the skill does and when to use it
argument-hintShown in the / autocomplete
disable-model-invocationDefault false; true = only the user can invoke it
user-invocableDefault true; false = hidden from the / menu
allowed-toolsTools the skill may use
modelModel override
context: forkRun the skill in a forked subagent
agentSubagent type for the fork (e.g. Explore)
hooksSkill-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

PlaceholderReplaced with
$ARGUMENTSEverything after the command
$ARGUMENTS[N]The Nth argument
$NShorthand 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.