Claude Code Skills
Independent educational resource, not an official Anthropic course. Facts about the API, prices and limits were checked against Anthropic's documentation on 15 November 2026 and the code was run against a local mock of the API, not the live service. Check the linked official pages before relying on a number, and test with your own key.
Some instructions are procedures: "when I ask for a new endpoint, do these seven steps in this order". Putting them in CLAUDE.md means paying for them in every session, even the ones that never touch an endpoint. A skill is the better home. It's a folder with a markdown file that Claude loads only when it's relevant, or when you call it by name.
What you'll learn
- What a skill is and how it differs from
CLAUDE.md and slash commands.
- The folder layout, locations and frontmatter fields.
- How skills load, and how to invoke them with arguments.
- How to write two useful skills and lint them.
Before you start
What a skill is
Anthropic's documentation puts it simply: a skill extends what Claude can do. You write a SKILL.md file with instructions, and Claude adds it to its toolkit. Claude uses a skill when it's relevant, or you invoke it directly with /skill-name. Create one when you keep pasting the same checklist or procedure into chat.
The key difference from CLAUDE.md is when the content loads. Skill descriptions sit in context so Claude knows what's available. The body loads only when the skill is used, so long reference material costs almost nothing until it's needed. Once loaded, the body stays in the conversation for later turns, so keep it concise.
| CLAUDE.md | Skill |
| Holds | Facts and standing guidance | Procedures and reference material |
| Loads | Every session | On use: invoked by you or chosen by Claude |
| Rule of thumb | "Money is cents." | "To add an endpoint, do these seven steps." |
Older custom commands in .claude/commands/ still work. Skills have absorbed them and also support supporting files, so use a skill for new work.
Layout and locations
Each skill is a folder with a required SKILL.md, and optional files next to it:
new-endpoint/
├── SKILL.md (required)
├── reference.md (loaded when needed)
├── examples.md (loaded when needed)
└── scripts/
└── helper.py (executed, not loaded)
Where you save it decides who gets it:
- Personal:
~/.claude/skills/<name>/SKILL.md, in all your projects.
- Project:
.claude/skills/<name>/SKILL.md, in this repository. Commit it to share it with your team.
- Plugin: inside a plugin, invoked as
/plugin-name:skill-name.
If a personal and a project skill share a name, the personal one runs, and enterprise skills take precedence over personal ones.
Frontmatter
SKILL.md starts with YAML between --- markers. All fields are optional but description is recommended, because it's how Claude decides when to use the skill. The main fields:
| Field | What it does |
name | The command name in the / menu. Defaults to the folder name. |
description | What it does and when to use it. Claude uses this to decide when to apply it. |
when_to_use | Extra trigger phrases. Appended to the description; the combined text is truncated at 1,536 characters. |
argument-hint | Autocomplete hint such as [issue-number]. |
disable-model-invocation | true stops Claude loading it automatically. Only you can run it. |
user-invocable | false hides it from the / menu so only Claude invokes it. |
allowed-tools | Tools Claude can use without asking during the turn that invokes the skill. |
context | fork runs the skill in a forked subagent context. |
paths | Glob patterns limiting when it activates automatically. |
Field names must match exactly. Claude Code ignores unrecognised fields without reporting an error. So disable-model-invokation: true is silently ignored and the skill remains auto-invocable. That's why the linter in lesson 5.11 flags unknown fields as something to check.
Invoking skills, with arguments
Type the name at the start of a message: /new-endpoint coupon. Claude can also load a skill automatically when your request matches its description. Arguments are passed through placeholders: $ARGUMENTS is the whole string, $0, $1 and so on are by position. So a skill containing "Migrate the $0 component from $1 to $2" and invoked as /migrate-component SearchBar JavaScript TypeScript becomes "Migrate the SearchBar component from JavaScript to TypeScript."
A skill can also run a shell command before Claude sees it. The syntax is an exclamation mark followed by a command in backticks, and the output replaces the placeholder. That gives you live data inside the instructions.
Two skills for the example project
The first summarises uncommitted work. It's designed to be picked up automatically (note the description names the situations):
---
description: Summarises uncommitted changes and flags anything risky. Use when the user asks what changed, wants a commit message, or asks for a quick review of their diff.
---
## Current changes
!`git diff HEAD`
## Instructions
Summarise the changes above in two or three bullets. Then list risks you can see: missing validation, money handled as floats, a controller doing business logic, or a new endpoint without a test for the unauthorised case. If the diff is empty, say there are no uncommitted changes.
Line three of the body is the dynamic part: the git diff HEAD command runs before Claude reads the skill, so the instructions arrive with the current diff already included.
The second is a procedure you only want when you ask for it, so it sets disable-model-invocation: true, takes an argument, and pre-approves the commands it needs:
---
name: new-endpoint
description: Adds a new JSON API endpoint to the Laravel app following the project's conventions.
argument-hint: "[resource name]"
disable-model-invocation: true
allowed-tools: Read, Grep, Glob, Edit, Write, Bash(vendor/bin/pest *), Bash(vendor/bin/pint *)
---
Add an API endpoint for the resource: $ARGUMENTS
Follow this order and do not skip steps:
1. Read one existing controller and its Pest test to copy the project's style.
2. Create a Form Request for validation.
3. Put the business rule in a single-purpose class under `app/Actions/`.
4. Keep the controller thin: validate, call the action, return a resource.
5. Write a Pest feature test with three cases: success, validation failure, unauthorised.
6. Run the new test file, then `vendor/bin/pint --dirty`.
7. Report the test output and the files you changed.
Notice what the body is: numbered steps in a fixed order, ending with evidence ("report the test output"). That matches Anthropic's advice to give Claude a check to run and to ask for evidence instead of a bare "done". Because it says disable-model-invocation: true, its description stays out of context until you need it. Anthropic notes that this is how to stop skills you invoke manually from costing context.
The linter in lesson 5.11 passes both skills. We also tested it against skills with typos in field names, a missing description and a folder without SKILL.md, and each was reported. (claude doctor printed nothing about these two skills, but we can't tell from its output whether it validates skill files at all, which is another reason to lint them yourself.)
Bundled skills
Claude Code ships some skills: /doctor, /code-review, /batch, /debug, /loop, /claude-api, /verify and /run. They're prompt-based: they give Claude detailed instructions and let it do the work with its normal tools. Turn them off with the disableBundledSkills setting. Type / in a session to see everything available to you.
Design advice
- Write the description for matching. Say what the skill does and name the situations: "Use when the user asks what changed, wants a commit message, or asks for a quick review of their diff."
- Put the important instructions first. After compaction, skill bodies are re-injected but capped at 5,000 tokens each and 25,000 in total, oldest dropped first, and truncation keeps the start of the file.
- Keep the body short and move reference material to supporting files that load only when needed.
- Procedures, not facts. If it's a fact needed every session, it belongs in
CLAUDE.md.
- Commit project skills so the whole team gets the same procedure.
Real-world use case (illustrative scenario)
This scenario is an invented example to show how the ideas fit together. It is not a case study and its details are not measured results.
A team notices that every new endpoint comes back slightly different: sometimes without a Form Request, sometimes with no test for the unauthorised case. They write the endpoint procedure once as a skill, commit it, and everyone runs /new-endpoint coupon. The skill costs nothing in sessions where nobody adds an endpoint. When the convention changes (say, all endpoints now need a rate limit), they edit one file and the next run picks it up.
Mistakes to avoid
- A vague description, so Claude never picks the skill up (or picks it up for everything).
- A typo in a frontmatter field that's silently ignored.
- Giant skill bodies that crowd the context once loaded.
- Putting a standing fact in a skill. It won't be loaded when it's needed.
- Granting broad
allowed-tools to a skill you haven't read.
Security notes
A skill is instructions that Claude follows with your permissions, and allowed-tools can let it run commands without asking. Treat a skill from a stranger or a third-party plugin like a script from a stranger: read it before you enable it. Shell commands in !`...` run on your machine. Keep skills in version control so changes get reviewed.
Cost and speed
Only descriptions cost context all the time, and disable-model-invocation: true removes even that for skills you call manually. A loaded body stays in the conversation, so finish the task and start fresh with /clear when you're done with a procedure.
Key takeaways
- A skill is a folder with a
SKILL.md that loads on use; CLAUDE.md loads every session.
- Save skills in
.claude/skills/ (shared) or ~/.claude/skills/ (personal).
- The description decides when Claude uses it;
disable-model-invocation makes it manual-only.
- Field typos are ignored without an error, so lint them, and put the most important instructions at the top.
Lesson recap: what a skill is, where it lives and which fields steer it.
Quick quiz
- What loads into context when a session starts: a skill's description or its whole body?
- Where do you save a skill so your teammates get it?
- What does
disable-model-invocation: true do?
- What happens if you misspell a frontmatter field?
- When should content go in a skill instead of
CLAUDE.md?
Answers and explanations
- Only the description. The body loads when the skill is used.
.claude/skills/<name>/SKILL.md in the repository, committed to version control.
- Claude won't load the skill automatically. Only you can run it, and its description stays out of context.
- It's ignored without any error, so the setting doesn't take effect.
- When it's a multi-step procedure or reference material that isn't needed in every session.
Official references and further reading
Related tutorials