Create your first Skill
This example creates a personal Skill that teaches Claude to explain code using visual diagrams and analogies. Unlike Claude’s default explanations, this Skill ensures every explanation includes an ASCII diagram and a real-world analogy.1
Check available Skills
Before creating a Skill, see what Skills Claude already has access to:Claude will list any Skills currently loaded. You may see none, or you may see Skills from plugins or your organization.
2
Create the Skill directory
Create a directory for the Skill in your personal Skills folder. Personal Skills are available across all your projects. (You can also create project Skills in
.claude/skills/ to share with your team.)3
Write SKILL.md
Every Skill needs a
SKILL.md file. The file starts with YAML metadata between --- markers and must include a name and description, followed by Markdown instructions that Claude follows when the Skill is active.The description is especially important, because Claude uses it to decide when to apply the Skill.Create ~/.claude/skills/explaining-code/SKILL.md:4
Load and verify the Skill
Exit and restart Claude Code to load the new Skill. Then verify it appears in the list:You should see
explaining-code in the list with its description.5
Test the Skill
Open any file in your project and ask Claude a question that matches the Skill’s description:Claude should ask to use the
explaining-code Skill, then include an analogy and ASCII diagram in its explanation. If the Skill doesn’t trigger, try rephrasing to include more keywords from the description, like “explain how this works.”How Skills work
Skills are model-invoked: Claude decides which Skills to use based on your request. You don’t need to explicitly call a Skill. Claude automatically applies relevant Skills when your request matches their description. When you send a request, Claude follows these steps to find and use relevant Skills:1
Discovery
At startup, Claude loads only the name and description of each available Skill. This keeps startup fast while giving Claude enough context to know when each Skill might be relevant.
2
Activation
When your request matches a Skill’s description, Claude asks to use the Skill. You’ll see a confirmation prompt before the full
SKILL.md is loaded into context. Claude matches requests against descriptions using semantic similarity, so write descriptions that include keywords users would naturally say.3
Execution
Claude follows the Skill’s instructions, loading referenced files or running bundled scripts as needed.
Where Skills live
Where you store a Skill determines who can use it:| Location | Path | Applies to |
|---|---|---|
| Enterprise | See managed settings | All users in your organization |
| Personal | ~/.claude/skills/ | You, across all projects |
| Project | .claude/skills/ | Anyone working in this repository |
| Plugin | Bundled with plugins | Anyone with the plugin installed |
When to use Skills versus other options
Claude Code offers several ways to customize behavior. The key difference: Skills are triggered automatically by Claude based on your request, while slash commands require you to type/command explicitly.
| Use this | When you want to… | When it runs |
|---|---|---|
| Skills | Give Claude specialized knowledge (e.g., “review PRs using our standards”) | Claude chooses when relevant |
| Slash commands | Create reusable prompts (e.g., /deploy staging) | You type /command to run it |
| CLAUDE.md | Set project-wide instructions (e.g., “use TypeScript strict mode”) | Loaded into every conversation |
| Subagents | Delegate tasks to a separate context with its own tools | Claude delegates, or you invoke explicitly |
| Hooks | Run scripts on events (e.g., lint on file save) | Fires on specific tool events |
| MCP servers | Connect Claude to external tools and data sources | Claude calls MCP tools as needed |
For a deep dive into the architecture and real-world applications of Agent Skills, read Equipping agents for the real world with Agent Skills.
Configure Skills
This section covers Skill file structure, supporting files, tool restrictions, and distribution options.Write SKILL.md
TheSKILL.md file is the only required file in a Skill. It has two parts: YAML metadata (the section between --- markers) at the top, and Markdown instructions that tell Claude how to use the Skill:
Available metadata fields
You can use the following fields in the YAML frontmatter:| Field | Required | Description |
|---|---|---|
name | Yes | Skill name. Must use lowercase letters, numbers, and hyphens only (max 64 characters). Should match the directory name. |
description | Yes | What the Skill does and when to use it (max 1024 characters). Claude uses this to decide when to apply the Skill. |
allowed-tools | No | Tools Claude can use without asking permission when this Skill is active. See Restrict tool access. |
model | No | Model to use when this Skill is active (e.g., claude-sonnet-4-20250514). Defaults to the conversation’s model. |
Update or delete a Skill
To update a Skill, edit itsSKILL.md file directly. To remove a Skill, delete its directory. Exit and restart Claude Code for changes to take effect.
Add supporting files with progressive disclosure
Skills share Claude’s context window with conversation history, other Skills, and your request. To keep context focused, use progressive disclosure: put essential information inSKILL.md and detailed reference material in separate files that Claude reads only when needed.
This approach lets you bundle comprehensive documentation, examples, and scripts without consuming context upfront. Claude loads additional files only when the task requires them.
Example: multi-file Skill structure
Claude discovers supporting files through links in yourSKILL.md. The following example shows a Skill with detailed documentation in separate files and utility scripts that Claude can execute without reading:
SKILL.md file references these supporting files so Claude knows they exist:
- Complex validation logic that would be verbose to describe in prose
- Data processing that’s more reliable as tested code than generated code
- Operations that benefit from consistency across uses
SKILL.md, tell Claude to run the script rather than read it:
Restrict tool access with allowed-tools
Use theallowed-tools frontmatter field to limit which tools Claude can use when a Skill is active:
- Read-only Skills that shouldn’t modify files
- Skills with limited scope: for example, only data analysis, no file writing
- Security-sensitive workflows where you want to restrict capabilities
allowed-tools is omitted, the Skill doesn’t restrict tools. Claude uses its standard permission model and may ask you to approve tool usage.
allowed-tools is only supported for Skills in Claude Code.Use Skills with subagents
Subagents do not automatically inherit Skills from the main conversation. To give a custom subagent access to specific Skills, list them in the subagent’sskills field in .claude/agents/:
skills field is omitted, no Skills are preloaded for that subagent.
Built-in agents (Explore, Plan, Verify) and the Task tool do not have access to your Skills. Only custom subagents you define in
.claude/agents/ with an explicit skills field can use Skills.Distribute Skills
You can share Skills in several ways:- Project Skills: Commit
.claude/skills/to version control. Anyone who clones the repository gets the Skills. - Plugins: To share Skills across multiple repositories, create a
skills/directory in your plugin with Skill folders containingSKILL.mdfiles. Distribute through a plugin marketplace. - Enterprise: Administrators can deploy Skills organization-wide through managed settings. See Where Skills live for enterprise Skill paths.
Examples
These examples show common Skill patterns, from minimal single-file Skills to multi-file Skills with supporting documentation and scripts.Simple Skill (single file)
A minimal Skill needs only aSKILL.md file with frontmatter and instructions. This example helps Claude generate commit messages by examining staged changes:
Use multiple files
For complex Skills, use progressive disclosure to keep the mainSKILL.md focused while providing detailed documentation in supporting files. This PDF processing Skill includes reference docs, utility scripts, and uses allowed-tools to restrict Claude to specific tools:
SKILL.md:
If your Skill requires external packages, list them in the description. Packages must be installed in your environment before Claude can use them.
Troubleshooting
View and test Skills
To see which Skills Claude has access to, ask Claude a question like “What Skills are available?” Claude loads all available Skill names and descriptions into the context window when a conversation starts, so it can list the Skills it currently has access to. To test a specific Skill, ask Claude to do a task that matches the Skill’s description. For example, if your Skill has the description “Reviews pull requests for code quality”, ask Claude to “Review the changes in my current branch.” Claude automatically uses the Skill when the request matches its description.Skill not triggering
The description field is how Claude decides whether to use your Skill. Vague descriptions like “Helps with documents” don’t give Claude enough information to match your Skill to relevant requests. A good description answers two questions:- What does this Skill do? List the specific capabilities.
- When should Claude use it? Include trigger terms users would mention.
Skill doesn’t load
Check the file path. Skills must be in the correct directory with the exact filenameSKILL.md (case-sensitive):
| Type | Path |
|---|---|
| Personal | ~/.claude/skills/my-skill/SKILL.md |
| Project | .claude/skills/my-skill/SKILL.md |
| Enterprise | See Where Skills live for platform-specific paths |
| Plugin | skills/my-skill/SKILL.md inside the plugin directory |
--- on line 1 (no blank lines before it), end with --- before the Markdown content, and use spaces for indentation (not tabs).
Run debug mode. Use claude --debug to see Skill loading errors.
Skill has errors
Check dependencies are installed. If your Skill uses external packages, they must be installed in your environment before Claude can use them. Check script permissions. Scripts need execute permissions:chmod +x scripts/*.py
Check file paths. Use forward slashes (Unix style) in all paths. Use scripts/helper.py, not scripts\helper.py.
Multiple Skills conflict
If Claude uses the wrong Skill or seems confused between similar Skills, the descriptions are probably too similar. Make each description distinct by using specific trigger terms. For example, instead of two Skills with “data analysis” in both descriptions, differentiate them: one for “sales data in Excel files and CRM exports” and another for “log files and system metrics”. The more specific your trigger terms, the easier it is for Claude to match the right Skill to your request.Plugin Skills not appearing
Symptom: You installed a plugin from a marketplace, but its Skills don’t appear when you ask Claude “What Skills are available?” Solution: Clear the plugin cache and reinstall:skills/ directory at the plugin root: