Skills in Claude Code
A skill is a saved instruction file that teaches Claude how to do a specific job. Write it once, store it in your project, and call it any time with a simple slash command — no re-typing needed.
The Problem Skills Solve
Imagine you write tests the same way on every project — same structure, same naming conventions, same coverage rules. Without skills, you either paste those instructions into every chat, or you dump them all into CLAUDE.md where they sit in context even when you're not writing tests. Skills give you a third option: store the instructions in a dedicated file and load them only when you actually need them.
Without skills
You paste the same multi-step instructions into every chat session
In CLAUDE.md
Instructions load on every session — even when you don't need them, spending context budget
As a skill
Instructions stay on disk. Claude loads them only when you type /skill-name
How a Skill is Structured
A skill is a folder inside .claude/skills/. The folder name becomes the slash command. Inside the folder, SKILL.md is the only required file. You can add extra files alongside it for templates, examples, or scripts that the skill references.
SKILL.md focused on the essentials. Put detailed reference material in separate files and link to them from the main file. Claude only loads those extra files when it actually needs them.Worked Example: /write-tests
This skill tells Claude exactly how to write unit tests for any file you point it at — consistent structure, consistent naming, no repeated instructions. After building it you can run /write-tests src/utils/date.ts and Claude will follow the same approach every time.
Create the skill folder
Project skills go in .claude/skills/ — they are available only in this project. Personal skills go in ~/.claude/skills/ and work across every project you open.
Write SKILL.md
The file has two parts. The YAML block at the top (between ---) sets metadata and controls how Claude invokes the skill. The Markdown below it is the actual instruction Claude follows.
descriptionClaude uses this to decide when to auto-load the skill
disable-model-invocation: trueYou trigger it manually — Claude won't run it on its own
allowed-toolsClaude can Read files and run jest without asking each time
$ARGUMENTSReplaced with whatever you type after /write-tests
Use the skill
Type the skill name followed by the file path. Claude reads SKILL.md, substitutes $ARGUMENTS with your path, and works through the steps.
Where Skills Live
You can store skills at three levels depending on how widely you want to share them. When two skills share the same name, the broader scope wins.
~/.claude/skills/skill-name/Available to: Every project you open
Good for habits you carry everywhere — your personal code style, changelog format, etc.
.claude/skills/skill-name/Available to: Only this project
Commit this folder to Git so the whole team gets the same skills automatically.
Managed settings (admin)Available to: All users in your organisation
Useful for company-wide standards — security checklists, release procedures, PR templates.
Key Frontmatter Fields
The YAML block at the top of SKILL.md controls how and when the skill is used. Every field is optional — start with just description and add others as you need them.
| Field | What it does | When to use it |
|---|---|---|
description | Tells Claude what this skill is for and when it applies | Always — helps Claude decide whether to suggest the skill |
name | Overrides the display name (defaults to the folder name) | When your folder name is not human-friendly |
disable-model-invocation | Prevents Claude from calling the skill on its own | For actions with side effects you want to trigger yourself |
user-invocable | Set false to hide the skill from the / menu | For background reference material, not user-facing commands |
allowed-tools | Tools Claude can use without a per-use approval prompt | When the skill needs to run scripts or read files automatically |
arguments | Named placeholders for positional arguments ($name, $0, $1⬦) | When your skill accepts more than one input value |
context: fork | Runs the skill in an isolated sub-agent, separate from your chat | For heavy tasks that should not pollute the main conversation |
Who Can Invoke a Skill
By default any skill can be triggered by you or by Claude. Two flags let you lock down that behaviour when you need more control.
Both you and Claude
default — no extra field neededClaude spots when your request matches the description and loads the skill automatically. You can also call it any time with /skill-name.
You only
disable-model-invocation: trueClaude will never call this skill on its own. Only you can trigger it. The skill description is also hidden from Claude's context so it doesn't factor into its decisions.
Claude only
user-invocable: falseRemoved from the / command menu, so it won't appear when you type /. Claude still loads it when it decides the skill is relevant to the current task.
Passing Arguments
Anything you type after the skill name is available inside the skill as $ARGUMENTS. If you need to access individual words separately, use $0 for the first, $1 for the second, and so on.
One argument — $ARGUMENTS
A skill that summarises a branch name passed in as a single value:
Multiple arguments — $0, $1
A skill that moves a component from one folder to another:
Built-in Skills
Claude Code includes a handful of ready-made skills. You do not need to create any files for these — they are available in every session. Call them the same way as your own skills.
/simplifyMakes code shorter and clearer without changing its behaviour
/debugWalks through a bug methodically — hypothesis, investigation, fix
/batchApplies the same operation to a list of files at once
/loopRepeats a task in a cycle until you tell it to stop
/claude-apiLets Claude call the Anthropic API directly from within a session
SKILL.md files internally — they work exactly the same way as skills you write yourself. There is no special API behind them.Quick Reference
Create a skill
Call a skill
List all skills
What's Next
Skills are powering your Claude Code workflow. The next lesson covers debugging — how to diagnose, fix, and iterate when things go wrong.