What Are Claude Code Skills? How to Install or Write One

A Claude Code skill is a folder containing a SKILL.md file: a short YAML header that says what the skill does and when to use it, followed by Markdown instructions. Claude Code keeps each skill’s name and description in context, but reads the instructions only when your request matches the description or when you type /skill-name. To install a skill, put its folder in ~/.claude/skills/ (all your projects) or in .claude/skills/ inside a repository (everyone who clones it), or install a plugin that bundles skills.

We checked this guide against Anthropic’s Claude Code skills documentation, the open Agent Skills specification and Anthropic’s platform documentation on November 17, 2026. The worked example was built and run in Claude Code 2.1.326. If you want ready-made skills rather than writing your own, browse the FindPicked skills directory.

The short version

  1. Create a folder named after the skill: ~/.claude/skills/csv-profile/ for personal use, or .claude/skills/csv-profile/ in a repository.

  2. Add a SKILL.md that starts with frontmatter on its very first line:

    ---
    name: csv-profile
    description: Profiles a CSV file without changing it. Use when the user asks to inspect or validate a CSV file.
    ---
    
    Instructions Claude should follow go here.
    
  3. Start claude, then ask for something that matches the description, or type /csv-profile.

  4. Run /skills to confirm the skill loaded.

The rest of this guide explains each step, a complete tested example, and the mistakes that stop a skill from loading or triggering.

What a skill is, and what it is not

Anthropic recommends a skill when you keep pasting the same instructions, checklist or multi-step procedure into chat, or when part of CLAUDE.md has grown into a procedure rather than a fact. The difference is when the text costs context. According to the memory documentation, CLAUDE.md is loaded into every session. A skill’s body loads only when it is used.

Mechanism What it is When Claude sees it Best for
CLAUDE.md Persistent project or user instructions Every session Facts and conventions that always apply
Skill A folder with SKILL.md and optional files Name and description always; body when invoked Repeatable procedures, checklists, bundled scripts
Custom command A single file in .claude/commands/ When invoked Existing commands; Anthropic now says commands have been merged into skills
Subagent A separate assistant with its own context window When work is delegated to it Side tasks that would flood the main conversation
Hook A handler Claude Code runs automatically on an event, such as before each file edit Every time the event fires Rules that must hold every time
MCP server A program that gives Claude Code new tools Whenever the server is connected Access to databases, APIs and other systems

The last row is the most common confusion. A skill does not add a new tool. It teaches Claude how to use the tools it already has, such as Bash, file editing or a connected MCP server. To add tools, see our guide to installing MCP servers in Claude Code.

Where skills live

Scope Path Who gets the skill
Personal ~/.claude/skills/<skill-name>/SKILL.md You, in every project on this machine
Project .claude/skills/<skill-name>/SKILL.md Anyone working in that repository, once it is committed
Plugin <plugin>/skills/<skill-name>/SKILL.md Wherever the plugin is enabled, invoked as /plugin-name:skill-name
Enterprise A .claude/skills/ folder in the managed settings directory Users on machines where an organization deploys it

When two skills share a name, the documentation gives this order: enterprise over personal, and personal over project. Plugin skills are namespaced, so they do not collide. Claude Code also picks up .claude/skills/ folders inside subdirectories when it starts working with files there, which suits monorepos.

The folder name matters. In Claude Code, the directory name becomes the command you type unless you set a different name. A skill is the whole folder, not only the Markdown file, so copy the scripts and reference files with it.

The SKILL.md format

The file has two parts: YAML frontmatter between --- lines, then Markdown instructions. The frontmatter must start on the first line of the file.

Claude Code and the open specification treat the two key fields differently:

Field Agent Skills specification Claude Code
name Required. 1 to 64 characters, lowercase letters, numbers and hyphens only, no leading, trailing or doubled hyphens, and it must match the folder name Optional. Defaults to the folder name and becomes the /command
description Required. 1 to 1,024 characters, saying what the skill does and when to use it Recommended. Without it, Claude Code uses the first non-empty line of the body

Anthropic’s Agent Skills overview adds that name cannot contain XML tags or the reserved words anthropic and claude. Our advice is simple: always include both fields and follow the stricter rules. Then the same folder works in Claude Code, in claude.ai uploads and through the Skills API.

The description does most of the work, because it is what Claude matches your request against. Anthropic’s authoring best practices recommend writing it in the third person, stating both what the skill does and when to use it, and including the words people will actually type. “Helps with data” will rarely trigger. “Profiles a CSV file… Use when the user asks to inspect or validate a CSV file” names the task and the trigger.

Claude Code also accepts extra fields that the specification does not define. The ones you are most likely to need:

  • disable-model-invocation: true stops Claude from loading the skill on its own. Use it for anything with side effects, such as a deploy procedure, so it runs only when you type the command.
  • user-invocable: false hides the skill from the / menu, for background knowledge only Claude should load.
  • allowed-tools pre-approves specific tools for the turn in which the skill is invoked. The grant ends when you send your next message.
  • context: fork runs the skill in a subagent that cannot see your conversation history.

These fields are fine in Claude Code. The documentation warns that claude.ai uploads and the Skills API accept only name, description, license, compatibility, metadata and allowed-tools, and reject anything else with an error.

How to install a skill

Copy a skill folder

Shared skills are often published as folders in a Git repository. Read the SKILL.md and every script before you copy anything (see the security section below). This example installs Anthropic’s skill-creator skill as a personal skill:

git clone --depth 1 https://github.com/anthropics/skills.git
mkdir -p ~/.claude/skills
cp -R skills/skills/skill-creator ~/.claude/skills/

We ran these commands on November 17, 2026 (repository commit e4bb5d9) with a throwaway home directory. The copied folder contained SKILL.md plus scripts/, references/, agents/ and other supporting directories, which is why copying the whole folder matters. To share a skill with your team instead, copy it into the repository’s .claude/skills/ folder and commit it.

Install a plugin that bundles skills

Anthropic’s skills repository doubles as a plugin marketplace. In a Claude Code session, run:

/plugin marketplace add anthropics/skills
/plugin install document-skills@anthropic-agent-skills

In a separate test configuration, the shell equivalents (claude plugin marketplace add anthropics/skills, then claude plugin install document-skills@anthropic-agent-skills) registered a marketplace named anthropic-agent-skills and installed the plugin. Its manifest bundles the xlsx, docx, pptx and pdf skills. The example-skills plugin bundles twelve more, including skill-creator, mcp-builder and webapp-testing. See Install and manage plugins for scopes and updates.

Confirm it loaded

Run /skills inside Claude Code, or ask “What skills are available?”. Claude Code picks up edits inside existing skill folders without a restart. If you created a new top-level skills directory during a session, run /reload-skills.

Write your own: a tested example

The example below is a small, useful pattern: a skill that runs a bundled script, so the numbers come from code rather than from the model. It profiles a CSV file before you convert, import or compare it.

.claude/skills/csv-profile/
├── SKILL.md
└── scripts/
    └── profile_csv.py

SKILL.md:

---
name: csv-profile
description: Profiles a CSV file without changing it. Reports columns, record count, blank cells and duplicate values in a key column. Use when the user asks to inspect, check or validate a CSV file, or before converting, importing or comparing one.
---

# CSV profile

1. Run the bundled script on the file the user names. Add `--key <column>`
   when the user names a column that should be unique:

   ```bash
   python3 ${CLAUDE_SKILL_DIR}/scripts/profile_csv.py <file> --key <column>
   ```

2. Report the numbers exactly as the script prints them. Do not count rows
   yourself: a quoted field can contain a line break, so lines are not records.
3. If the script reports duplicate keys or field-count problems, list them and
   ask before editing anything. Never overwrite the original file.

${CLAUDE_SKILL_DIR} is a Claude Code substitution for the folder that contains SKILL.md, so the path works whether the skill is personal, project or plugin. In our session it was replaced by the absolute path before Claude saw the text.

scripts/profile_csv.py uses only Python’s standard library:

#!/usr/bin/env python3
"""Print a read-only profile of a CSV file: records, columns, blanks, duplicate keys."""
import argparse
import csv
import sys
from collections import defaultdict

parser = argparse.ArgumentParser()
parser.add_argument("path")
parser.add_argument("--key", help="column that should be unique")
parser.add_argument("--delimiter", default=",")
args = parser.parse_args()

try:
    with open(args.path, newline="", encoding="utf-8-sig") as f:
        rows = list(csv.reader(f, delimiter=args.delimiter, strict=True))
except (OSError, UnicodeDecodeError, csv.Error) as exc:
    sys.exit(f"error: cannot read {args.path}: {exc}")

if not rows:
    sys.exit("error: the file is empty")

header, records = rows[0], rows[1:]
print(f"columns ({len(header)}): {', '.join(header)}")
print(f"records: {len(records)}")

bad = [n for n, r in enumerate(records, 1) if len(r) != len(header)]
print(f"records with a different field count: {bad or 'none'}")

blanks = {name: 0 for name in header}
for r in records:
    for name, value in zip(header, r):
        if not value.strip():
            blanks[name] += 1
print("blank cells: " + ", ".join(f"{k}={v}" for k, v in blanks.items()))

if args.key:
    if args.key not in header:
        sys.exit(f"error: no column named {args.key!r}")
    col = header.index(args.key)
    seen = defaultdict(list)
    for n, r in enumerate(records, 1):
        if col < len(r):
            seen[r[col]].append(n)
    dups = {k: v for k, v in seen.items() if len(v) > 1}
    if dups:
        for value, numbers in dups.items():
            print(f"duplicate {args.key} {value!r} in records {numbers}")
    else:
        print(f"duplicate {args.key} values: none")

The test file, orders.csv, has four records on five data lines because one quoted note contains a line break:

id,name,city,note
0012,"North, desk",Oslo,ok
0013,Lin,,missing city
0014,"Quote ""A""",Lima,"Line one
Line two"
0012,"North, desk",Oslo,repeated id

Running the script directly (Python 3.14) printed:

columns (4): id, name, city, note
records: 4
records with a different field count: none
blank cells: id=0, name=0, city=1, note=0
duplicate id '0012' in records [1, 4]

Then we asked Claude Code, with the Haiku model and only python3 commands pre-approved: “Check orders.csv before I import it. The id column should be unique.” Claude invoked csv-profile on its own, ran the script with --key id, reported the duplicate 0012 in records 1 and 4, and asked before changing anything. Typing /csv-profile orders.csv also worked; without a key column, Claude skipped the duplicate check and offered to rerun with --key id. In both runs the numbers came from the script rather than from the model, which is the point of bundling it.

Once a profile looks clean, you can continue in the browser with the CSV to JSON converter or review repeated keys with the CSV deduplicator.

Validate before you share

Claude Code has a built-in checker, claude plugin validate <dir>, which reads every skill in a folder without calling a model. The specification has a reference validator too: pip install skills-ref installs a command that version 0.1.1 names agentskills, used as agentskills validate <skill-folder>. We ran both against deliberately broken copies of the example:

Problem in SKILL.md claude plugin validate (Claude Code 2.1.326) agentskills validate (skills-ref 0.1.1)
No frontmatter at all Passes with a warning; fails with --strict Fails: must start with YAML frontmatter
name: CSV Profile Passes, even with --strict Fails: must be lowercase, invalid characters, must match folder
name differs from the folder Passes, even with --strict Fails: directory name must match
Unquoted : inside the description Passes, even with --strict Fails: invalid YAML
No description Passes with a warning; fails with --strict Fails: missing required field
argument-hint or disable-model-invocation Passes, even with --strict Fails: unexpected fields

Claude Code is far more lenient than the specification, so a skill can work on your machine and still be rejected elsewhere. If a description contains a colon followed by a space, wrap the whole description in quotes. Run both validators if you plan to publish a skill or upload it to claude.ai.

Troubleshooting

The skill never triggers. Put the words people actually use into the description, check that the skill appears in /skills, and try invoking it directly. The documentation notes that malformed YAML makes Claude Code load the body with empty metadata: /skill-name still works, but Claude cannot match your request against a description it never parsed. Start Claude Code with --debug to see the parse error.

It triggers when you do not want it. Make the description more specific, or add disable-model-invocation: true so the skill runs only on request.

Claude follows it at first, then drifts. Claude Code adds the skill’s content to the conversation once and does not reread the file. After the conversation is compacted, it re-attaches only the first 5,000 tokens of each invoked skill, within a combined budget of 25,000 tokens. Put the essential rules near the top, phrase them as standing instructions, and move rules that must never be skipped into a hook.

You have many skills. The skill listing has a character budget, which the documentation says scales at 1% of the model’s context window. When it overflows, the descriptions of your least-used skills are dropped first. Each description is also cut at 1,536 characters in the listing, so put the main use case first.

Security: treat skills like software

A skill can tell Claude to run commands, so installing one is closer to installing a program than to saving a prompt. Anthropic’s overview says to use skills only from trusted sources, such as ones you wrote or obtained from Anthropic, and to audit every bundled file for unexpected network calls or file access. Three details are worth knowing before you clone a repository:

  • A line such as !`git diff HEAD` in a SKILL.md runs a shell command before Claude sees the skill. The disableSkillShellExecution setting turns this off.
  • The documentation warns that a project skill’s allowed-tools applies even in a non-interactive claude -p run in a folder you have never trusted. Read .claude/skills/ in unfamiliar repositories first.
  • Skills that fetch content from external URLs can pull in instructions you did not write, even if the skill itself was trustworthy when you installed it.

The FindPicked skills directory lists repositories to investigate, not audited or tested skills. Read each source before installing.

How this guide was tested

On November 17, 2026, on macOS, we created the csv-profile skill as a project skill in an empty test folder. We ran its script directly, validated it with Claude Code 2.1.326 and skills-ref 0.1.1, and ran two one-shot Claude Code sessions (claude -p) with the Haiku model, one automatic and one with /csv-profile. We verified the plugin and copy commands in a separate configuration directory and a throwaway home folder. We did not test uploads to claude.ai or the Skills API, Windows paths or enterprise deployment.

Frequently Asked Questions

Does a Claude Code skill need a name field?

Not inside Claude Code, which falls back to the folder name. The open Agent Skills specification, claude.ai uploads and the Skills API require both name and description, so include both if the skill may be used outside Claude Code.

Where do I put a skill so every project can use it?

Put the skill folder in ~/.claude/skills/ on your machine. Use .claude/skills/ inside a repository instead when everyone who clones that repository should get the skill.

What is the difference between a skill and an MCP server?

A skill is a set of instructions, optionally with scripts, that Claude reads when it is relevant. An MCP server is a separate program that gives Claude Code new tools, such as access to a database or an API. A skill can explain how to use an MCP tool, but it is not a server.

Are skills from GitHub safe to install?

Treat them like any software you install. Anthropic advises using skills only from trusted sources and auditing every bundled file, including scripts, because a skill can direct Claude to run commands on your machine.