Agents
Back

How skill files work, and why some never get used

Skills,

This site has a skill of mine in it called new-entry. It's one file that tells Claude how to write an entry here, start to finish. Writing the file is the easy part. Whether Claude ever reaches for it on its own comes down to one line, the description.

What is a SKILL.md file?

A skill is a folder with one required file in it, SKILL.md. The file starts with a short block of YAML frontmatter, which is just a few settings between two --- lines at the very top of the file. After that it's plain markdown instructions, written the way you'd explain a task to someone who has never done it.

The frontmatter needs two fields. name is lowercase letters, digits and hyphens, up to 64 characters, and it matches the folder name. description says what the skill does and when to use it, up to 1024 characters. The folder can also hold scripts, references and assets folders if the skill needs them.

Here's the frontmatter of the one I wrote for this site.

.claude/skills/new-entry/SKILL.md
---
name: new-entry
description: Write a new entry for agents.ryancuff.com, start to finish. Gathers Ryan's notes, then runs entry-researcher, entry-writer and voice-editor in order, checks the result, and shows it to him. Use when Ryan asks for a new entry, a new post, or to write something up for the Agents site.
---

Under that is the actual process. Get my notes, run a researcher, a writer and a voice editor one after another, run the checks, open the page, show me every TODO. The last line is "Do not commit. Ryan reads it first."

Where do skills live?

In Claude Code there are a few places. Personal skills go in ~/.claude/skills/<name>/SKILL.md and work in every project. Project skills go in .claude/skills/<name>/SKILL.md inside the repo, which is where mine is. Plugins can ship skills too, under <plugin>/skills/.

The name also becomes a slash command, so I can type /new-entry and run it by hand. Custom slash commands actually got merged into skills, so they're the same thing now.

How do Claude skills work?

The idea behind all of this is called progressive disclosure. That just means Claude loads a skill in layers, and only as much as it needs.

At startup Claude reads the name and description of every skill it has, about 100 tokens each. That's it. The body of SKILL.md only loads once Claude decides to use the skill, and the docs recommend keeping it under 5000 tokens. Any other files the skill points to load only when they're needed. Scripts get run instead of read, so only their output costs anything.

So when you ask for something, Claude hasn't read your instructions yet. All it has is a list of descriptions, and it picks from that. Anthropic's docs say Claude uses the description "to choose the right Skill from potentially 100+ available Skills." The description is the whole pitch.

Why isn't my skill being used?

Almost always it's the description. The Claude Code docs say that if descriptions are vague or overlap, Claude may load the wrong skill or miss one. If yours only says what the skill is and never says when to use it, nothing in your request matches it, and the body never loads.

The other one is broken YAML. A missing --- or a bad indent doesn't throw an error you'd notice. The body still loads with empty metadata, so typing the slash command works fine, but Claude has no description to match against and never picks it on its own. That one seems really easy to miss because the skill looks like it works.

One more thing that trips people up. SKILL.md isn't re-read every turn. It gets added to the conversation once. So the rules that matter most should be near the top, and anything that has to happen every single time belongs in a hook instead. A hook is a script Claude Code runs on its own at set points, so it doesn't depend on the model remembering anything.

How to write a skill description

Say what it does, then say when to use it, in the words people will actually type. Write it in third person, like "Processes Excel files" and not "I can help you," because it gets put into the system prompt. Here's the good and bad example from the docs.

good
description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
bad
description: Helps with documents.

The bad one isn't wrong, it just doesn't match anything. The good one names the file type, the actions and the words someone would say.

Mine follows the same shape. It opens with what the skill does, then ends with "Use when Ryan asks for a new entry, a new post, or to write something up for the Agents site." Those are plain phrases someone would really type. In Claude Code, put the main use first, because the listing cuts the description off at 1,536 characters.

For the body, keep it under 500 lines and move long reference material into separate files that SKILL.md links to. The docs also say to assume Claude is already smart, so you only write down what it wouldn't know about your project.

How are skills different from CLAUDE.md, subagents and MCP?

CLAUDE.md loads in full every session. A skill loads only when it's needed. The docs suggest keeping CLAUDE.md under 200 lines and moving reference material into skills.

A subagent runs in its own separate context and hands back a summary. A skill adds its instructions to the main conversation you're already in. My new-entry skill uses both. The skill is the plan, and it runs three subagents one at a time.

MCP, the Model Context Protocol, gives Claude tools and access to data. A skill teaches it how to use them. They fit together more than they compete.

If you want to see what Claude actually has loaded up front, ask it "What skills are available?" It lists each skill with its description, which is the only part it's read so far.