Skills

NEW

Domain expertise defined via SKILL.md files that Claude applies automatically

What are Skills?

A Skill is a SKILL.md file with YAML frontmatter that teaches Claude how to do something specific. When you ask Claude something matching a Skill's description, it automatically applies the skill's instructions, tools, and context.

Automatic Invocation

Claude detects when a Skill is relevant and applies it automatically based on the description

SKILL.md Format

YAML frontmatter for metadata + markdown body for instructions and context

Hot Reload

Skills reload automatically when modified β€” no session restart needed

Where Skills Live

LocationPathApplies To
EnterpriseManaged SettingsAll users in organization
Personal~/.claude/skills/You, across all projects
Project.claude/skills/Anyone in this repository
Pluginskills/ in pluginAnyone with plugin installed

Priority order: Enterprise > Personal > Project > Plugin (higher wins on name conflicts)

SKILL.md Structure

Simple Skill

---
name: explaining-code
description: Explains code with visual diagrams and analogies. Use when explaining how code works.
---

When explaining code, always include:

1. **Start with an analogy**: Compare the code to something from everyday life
2. **Draw a diagram**: Use ASCII art to show the flow
3. **Walk through the code**: Explain step-by-step what happens
4. **Highlight a gotcha**: What's a common mistake?

Advanced Skill with Full Frontmatter

---
name: pdf-processing
description: Extract text, fill forms, merge PDFs. Use when working with PDF files.
allowed-tools: Read, Bash(python:*)
model: claude-opus-4-5-20251101
context: fork
---

# PDF Processing

## Quick start
Extract text:
```python
import pdfplumber
with pdfplumber.open("doc.pdf") as pdf:
    text = pdf.pages[0].extract_text()
```

For form filling, see [FORMS.md](FORMS.md).

Frontmatter Fields

FieldRequiredDescription
nameYesLowercase letters, numbers, hyphens (max 64 chars)
descriptionYesWhat it does and when to use (max 1024 chars)
allowed-toolsNoRestrict tools Claude can use (e.g., Read, Grep, Bash)
modelNoOverride model (e.g., claude-opus-4-5-20251101)
contextNoSet to "fork" for isolated sub-agent context
agentNoAgent type when context: fork (Explore, Plan, etc.)
hooksNoDefine PreToolUse, PostToolUse, Stop handlers
user-invocableNoShow in slash menu (default: true)

Skills with Hooks

Skills can define hooks that run during the skill's lifecycle. Hooks are scoped to the skill and automatically cleaned up when it finishes.

Example: Security Check Hook

---
name: secure-operations
description: Perform operations with additional security checks
hooks:
  PreToolUse:
    - matcher: "Bash"
      hooks:
        - type: command
          command: "./scripts/security-check.sh $TOOL_INPUT"
          once: true
---

Security-first operations with automatic validation.

Skills vs Other Options

Use ThisWhen You Want To...When It Runs
SkillsGive Claude specialized knowledgeClaude chooses when relevant
Slash CommandsCreate reusable promptsYou type /command
CLAUDE.mdSet project-wide instructionsLoaded every conversation
SubagentsDelegate to separate contextClaude delegates or explicit
HooksRun scripts on eventsOn specific tool events
MCP ServersConnect to external toolsClaude calls as needed

Multi-File Skills (Progressive Disclosure)

For complex skills, put essential info in SKILL.md and detailed docs in separate files. Claude reads the supporting files only when needed, keeping context lean.

pdf-processing/
β”œβ”€β”€ SKILL.md # Overview and navigation
β”œβ”€β”€ FORMS.md # Loaded when needed
β”œβ”€β”€ REFERENCE.md # Loaded when needed
└── scripts/
β”œβ”€β”€ fill_form.py # Executed, not loaded
└── validate.py

Tip: Keep SKILL.md under 500 lines. Scripts in the skill directory can be executed without loading into context.

Testing Your Skills

View Available Skills

What Skills are available?

Test a Skill

Ask a question matching the skill description, or invoke directly with /skill-name:

How does this code work?

Start Building Skills

Create your first skill to encode your team's standards, workflows, and domain knowledge.

Read Full Documentation