Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
Claude Code Skills (also called slash commands or custom commands) are reusable, markdown-based instruction files that extend Claude Code's capabilities. When a developer types /skillname in a Claude Code session, the system loads the corresponding markdown file and uses it as a prompt, giving Claude specific instructions for a task or workflow. Skills follow the open Agent Skills standard, which works across multiple AI coding tools1). The feature was introduced in late 2025 and has since evolved into a full programmable agent platform with subagent execution, dynamic context injection, and lifecycle hooks2).
Skills are markdown files stored in specific directories. When a user types / in Claude Code, the system displays a list of available commands — both built-in and custom. Claude Code reads the skill's description to determine when it should be loaded automatically, or the user can invoke a skill directly by name.
The lifecycle of a skill invocation:
Skill descriptions are loaded into context so Claude knows what skills are available, but the full skill content only loads when actually invoked. This keeps token usage efficient3).
Each skill is a directory containing a SKILL.md file as the entrypoint, plus optional supporting files:
my-skill/
├── SKILL.md # Main instructions (required)
├── template.md # Template for Claude to fill in
├── examples/
│ └── sample.md # Example output showing expected format
└── scripts/
└── validate.sh # Script Claude can execute
The SKILL.md file has two parts: YAML frontmatter (between — markers) that configures behavior, and markdown content with instructions Claude follows when the skill is invoked.
--- name: deploy description: Deploy the application to production disable-model-invocation: true allowed-tools: Bash(npm *), Bash(git *) --- Deploy $ARGUMENTS to production: 1. Run the test suite 2. Build the application 3. Push to the deployment target 4. Verify the deployment succeeded
Legacy .claude/commands/ files (plain markdown without a directory wrapper) continue to work and support the same frontmatter. Skills are the recommended format since they support additional features like supporting files and subagent execution4).
All frontmatter fields are optional. Only description is recommended so Claude knows when to use the skill5).
| Field | Description |
|---|---|
| name | Display name and /slash-command. Defaults to the directory name. Lowercase letters, numbers, hyphens; max 64 characters. |
| description | What the skill does and when to use it. Claude uses this to decide when to auto-invoke. Truncated at 250 characters in the listing. |
| argument-hint | Hint shown during autocomplete, e.g. [issue-number] or [filename] [format]. |
| disable-model-invocation | Set true to prevent Claude from auto-loading the skill. User must invoke manually with /name. |
| user-invocable | Set false to hide from the / menu. For background knowledge only Claude should apply. |
| allowed-tools | Tools Claude can use without asking permission when this skill is active. |
| model | Override the model used when this skill is active. |
| effort | Override the effort level (low, medium, high, max). |
| context | Set fork to run in an isolated subagent context. |
| agent | Which subagent type to use when context: fork is set (e.g. Explore, Plan, or a custom agent). |
| hooks | Hooks scoped to the skill's lifecycle. |
| paths | Glob patterns that limit when the skill activates. |
| shell | Shell for inline commands (bash or powershell). |
Skills support variable substitution for dynamic values in their content:
| Variable | Description |
|---|---|
| $ARGUMENTS | All arguments passed when invoking the skill. |
| $ARGUMENTS[N] | Access a specific argument by zero-based index. |
| $N | Shorthand for $ARGUMENTS[N] (e.g. $0, $1). | |
| ${CLAUDE_SESSION_ID} | The current session ID. |
| ${CLAUDE_SKILL_DIR} | The directory containing the skill's SKILL.md. |
Example with positional arguments:
--- name: migrate-component description: Migrate a component from one framework to another --- Migrate the $0 component from $1 to $2. Preserve all existing behavior and tests.
Running /migrate-component SearchBar React Vue substitutes the values into the prompt6).
Where a skill is stored determines its scope:
| Location | Path | Applies To |
|---|---|---|
| Enterprise | Managed settings (organization-deployed) | All users in the organization |
| Personal | ~/.claude/skills/<skill-name>/SKILL.md | All of the user's projects |
| Project | .claude/skills/<skill-name>/SKILL.md | The specific project only |
| Plugin | <plugin>/skills/<skill-name>/SKILL.md | Projects where the plugin is enabled |
When skills share the same name across levels, higher-priority locations win: enterprise overrides personal, which overrides project. Plugin skills use a plugin-name:skill-name namespace so they cannot conflict with other levels7).
Project skills (stored in .claude/skills/ or .claude/commands/) are committed to version control and shared with the entire team. Personal skills (stored in ~/.claude/skills/ or ~/.claude/commands/) are private to the developer and work across all projects.
Claude Code also supports automatic discovery from nested directories in monorepos. Editing a file in packages/frontend/ causes Claude to also check packages/frontend/.claude/skills/8).
Claude Code ships with several bundled skills available in every session. Unlike built-in commands (which execute fixed logic), bundled skills are prompt-based playbooks that let Claude orchestrate work using its tools9):
| Skill | Purpose |
|---|---|
| /batch <instruction> | Orchestrate large-scale parallel changes across a codebase using git worktrees. |
| /claude-api | Load Claude API and Agent SDK reference for the project's language. |
| /debug [description] | Enable debug logging and troubleshoot session issues. |
| /loop [interval] <prompt> | Run a prompt repeatedly on an interval (e.g. polling a deployment). |
| /simplify [focus] | Review recent changes for code reuse, quality, and efficiency; spawns three parallel review agents. |
Built-in commands like /help, /compact, /clear, /model, /effort, /copy, and /permissions are separate from skills — they execute fixed logic directly rather than loading prompt-based instructions10).
A skill for generating blog posts with a static site generator11):
--- name: new-post description: Create a new blog post draft disable-model-invocation: true argument-hint: <title> --- I want to create a new blog post with the following title: $ARGUMENTS 1. Generate the proper kebab-case filename with today's date 2. Create the file with the appropriate scaffolding command 3. Update the front matter with title, date, and draft status 4. Show the command to serve the site locally for preview
Invoke with: /new-post My Article Title
The !`command` syntax runs shell commands before the skill content reaches Claude, injecting live data into the prompt12):
--- name: pr-summary description: Summarize changes in a pull request context: fork agent: Explore allowed-tools: Bash(gh *) --- ## Pull request context - PR diff: !`gh pr diff` - PR comments: !`gh pr view --comments` - Changed files: !`gh pr diff --name-only` ## Your task Summarize this pull request concisely.
Two frontmatter fields control who can trigger a skill:
| Frontmatter | User Can Invoke | Claude Can Invoke |
|---|---|---|
| (default) | Yes | Yes |
| disable-model-invocation: true | Yes | No |
| user-invocable: false | No | Yes |
Skills and hooks both extend Claude Code, but they serve fundamentally different purposes13):
| Aspect | Skills | Hooks |
|---|---|---|
| Nature | Prompt-based instructions Claude follows | Shell commands, HTTP calls, or LLM prompts that execute automatically |
| Trigger | User types /skillname or Claude auto-detects relevance | Lifecycle events fire automatically (PreToolUse, PostToolUse, Stop, etc.) |
| Purpose | Add reusable workflows, context, and capabilities | Validate actions, enforce policies, automate side effects |
| Can block actions | No — advisory only | Yes — can block tool execution (exit code 2 or decision: block) |
| Configuration | SKILL.md files in skills directories | JSON in settings files or hooks.json |
| User interaction | Interactive — user invokes and sees results | Transparent — runs in the background |
| Analogy | A recipe card Claude follows | A guard rail or tripwire that fires on events |
When to use skills: Repeatable workflows (code review, deployment, test generation), encoding team knowledge, prompt templates that benefit from reuse.
When to use hooks: Preventing dangerous commands (blocking rm -rf), auto-formatting files after edits, enforcing linting on every save, loading environment variables at session start.