Claude Code skills: SKILL.md format, where they load, your first skill

Claude Code skills: SKILL.md format, where they load, your first skill

Claude Code skills are folders with a SKILL.md file of instructions that Claude loads only when a task needs them, or when you type /skill-name. This guide covers the SKILL.md format, where skills live, how Claude decides to load one, how skills differ from CLAUDE.md, subagents and hooks, and how to write and test your first skill.

In shortTL;DR
  • A skill is a directory with a SKILL.md file: YAML frontmatter that says when to use it, then Markdown instructions. Scripts and reference files can sit next to it.
  • Only the skill's name and description sit in context all the time; the body loads when you or Claude invoke the skill, so long procedures cost almost nothing until used.
  • Put personal skills in ~/.claude/skills/<name>/ and team skills in the repository's .claude/skills/<name>/; custom commands in .claude/commands/ still work and are now a kind of skill.
  • The description decides when Claude picks a skill: name the task and the words people use. Add disable-model-invocation: true to anything with side effects, such as deploys.
  • Skills follow the open Agent Skills standard, so a skill that sticks to the standard fields also works in Codex and other tools.

What are Claude Code skills?

Claude Code skills are reusable instruction packages: a folder containing a SKILL.md file, plus optional scripts, templates and reference docs. Claude reads a skill when your request matches its description, or when you type /skill-name. The official skills docs suggest creating one when you keep pasting the same checklist or procedure into chat, or when part of your CLAUDE.md has grown from a fact into a procedure.

The key property is progressive disclosure. Claude doesn't load every skill up front. Anthropic's Agent Skills overview describes three levels:

LevelWhat loadsWhenRough cost
1. Metadataname and descriptionEvery sessionAbout 100 tokens per skill
2. InstructionsThe body of SKILL.mdWhen the skill is invokedAim for under 5,000 tokens
3. ResourcesExtra files and script outputOnly when Claude reads or runs themNothing until accessed

So you can keep a 2,000-line API reference in a skill folder and pay for it only on the day Claude needs it.

Two more facts help you place skills in Claude Code:

  • Custom commands are now skills. .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy. Old command files keep working; new work should use the skill folder, which can hold supporting files.
  • Claude Code ships bundled skills. Commands such as /code-review, /debug, /batch, /loop and /claude-api are prompt-based skills that come with Claude Code. Our list of Claude Code commands shows which built-ins are skills.

What goes in a SKILL.md file?

A SKILL.md file has YAML frontmatter between --- lines that tells Claude when to use the skill, followed by Markdown instructions that Claude follows when it runs. In Claude Code every frontmatter field is optional, but you should always write a description, because that is what Claude matches your request against.

.claude/skills/release-notes/SKILL.md
---name: release-notesdescription: Drafts release notes from the commits since the last git tag. Use when the user asks for release notes, a changelog entry, or "what shipped".argument-hint: "[version]"allowed-tools: Bash(git log *)---## Recent commits (tags shown in parentheses)!`git log --oneline --decorate -50`## InstructionsWrite release notes for version $ARGUMENTS from the commits above thatare newer than the most recent tag.Group them under Added, Changed and Fixed. Skip merge commits anddependency bumps. Keep each line under 15 words and link the PR number.

The fields you will use most:

FieldWhat it does
nameThe command you type. Defaults to the folder name.
descriptionWhat the skill does and when to use it. Claude uses it to decide when to load the skill.
when_to_useExtra trigger phrases, appended to the description.
argument-hintShown in autocomplete, for example [issue-number].
disable-model-invocationtrue means only you can run it with /name.
user-invocablefalse hides it from the / menu; only Claude can load it.
allowed-toolsTools Claude may use without asking, during the turn that invokes the skill.
context and agentcontext: fork runs the skill in a subagent of the type named in agent.
pathsGlob patterns; Claude loads the skill automatically only for matching files.
model and effortOverride the model or effort level for that turn.

Inside the body you get a few substitutions. $ARGUMENTS is everything typed after the command, $0, $1 and so on are single arguments, and ${CLAUDE_SKILL_DIR} is the skill's own folder, which you use to call bundled scripts. A line starting with !`command` runs that shell command before Claude sees the skill and pastes in the output, which is how the example above hands Claude the real commit list instead of asking it to guess.

Tip

Keep SKILL.md under 500 lines, as the docs recommend, and move long reference material into separate files that the body links to. Once a skill loads it stays in the conversation, so every line is a recurring cost.

Where do Claude Code skills live?

Where you save a skill decides who gets it. Personal skills go in your home directory, project skills go in the repository so your team gets them through git.

LocationPathWho gets it
Personal~/.claude/skills/<name>/SKILL.mdYou, in every project on this machine
Project.claude/skills/<name>/SKILL.mdEveryone who works in the repository
Nested<subdir>/.claude/skills/<name>/SKILL.mdSessions working in that subdirectory, useful in monorepos
Plugin<plugin>/skills/<name>/SKILL.mdAnyone with the plugin enabled, as /plugin-name:skill-name
EnterpriseThe managed settings directoryEveryone on machines your organization manages
claude.ai accountSkills enabled on claude.aiTerminal sessions signed in with that account, plus cloud and Cowork sessions

When two skills share a name, enterprise beats personal and personal beats project. A skill also beats a .claude/commands/ file of the same name, and a project skill named like a bundled skill replaces it.

Claude Code loads project skills from the directory you start in and every parent up to the repository root, so starting in packages/web/ still picks up root skills. Skills in a nested .claude/skills/ below your starting point load the first time Claude touches a file in that folder. Edits to SKILL.md files are picked up during a running session; if you create a brand new top-level skills directory, run /reload-skills.

One gotcha for remote and scheduled work: cloud sessions don't read ~/.claude/skills/ on your laptop. If a skill must be available to a cloud session, commit it to the repository's .claude/skills/ or enable it on your claude.ai account.

When does Claude load a skill?

Claude sees a listing of every available skill's name and description on each turn, and loads the full body when your request matches a description or when you type the skill's name. The description is the trigger, so write it like a routing rule.

A hand ticking a checkbox on a handwritten checklist
A skill is a checklist Claude follows the same way every time.

Two frontmatter fields change who can start a skill:

SettingYou can run itClaude can run itDescription in context
DefaultYesYesYes
disable-model-invocation: trueYesNoNo
user-invocable: falseNoYesYes

Use disable-model-invocation: true for anything with side effects: deploys, commits, sending messages. In the docs' words, you don't want Claude deciding to deploy because your code looks ready. Use user-invocable: false for background knowledge, such as how a legacy billing system works, that isn't a sensible command.

A few limits from the docs explain most "Claude ignored my skill" reports:

~100tokens per skill for name and description in context
1,536characters max for description plus when_to_use in the listing
1%of the context window as the default budget for the whole skill listing
500lines as the recommended maximum for SKILL.md
Sources: Anthropic, Agent Skills overview and Claude Code skills docs (November 2026)

When the listing runs over budget, Claude Code drops descriptions of the skills you invoke least, which removes the words Claude matches against. Run /skill-doctor to see each skill's context cost and how often it is used, and /skills to browse and toggle them.

Write descriptions that trigger

Anthropic's authoring best practices ask for descriptions in the third person that state both what the skill does and when to use it. Put the main use case first, since long descriptions are cut from the end.

weak vs strong description
Weak:   Helps with releases.Strong: Drafts release notes from the commits since the last        git tag. Use when the user asks for release notes, a changelog        entry, or what shipped this week.

Skills vs CLAUDE.md vs subagents vs hooks: which should you use?

Use CLAUDE.md for short facts Claude needs in every session, skills for procedures and reference material needed only sometimes, subagents for work that should run in a separate context, and hooks for rules that must hold every time. The memory docs draw the same line: if a CLAUDE.md entry is a multi-step procedure or only matters for one part of the codebase, move it to a skill or a path-scoped rule.

FeatureLoadsRuns inReliabilityBest for
CLAUDE.mdEvery sessionMain conversationAdvisoryBuild commands, conventions, project layout
.claude/rules/Every session or for matching pathsMain conversationAdvisoryRules for one part of the codebase
SkillWhen invokedMain conversation, or a subagent with context: forkAdvisory, but focusedProcedures, checklists, reference docs, bundled scripts
SubagentWhen Claude delegatesIts own context windowAdvisoryNoisy research, reviews, parallel work
HookOn a lifecycle eventOutside the modelDeterministicFormatting, blocking files, tests-must-pass gates
Custom commandWhen you type itMain conversationAdvisoryOlder format of a user-invoked skill

Skills and subagents also combine. A skill with context: fork and agent: Explore hands its instructions to a read-only Explore subagent, which works in a clean context and returns a summary. In the other direction, a subagent's skills field preloads full skill content when that subagent starts. Our guide to Claude Code subagents covers that side, and CLAUDE.md best practices covers what to keep in the always-loaded file.

If Claude keeps skipping a step that must never be skipped, a skill is the wrong tool. Move the rule into a Claude Code hook, which runs whether or not Claude remembers it.

How do you write your first Claude Code skill?

Pick one procedure you have explained to Claude more than twice, write it as a skill in the project, and test it both ways: by asking naturally and by typing the command. This walkthrough builds a pre-commit review skill.

  1. Create the folder. In the repository root, run mkdir -p .claude/skills/pre-commit-review.
  2. Write the frontmatter. Give it a description that names the task and the phrases you use for it.
  3. Pull in live context. Use !`git diff --cached` so Claude reviews the real staged changes.
  4. Write the steps as standing instructions. Short, numbered, specific to your project.
  5. Test it twice. Start claude, stage a change, then ask "is this ready to commit?" and see whether Claude picks the skill. Then run /pre-commit-review directly.
  6. Check it loaded. Run /skills and look for it. If the frontmatter fails to parse, run claude --debug to see the error.
  7. Commit the folder so your team gets the same skill.
.claude/skills/pre-commit-review/SKILL.md
---description: Reviews staged changes before a commit and lists blocking problems. Use when the user asks if changes are ready to commit, wants a quick review, or says "check before I commit".allowed-tools: Bash(git diff *) Bash(npm run lint *) Bash(npm test *)---## Staged changes!`git diff --cached`## Review steps1. If the diff above is empty, say nothing is staged and stop.2. Run `npm run lint` and `npm test` and report failures first.3. Flag debug logging, commented-out code, hardcoded secrets or URLs,   and new functions without tests.4. Reply with "Blocking" and "Nice to have" lists, each item naming   the file and line. Do not edit files.

Once the skill works on a few realistic prompts, compare a fresh session with and without it. The docs recommend this baseline check, and Anthropic's skill-creator plugin automates it with test cases and a with/without benchmark (/plugin install skill-creator@claude-plugins-official).

Do Claude Code skills work in Codex and other tools?

Yes, within limits. Claude Code skills follow the open Agent Skills specification, and OpenAI's Codex skills docs say Codex builds on the same standard. A skill that sticks to the standard's fields moves between tools; Claude Code extensions do not.

Works across tools (spec fields)Claude Code only
name, descriptiondisable-model-invocation, user-invocable
license, compatibilitycontext, agent, paths, model, effort
metadata, allowed-tools (experimental)!`command` injection, $ARGUMENTS substitution

For portable skills, follow the spec's stricter rules: name and description are both required, the name uses lowercase letters, numbers and hyphens, is at most 64 characters, and must match the folder name; the description is at most 1,024 characters. Codex reads repository skills from .agents/skills folders and personal skills from ~/.agents/skills, and you invoke one there with $skill-name or /skills, so a shared skill needs to be copied or symlinked into both trees. Our Codex CLI guide covers the rest of that setup.

Uploading to claude.ai or the Skills API is stricter still: any frontmatter key outside the six spec fields fails with an "Unexpected key(s)" error, and ! command injection doesn't run there.

Are Claude Code skills safe?

A skill is code you run with your own permissions, so treat one from the internet like a package from an unknown author. Anthropic's overview warns that a malicious skill can direct Claude to call tools or run code in ways that don't match its stated purpose, including leaking data.

Three Claude Code behaviors make this concrete:

  • allowed-tools skips prompts. The docs note that a project skill's allowed-tools applies even in a claude -p run in a folder you never trusted. Review it in every cloned repository.
  • ! lines run before Claude reads anything. Set "disableSkillShellExecution": true in settings to turn them off for user, project and plugin skills.
  • You can switch skills off without editing them. skillOverrides in settings sets any skill to "on", "name-only", "user-invocable-only" or "off", and a Skill(deploy *) deny rule in permissions blocks Claude from invoking one.
Warning

Read every file in a third-party skill folder, including scripts, before you install it. A harmless-looking SKILL.md can call a script that does something else.

Skills pay off most when nobody is watching the session. If you run agents unattended on a server, the project's .claude/skills/ folder travels with the repository, so the same release, review and test procedures apply there as on your laptop. Orkio runs Claude Code on an always-on, isolated cloud box that clones your repositories, so committed skills come along; for scripted runs, see Claude Code headless mode.

Why isn't my Claude Code skill working?

Most skill problems come from the description, the frontmatter or context compaction. Work through these checks in order.

  • Claude never picks the skill. Ask "What skills are available?" to confirm it is listed, then add the words you actually type to the description. If you have many skills, its description may have been dropped from the listing; check /skill-doctor.
  • /name isn't recognized. The frontmatter must start on the first line of the file. Malformed YAML loads the body with no fields, so /name may work while automatic matching fails. Run claude --debug to see the parse error.
  • Claude uses it too often. Narrow the description, or add disable-model-invocation: true.
  • Claude follows it at first, then drifts. Claude Code adds the skill once and doesn't re-read the file. After compaction it keeps only the first 5,000 tokens of each recent skill, within a 25,000-token total, so put the important rules at the top and invoke the skill again after a long session.
  • A ! command breaks the skill. A failing command aborts the whole invocation. Append || true to commands that exit non-zero on purpose.
  • A context: fork skill returns nothing. Forked skills need an actual task. A skill that only lists conventions gives the subagent nothing to do.

How to start with skills today

Start small and let real repetition tell you what to write next:

  1. Run /skills to see what is already installed, including bundled skills.
  2. Find the longest procedure in your CLAUDE.md and move it into .claude/skills/<name>/SKILL.md with a clear description.
  3. Write one user-invoked skill with disable-model-invocation: true for a task with side effects, such as releases.
  4. Test each skill in a fresh session, by natural request and by /name.
  5. Commit .claude/skills/ and review it in pull requests like any other code.
  6. Once a month, run /skill-doctor and turn off what nobody uses.

Frequently asked questions

What is the difference between Claude Code skills and slash commands?

Custom slash commands have been merged into skills. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy. Skills add a folder for scripts and reference files, frontmatter that controls who can invoke them, and automatic loading when Claude sees a matching task.

Do Claude Code skills use tokens when they are not used?

A little. The name and description of every skill Claude can invoke are listed in context on each turn, roughly 100 tokens per skill according to Anthropic. The full SKILL.md body and any bundled files only enter context when the skill runs. Skills with disable-model-invocation set to true are not listed to Claude at all.

Can Claude Code use skills I created on claude.ai?

Yes, if you sign in to Claude Code with the same claude.ai account. Claude Code downloads the skills enabled on your account into ~/.claude/skills/synced/ and keeps them updated during the session. It does not upload local skills, so a skill you write in ~/.claude/skills/ stays on that machine until you add it to claude.ai yourself.

How many skills can I install in Claude Code?

There is no fixed limit, but the list of skill descriptions has a character budget of about 1% of the model's context window. When you have many skills, Claude Code drops descriptions of the least used ones first, which makes those skills harder for Claude to match. Run /skill-doctor to see which skills you never use and turn them off.

Are Claude Code skills safe to install from GitHub?

Treat a third-party skill like software you install. A skill can tell Claude to run commands, can pre-approve tools with allowed-tools, and can run shell commands while it loads. Read every file in the skill folder before you use it, and prefer skills you wrote or that come from Anthropic or your own organization.

SOURCES

  1. Claude Code docs: Extend Claude with skills
  2. Claude docs: Agent Skills overview
  3. Claude docs: Skill authoring best practices
  4. Agent Skills specification
  5. Claude Code docs: Subagents
  6. OpenAI developers: Build skills (Codex)
  • #claude code
  • #agent skills
  • #skill.md
  • #ai coding
Orkio team

The team building Orkio. We write about putting AI to work: coding agents that run overnight, always-on boxes and pull requests ready by morning.

Keep reading

All posts

07:06 · YOU MERGED #128

Go to sleep. Wake up to pull requests.

Start for $19 a month
© 2026 Orkio · Hosted in Europe TürkçeStatus