Claude Code Skills: How to Write a SKILL.md (2026 Guide)
Claude Code skills guide: how SKILL.md works, frontmatter fields, where skills live, and how to write a skill Claude actually loads at the right time.
Claude Code skills are folders of instructions that teach Claude a specific job. Each skill is a SKILL.md file with YAML frontmatter (at minimum a description) followed by markdown instructions, saved at .claude/skills/<name>/SKILL.md for one project or ~/.claude/skills/<name>/SKILL.md for all of them. Claude loads a skill automatically when your request matches its description, or you run it yourself with /<name>. Only the short description sits in context until the skill is used, so you can keep many skills around cheaply.
How skills work
Skills follow the open Agent Skills standard, with some Claude Code extensions on top. Three properties make them useful:
- Progressive disclosure. At startup Claude only sees each skill's description. The full body loads when the skill is invoked, and supporting files load only when the body tells Claude to open them.
- Two ways to trigger. Claude can load a skill on its own when a request matches, and you can invoke it by name with
/skill-nameplus arguments. Both are on by default. - They replace custom commands. A skill at
.claude/skills/deploy/SKILL.mdand a legacy command at.claude/commands/deploy.mdboth create/deploy. Old command files still work, but new work should be skills.
Where skills live
| Location | Path | Scope |
|---|---|---|
| Personal | ~/.claude/skills/<name>/SKILL.md |
All your projects |
| Project | .claude/skills/<name>/SKILL.md |
This repository (commit it to share) |
| Plugin | <plugin>/skills/<name>/SKILL.md |
Wherever the plugin is enabled, as /plugin-name:skill-name |
| Enterprise | Managed settings directory | Everyone in the organization |
If two skills share a name, enterprise beats personal and personal beats project. Run /skills to list what is available, and /reload-skills after adding one mid-session.
Anatomy of a SKILL.md
---
name: summarize-changes
description: Summarizes uncommitted changes and flags anything risky. Use when the user asks what changed or wants a commit message.
---
## Current changes
!`git diff HEAD`
## Instructions
Summarize the changes above in two or three bullet points, then list
any risks you notice, such as missing error handling, hardcoded values,
or tests that need updating.
Save that to ~/.claude/skills/summarize-changes/SKILL.md, then ask "what did I change?" or run /summarize-changes. The !`git diff HEAD` line runs before Claude sees the skill and is replaced by its output.
Frontmatter fields
| Field | What it does |
|---|---|
name |
The command name. Defaults to the folder name |
description |
What the skill does and when to use it. Claude decides from this |
when_to_use |
Extra trigger context, sharing a 1,536-character cap with description |
argument-hint |
Autocomplete hint such as [issue-number] |
disable-model-invocation |
true means only you can run it |
user-invocable |
false hides it from the / menu so only Claude uses it |
allowed-tools |
Tools that run without a prompt during the turn that invokes the skill |
context: fork |
Runs the skill in a subagent |
model, effort |
Override model or effort while the skill is active |
paths |
Glob patterns that limit automatic loading to matching files |
Unrecognized field names are ignored silently, so check spelling.
How to write a skill Claude actually uses
1. Write the description for the trigger, not the reader
The description is the only thing Claude sees before deciding. Lead with the key use case and include the words people actually type. "Generates database migrations. Use when the user asks to add a column, change a schema or write a migration" beats "Migration helper".
2. Decide who pulls the trigger
Anything with side effects, such as deploys, commits, sending messages or releasing builds, should have disable-model-invocation: true. You do not want Claude deciding on its own that now is a good time to deploy. Reference-style skills, like coding conventions or an API cheat sheet, are better left automatic.
3. Keep SKILL.md short and push detail into files
Keep SKILL.md under 500 lines. Put long reference material in sibling files and tell Claude when to read them:
release/
├── SKILL.md
├── checklist.md
└── scripts/
└── bump-version.sh
Use ${CLAUDE_SKILL_DIR} to reference bundled scripts so paths resolve wherever the skill is installed. Scripts are executed, not loaded into context, which keeps them cheap.
4. Put the important instructions first
When a long session compacts, Claude Code re-injects the skills you invoked, but caps each at 5,000 tokens and 25,000 in total, dropping the oldest first. Truncation keeps the start of the file. Critical rules belong at the top.
5. Use arguments for variable parts
$ARGUMENTS is everything typed after the command. $0, $1 and so on pick arguments by 0-based position, and the arguments field lets you name them. If the body has no placeholder, Claude Code appends the arguments at the end.
6. Pre-approve only what the skill needs
allowed-tools: Bash(git log *) Bash(npm run build *) lets those commands run without prompting while the skill is active. Keep it narrow.
Skills vs CLAUDE.md, subagents, hooks and MCP
| Feature | Use it for | Loads |
|---|---|---|
| CLAUDE.md | Rules that apply to every session | Always |
| Skills | Procedures and reference for specific jobs | When relevant or invoked |
| Subagents | Delegating work to a separate context window | When spawned |
| Hooks | Things that must happen automatically, every time | On events |
| MCP servers | New tools and data sources | Names at startup, schemas on demand |
A good rule of thumb: if you find yourself pasting the same instructions into prompts, make a skill. If it must happen every time without anyone remembering, it is a hook; see the Claude Code hooks guide. If it is a rule for every session, keep it in CLAUDE.md, following CLAUDE.md best practices. Skills can also run in a subagent with context: fork; the Claude Code subagents guide explains when that helps.
Portability
Because skills follow an open standard, the same folder can work on claude.ai and the Skills API. Outside Claude Code, only name, description, license, compatibility, metadata and allowed-tools are accepted, and other fields cause a validation error. If you plan to share a skill beyond Claude Code, stick to those.
Skills, skins and your terminal
A naming note: Claude Code skills change what Claude does. MOLTamp skins change what your terminal looks like. They are unrelated, and they work fine together. MOLTamp is a skinnable terminal shell for Claude Code with one-click skins, widgets and a tab system that flags sessions needing attention, which helps when a forked skill or long workflow finishes in another tab. For how it compares to iTerm2, Ghostty and Warp for this work, see the best terminal for Claude Code.
Verdict
Start with one skill for the task you explain to Claude most often. Write a description that names the trigger, keep the body short, push reference material into side files, and mark anything with side effects as manual-only. Most teams find two or three good project skills do more than a long CLAUDE.md.
FAQ
What is a SKILL.md file?
It is the required file in a Claude Code skill folder. It holds YAML frontmatter, such as name and description, followed by markdown instructions that Claude follows when the skill is used.
Where do I put Claude Code skills?
Use .claude/skills/<name>/SKILL.md for a skill shared with a repository, or ~/.claude/skills/<name>/SKILL.md for a personal skill available in every project.
How does Claude decide when to use a skill?
It reads each skill's description and loads the skill when your request matches. Put the main use case and trigger words first. Set disable-model-invocation: true to stop automatic loading.
Are skills the same as slash commands?
They now share one system. A skill creates a /name command, and older .claude/commands/ files keep working. Skills add supporting files, invocation control and automatic loading.
How long should a SKILL.md be? Keep it under 500 lines. Move detailed reference into separate files in the skill folder and tell Claude when to read them.
A quick honest note: MOLTamp is free to use with every feature working. A one-time $10 license removes a recurring popup and unlocks community skin uploads, with no subscription. If you want your Claude Code sessions in a terminal built for them, download MOLTamp.