4.1 — Create a Claude Code skill: SKILL.md and slash command
You often retype the same instruction, for example "review my changes before I commit". A skill records it once and for all. It is a folder that contains a SKILL.md file, with instructions written in Markdown.
A skill triggers in two ways. You can run it yourself as a slash command, by typing /skill-name. Claude can also load it on its own, when your request matches its description.
Your first skill
Create this file in your project, at .claude/skills/quick-review/SKILL.md:
---
description: Reviews uncommitted changes and reports bugs, omissions and missing tests. Use when someone asks for a review before a commit.
---
Review the current changes before the commit.
1. Run `git diff HEAD` to see the changes.
2. Report likely bugs first, then forgotten edge cases.
3. List the missing tests.
4. End with a one-line verdict: ready to commit, or needs fixing.
Do not modify any file.
The folder name gives the command its name. Type /quick-review in Claude Code and Claude follows these four steps. You have nothing to restart, because Claude Code watches the .claude/skills/ folder. If the command does not appear, type /reload-skills.
The two parts of SKILL.md
The block between the two --- lines is called the frontmatter. It holds settings in YAML format. The only one that matters to get started is description. Claude reads this sentence to decide whether the skill answers your request.
The rest of the file is the prompt. Claude receives it only when the skill triggers. While the skill sleeps, only its description takes up space in your context window.
Supporting files in the folder
The skill folder can contain other files, such as a checklist or a script. Claude opens them only if SKILL.md mentions them and the task calls for it.
.claude/skills/quick-review/
├── SKILL.md
├── security-checklist.md
└── scripts/
└── count-todos.sh
For example, write "for a change to authentication, read security-checklist.md" in SKILL.md. To call a script, use the ${CLAUDE_SKILL_DIR} variable, which Claude Code replaces with the path of the skill folder. The line bash ${CLAUDE_SKILL_DIR}/scripts/count-todos.sh therefore works wherever the skill is installed. Keep SKILL.md under 500 lines and move the details into these supporting files.
What about slash commands in .claude/commands/?
Before skills, a custom slash command was a single file, for example .claude/commands/quick-review.md. This format still works and creates the same /quick-review command. The two formats have merged and accept the same frontmatter. For a new need, write a skill, which has the advantage of its own folder. Section 4.2 covers what you need to know about the older format.
Key takeaways
• A skill is a folder that contains a SKILL.md file. The file starts with a frontmatter, the header between two --- lines that holds the description, then gives the instructions.
• You run it with /name, and Claude can also load it on its own thanks to its description.
• The folder can contain supporting files and scripts, called with ${CLAUDE_SKILL_DIR}.
• Files in .claude/commands/ still work, but a new need is written as a skill.
