SKILL.md Format Explained: Every Frontmatter Field With Examples

SKILL.md Format Explained: Every Frontmatter Field With Examples

If you have ever opened a skill and wondered what each line at the top does, this guide to the SKILL.md format is for you. A skill is just a folder with one text file, but the few lines of settings at the top decide how the skill appears, who can start it and what it is allowed to do. We built three small skills, ran them in real Claude Code sessions and checked every field against the official documentation.

This is Part 1 of 45 in our Claude Code Deep Dives, part of our Claude Code tutorials.

Tested with Claude Code v2.1.316 on November 3, 2026. We tested on macOS; all demo skills were project skills in a throwaway folder, so nothing in our personal setup changed.

Quick Summary: The SKILL.md Format in One Table

PartWhat it isRequired?
Skill folderA directory such as .claude/skills/deploy/ that holds the skillYes
SKILL.mdThe one file every skill needsYes
FrontmatterYAML settings between two --- lines at the very topNo, but description is recommended
BodyMarkdown instructions Claude follows when the skill runsYes, it is the point of the skill
Supporting filesExtra reference files or scripts next to SKILL.mdNo

What Is a SKILL.md File and Why Does It Exist?

A skill teaches Claude Code a repeatable job, such as writing a release note or running a deploy checklist. Instead of pasting the same long prompt every day, you save it once and call it by name. If you are new to the tool, start with our guide to Claude Code.

The file has two parts. The frontmatter tells Claude Code about the skill, and the body holds the instructions.

Anthropic’s skills documentation describes this layout and is the source for every field in this guide.

Diagram showing a SKILL.md file split into frontmatter and body, with the fields that say when and who
A SKILL.md file has frontmatter on top and Markdown instructions below

Where to Put a Skill Folder

Skills load from a few places. A personal skill lives in ~/.claude/skills/<name>/SKILL.md and works in all your projects. A project skill lives in .claude/skills/<name>/SKILL.md inside a repository and travels with the code.

For this guide we used project skills only, in a demo folder with this layout:

skill-md-format/
├── CHANGES.md
└── .claude/skills/
    ├── release-note/SKILL.md
    ├── deploy/SKILL.md
    └── house-style/SKILL.md

The folder name becomes the command you type. You can change it with the name field, which we cover below.

The Basic Rules of Frontmatter

Frontmatter is a block of YAML wrapped in two lines of three dashes. Claude Code reads it only when the opening --- is the very first line of the file. If it is not, the whole file, dashes included, is treated as the skill body.

All fields are optional, and field names use lowercase words joined by hyphens. The one exception is when_to_use, which uses underscores. A name that does not match exactly is ignored without any error, so a typo fails silently.

Boolean fields accept true and false, and also yes, no, on, off, 1 and 0. If the YAML cannot be parsed, the skill still loads with no fields set, which means /skill-name works but Claude cannot match your description.

Every Frontmatter Field Explained

Here is the full list from the official reference for the version we tested. We group them by the question each one answers.

Fields That Name and Describe the Skill

FieldWhat it does
nameThe command name shown in the / menu. Defaults to the folder name.
descriptionWhat the skill does and when to use it. Claude reads it to decide when to load the skill. If you leave it out, the first non-empty line of the body is used.
when_to_useExtra trigger phrases or example requests, added to the description in the skill listing.
argument-hintA hint shown while you type, such as [issue-number].
argumentsNamed positional arguments you can use as $name in the body.

Put the key use case first in description. The combined description and when_to_use text is cut at 1,536 characters in the skill listing, so long text at the end may never be seen.

Fields That Control Who Can Start the Skill

FieldWhat it does
disable-model-invocationSet to true so Claude cannot load the skill on its own. You start it by typing /name. Default is false.
user-invocableSet to false so only Claude can use it. It disappears from the / menu. Default is true.
pathsGlob patterns that limit automatic loading to work on matching files.

Fields That Control Tools, Model and Environment

FieldWhat it does
allowed-toolsTools Claude can use without asking during the turn that runs the skill. The grant clears on your next message.
disallowed-toolsTools removed from Claude’s pool while the skill is active.
modelModel for the rest of the current turn. It accepts the same values as /model, or inherit.
effortEffort level for the current turn: low, medium, high, xhigh or max, depending on the model.
contextSet to fork to run the skill in a forked subagent.
agentWhich subagent type to use when context: fork is set.
backgroundOnly with context: fork. Set to false to wait for the result instead of running in the background.
hooksHooks that start when the skill is invoked and keep running for the session.
shellShell for inline commands: bash (default) or powershell.

Fields From the Agent Skills Spec

FieldWhat it does
metadataA free-form key-value map for your own tools. Claude Code does not act on it.
licenseThe license that covers the skill. Accepted but not acted on.
compatibilityEnvironment notes, up to 500 characters. Accepted but not acted on.

This matters if you plan to share a skill beyond Claude Code. The docs say that claude.ai uploads and the Skills API accept only name, description, license, compatibility, metadata and allowed-tools. Any other field makes the upload fail with an error instead of being ignored.

Step 1: Write a Skill With Arguments

Keep the body short and the description clear: the description is how Claude finds the skill, and the body is a cost on every turn.

Our first skill writes a release note from a small CHANGES.md file. It uses seven fields, so it is a good tour of the format.

---
name: release-note
description: Writes a short release note for one version from CHANGES.md. Use when the user asks for a release note or changelog entry.
when_to_use: Trigger phrases include "write release notes", "changelog for 1.4", "announce the release".
argument-hint: [version] [audience]
arguments: [version, audience]
allowed-tools: Read
effort: low
---

Read CHANGES.md and write a release note for version $version, aimed at $audience.

Rules:
- Start with the heading "Release $version"
- Use at most three bullet points
- Keep each bullet under 12 words

The arguments list gives each position a name. The first value you type becomes $version and the second becomes $audience. The docs also describe $ARGUMENTS for the full text and $0 and $1 for positions.

Because allowed-tools lists Read, Claude can read CHANGES.md for this turn without a permission prompt. We ran it with two arguments and the real session produced a three-line note.

Claude Code terminal showing the release-note skill run with 1.4.0 and customers and a three-bullet result
The release-note skill ran with two typed arguments and wrote three short bullets

Step 2: See the Argument Hint and Menu Description

Two fields shape what you see before the skill even runs. When we typed /release-note followed by a space, Claude Code showed the argument-hint as a faded hint after the command name.

Claude Code prompt showing the slash command release-note followed by the hint version and audience
The argument-hint text appears right after the command name as you type

The / menu also shows each skill’s description. Typing /dep listed our deploy skill with the description we wrote, tagged as a project skill.

Claude Code slash menu filtered to dep, showing the deploy skill and its description marked project
The menu shows the description from the frontmatter and marks it as a project skill

This is why a clear description matters. It is the label people see and the text Claude reads. Our guide to slash commands covers the built-in commands that share this menu.

Step 3: Control Who Can Start a Skill

By default, you and Claude can both start any skill. Two fields change that. The next diagram shows the three possible setups.

Diagram of the three invocation setups: default, disable-model-invocation true and user-invocable false
The default allows both of you, and each switch removes one side

The table below is taken from the official docs and shows what each setting changes.

FrontmatterYou can invokeClaude can invokeWhen loaded
DefaultYesYesDescription always in context, full skill loads when invoked
disable-model-invocation: trueYesNot on its ownDescription not in context, full skill loads when invoked
user-invocable: falseNoYesDescription always in context, full skill loads when invoked

A Skill Only You Can Run

Our deploy skill sets disable-model-invocation: true. It is a pretend deploy that prints four steps and runs no real commands, which keeps the demo safe.

---
name: deploy
description: Deploy the demo site to a target environment
disable-model-invocation: true
argument-hint: [environment]
---

Pretend to deploy the demo site to $ARGUMENTS. Do not run any real command.
Print these four steps as done: tests passed, build finished, upload finished, site checked.

When we typed /deploy staging, it printed the four steps. Then we sent a plain request, “Please deploy to production now.” Claude did not run the skill. It replied that it had not deployed anything to production and offered two choices: run the pretend deploy or use a real deploy command that we would supply.

Claude Code terminal showing a pretend deploy to staging, then a plain request to deploy to production that Claude did not run
After a plain-language request, Claude did not run the skill and asked what to do

This is one run, so we do not claim it proves every case. The docs describe the rule behind it: Claude cannot start the skill on its own, so it points you to type the command yourself. That is the right setting for anything with side effects, such as deploys or sending messages.

A Skill Only Claude Can Use

The house-style skill holds background rules, not an action, so it sets user-invocable: false.

---
name: house-style
description: Writing rules for every note in this project. Background knowledge for Claude.
user-invocable: false
---

When you write any note in this project, never use exclamation marks and always end with the line "- The Demo Team".

Typing /house in the real session gave “No commands match”, which confirms the skill is hidden from the menu. We did not test whether Claude applies it in later replies, so we make no claim about that here.

Claude Code showing no commands match the text slash house after the skill was set to not user invocable
A skill with user-invocable set to false does not appear in the slash menu

Placeholders You Can Use in the Body

Claude Code replaces certain placeholders before Claude reads the skill. These are the ones listed in the docs.

PlaceholderMeaning
$ARGUMENTSEverything typed after the command. If the body has no placeholder, the text is appended as ARGUMENTS: value.
$ARGUMENTS[N] or $NOne argument by position, counting from 0.
$nameA named argument from the arguments field.
${CLAUDE_SESSION_ID}The current session ID.
${CLAUDE_EFFORT}The current effort level.
${CLAUDE_SKILL_DIR}The folder that holds the skill’s SKILL.md.
${CLAUDE_PROJECT_DIR}The project root folder.

Wrap a multi-word value in quotes to pass it as one argument. To print a literal dollar amount such as $1.00, write \$1.00.

You can also run a shell command and inject its output with a line like !`git diff HEAD`. Claude Code runs it first and puts the result into the skill, so Claude sees fresh data.

Add Supporting Files Without Bloating the Skill

Once a skill loads, its text stays in the conversation, so every line costs tokens on every turn. Keep SKILL.md short and move long reference material into separate files in the same folder.

my-skill/
├── SKILL.md
├── reference.md
├── examples.md
└── scripts/
    └── helper.py

Mention each file inside SKILL.md so Claude knows what it holds and when to open it. Use ${CLAUDE_SKILL_DIR} in commands so the path works from any folder. For more on how context fills up, see how it works.

Try It Yourself

Build the release-note skill in a throwaway folder, never in a real project. Create a folder, add a small CHANGES.md, make .claude/skills/release-note/SKILL.md and start claude inside it. You can ask Claude Code to write the skill file for you with this prompt:

Create .claude/skills/release-note/SKILL.md. It should write a release note from CHANGES.md for a version and an audience that I pass as two arguments. Use the name, description, argument-hint, arguments and allowed-tools fields, and keep the body under ten lines.

Then run /release-note 1.0.0 customers and check that the note matches your rules.

Next, add disable-model-invocation: true and see how the behavior changes. New to the tool? Our first session guide shows how to start safely.

Common Mistakes

  • Putting a blank line or comment before the first ---, which turns the frontmatter into plain skill text.
  • Writing allowed_tools or disable_model_invocation with underscores. Only when_to_use uses them, and a wrong name is ignored silently.
  • Using angle brackets in the description. Claude Code shows them as &lt; and &gt;, so use square brackets or argument-hint instead.
  • Adding Claude Code only fields such as argument-hint to a skill you plan to upload to claude.ai, which fails the upload.
  • Writing a vague description such as “helps with files”. Claude cannot tell when to use it.
  • Expecting a rule to hold every time. The docs say to move must-follow rules into a hook, since Claude may skip skill guidance.

Pro Tips

  • Start the description with the main use case, then add trigger phrases in when_to_use.
  • Use disable-model-invocation: true for anything with side effects.
  • Put the most important instructions at the top. After compaction, Claude Code keeps only the first 5,000 tokens of each invoked skill.
  • Run claude plugin validate .claude/skills to find files whose frontmatter does not parse (needs v2.1.233 or later).
  • Use --debug to see a YAML parse error.
  • Run /doctor to see how much context your skill listing uses.

Cheat Sheet

Save this card for the next time you write a skill. Our Claude Code shortcuts guide has more quick references.

Cheat sheet card listing the main SKILL.md frontmatter fields and body placeholders
SKILL.md cheat sheet: the main frontmatter fields and placeholders

Frequently Asked Questions

Is any field in SKILL.md required?

No. All fields are optional, but the docs recommend description so Claude knows when to use the skill. Without it, the first non-empty line of the body is used.

What happens if I misspell a frontmatter field?

Claude Code ignores a field it does not recognize and reports no error. Check names against the official table, hyphens included.

What is the difference between name and the folder name?

In a personal or project skill, name sets the command shown in the menu, and the folder name also invokes the skill. Without name, the folder name is the command.

Can I use my skill in claude.ai?

Yes, with limits. Uploads accept only six fields, so remove any Claude Code only fields first.

Body features such as ! command injection do not work in claude.ai chat or the API. Learn more on our Claude AI page.

Why did Claude stop following my skill?

The skill text is added when it is invoked and is not re-read on later turns. Word guidance as standing rules, and invoke the skill again after a compaction.

Conclusion

The SKILL.md format is simple once you see its two parts: frontmatter that says when, who and how, and a body that says what to do. In our real sessions, the arguments, the argument hint, the menu description, the manual-only deploy and the hidden background skill all behaved as the docs describe. Keep your descriptions clear, your bodies short and your risky skills manual-only, and your skills will be easy to trust. Browse all our Claude Code tutorials for the next part.

Next in the series: Part 2: Claude Code Skills Best Practices: Write Skills That Trigger Reliably.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top