/meta:create-skillsfrom meta
Author and improve Claude Code skills and slash commands — structure, frontmatter, invocation, and best practices. Use when creating, editing, or auditing a SKILL.md or command file.
Ships in meta. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
First, call the Skill tool for "writing-for-agents". It governs how the skill body is written, including description wording and progressive disclosure; this skill covers the structure, frontmatter, and invocation mechanics around it.
Custom slash commands have been merged into skills. A file at .claude/commands/review.md and a skill at .claude/skills/review/SKILL.md both create /review and work the same way; if both exist, the skill takes precedence. A command file suits a single-file workflow; a skill directory adds supporting files (references, scripts, templates). Both use the same frontmatter and a markdown body with standard headings.
All fields are optional. Only description is recommended.
Frontmatter is read only when the opening --- is the file's first line; otherwise the whole file, markers included, is treated as content. Boolean fields accept yes/no/on/off/1/0 in any case as well as true/false (v2.1.218+).
| Field | Required | Description |
|---|---|---|
name | No | Display name. Lowercase letters, numbers, hyphens (max 64 chars). Defaults to directory name. |
description | Recommended | What it does AND when to use it. Claude uses this for auto-discovery. Front-load the key use case: combined description + when_to_use is truncated at 1,536 chars in the skill listing. |
when_to_use | No | Extra trigger context (phrases, example requests). Appended to description; counts toward the 1,536-char cap. |
argument-hint | No | Hint shown during autocomplete. Example: [issue-number] |
arguments | No | Named positional arguments for $name substitution. Names map to positions in order — arguments: [issue, branch] makes $issue the first arg and $branch the second. Space-separated string or YAML list. Only the first 64 names, each up to 64 chars, are used (v2.1.301+). |
disable-model-invocation | No | Set true to prevent Claude auto-loading. Use for manual workflows like /deploy, /commit. Also blocks preloading into subagents via their skills: field (a subagent preloads at most 32 skills, v2.1.295+), and (v2.1.196+) blocks a scheduled task from firing with the skill as its prompt. Default: false. |
user-invocable | No | Set false to hide from / menu; typing /name doesn't run it. Use for background knowledge. Default: true. |
allowed-tools | No | Tools Claude can use without per-use approval while the skill is active. Space/comma-separated string or YAML list. Does not restrict other tools — add deny rules in /permissions for that. Example: Read, Bash(git *). Ignored in project and personal skills when managed settings set allowManagedPermissionRulesOnly (v2.1.282+); /status lists the skills affected. |
disallowed-tools | No | Tools removed from Claude's available pool while the skill is active. Use for autonomous skills that should never call a tool (e.g. AskUserQuestion in a background loop). The restriction clears on your next message. Space/comma-separated string or YAML list. |
model | No | Model to use. Accepts an alias (haiku, sonnet, opus, fable), a full model ID (e.g. claude-opus-5), or inherit. Override applies only for the current turn — session model resumes on the next prompt. A value your org's availableModels allowlist excludes is ignored, as is a model auto mode doesn't support while in auto mode. With context: fork the value sets the forked subagent's model instead. Without context: fork the switch drops the session's prompt cache, so prefer a fork when a skill needs a different model. Pick per role from ~/.claude/skills/tune-harness/references/model-routing.md. |
effort | No | Effort level while the skill is active. Options: low, medium, high, xhigh, max; available levels depend on the model. Overrides session effort. Pick per model-routing.md. |
context | No | Set fork to run in isolated subagent context. |
agent | No | Subagent type when context: fork. Options: Explore, Plan, general-purpose, or custom agent name. Defaults to general-purpose. |
background | No | Only with context: fork. Default true — the fork runs in the background and its result arrives later. Set false to block the invoking turn (and keep the full tool set). Requires v2.1.218+. |
hooks | No | Hooks registered when the skill is invoked; they keep running for the rest of the session (see the once option in the hooks docs). |
paths | No | Glob patterns scoping auto-activation. When set, Claude loads the skill automatically only when working with matching files. Comma-separated string or YAML list. Patterns are relative to Claude's current working directory; files outside it don't match. |
shell | No | bash (default) or powershell for shell-injection blocks. powershell needs the PowerShell tool enabled — on by default on Windows without Git Bash; elsewhere set CLAUDE_CODE_USE_POWERSHELL_TOOL=1. |
metadata | No | Free-form YAML map for your own tooling (e.g. last_reviewed). Claude Code never acts on it; a non-map value is dropped. Don't reuse frontmatter field names as keys. |
license | No | Agent Skills spec field. Accepted but not acted on. |
compatibility | No | Agent Skills spec field for environment requirements (string, max 500 chars). Accepted but not acted on. |
Files in .claude/commands/ accept the same frontmatter except name and paths, which are ignored there.
Claude Code skills at any level, plugins included, may use every field above. claude.ai uploads, the Skills API, and package_skill.py accept only the six Agent Skills spec fields — name, description, license, compatibility, metadata, allowed-tools — and reject anything else with a hard error rather than ignoring it. Body features like dynamic context injection are Claude Code-only. Enabling a personal skill for Cowork or cloud sessions uploads it to claude.ai, so the same restriction applies.
| Frontmatter | User can invoke | Claude can invoke | When loaded |
|---|---|---|---|
| (default) | Yes | Yes | Description always in context, full content loads when invoked |
disable-model-invocation: true | Yes | No | Description not in context, loads only when user invokes |
user-invocable: false | No | Yes | Description always in context, loads when relevant |
Use disable-model-invocation: true for workflows with side effects: /deploy, /commit, /triage-prs, /send-slack-message. You don't want Claude deciding to deploy because your code looks ready.
Use user-invocable: false for background knowledge that isn't a meaningful user action: coding conventions, domain context, legacy system docs.
Use $ARGUMENTS placeholder for user input. If not present in content, arguments are appended automatically.
---
name: fix-issue
description: Fix a GitHub issue
disable-model-invocation: true
---
Fix GitHub issue $ARGUMENTS following our coding standards.
Skills stack at the start of a message: /write-tests /fix-issue 123 loads both and passes 123 to each (v2.1.199+). Expansion covers the first skill plus five more and stops at the first token that isn't an inline user-invocable skill — a forked skill such as /code-review, or one whose args may start with a slash such as /loop, ends the run and becomes argument text.
Access individual args: $ARGUMENTS[N] or the shorthand $ followed by the index, counting from zero. The shorthand is replaced anywhere in the body, including code blocks and ! blocks, whenever that argument exists: awk's record and field variables, or a shell function's positional parameters, silently become argument text. In body scripts, match lines with a bare regex (p=/^### X$/) instead of comparing the record, brace positional parameters (${1}), or move the script into scripts/. Indexed args use shell-style quoting — wrap multi-word values in quotes. With the arguments frontmatter set, use named placeholders ($issue, $branch) instead of indexes.
Other substitutions:
| Variable | Description |
|---|---|
${CLAUDE_SESSION_ID} | Current session ID. Useful for logging or session-specific files. |
${CLAUDE_EFFORT} | Current effort level: low, medium, high, xhigh, or max. Adapt instructions to the active effort setting. |
${CLAUDE_SKILL_DIR} | Absolute path to the skill's directory. Use inside shell-injection blocks to reference bundled scripts regardless of cwd. For plugin skills, this is the skill's subdirectory inside the plugin. Also substituted inside allowed-tools Bash rules, so allowed-tools: Bash(${CLAUDE_SKILL_DIR}/scripts/run.sh *) matches the command the body tells Claude to run and skips the prompt. |
${CLAUDE_PROJECT_DIR} | Project root, the same path hooks and MCP servers receive. Substituted in both the body and allowed-tools. Requires v2.1.196+. |
${CLAUDE_PLUGIN_ROOT} | Plugin install directory. Plugin skills only. Use for resources shared between a plugin's skills. |
${CLAUDE_PLUGIN_DATA} | Plugin's persistent data directory, which survives updates. Plugin skills only. |
Skill files can run shell commands at load time by prefixing a backtick-wrapped command with an exclamation mark (no space between them). The command output replaces the directive in the content sent to Claude.
Syntax: exclamation mark + backtick + shell command + backtick
Example usage in a skill file:
gh pr diffgh pr diff --name-onlygit log --oneline -10NOTE: Cannot show literal examples here -- the skill parser executes the syntax even inside code blocks. See the official docs for copy-pasteable examples.
Multi-line injection and the extended-thinking activation keyword are covered in official-spec.md — the literal syntax can't appear here without the parser executing it.
Add context: fork to run in isolation. The skill content becomes the subagent's prompt. It won't have conversation history.
Since v2.1.218 a forked skill runs in the BACKGROUND by default: you keep working and its result arrives when it finishes. Set background: false to block the invoking turn instead. Claude Code also waits regardless in -p/SDK mode, with CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1, when the same forked skill is already running, and when a scheduled task fires it. An agent in a dynamic workflow that invokes a forked skill always waits for the result (v2.1.295+). A backgrounded fork runs with the narrower background-subagent tool set, and its edits fall outside /rewind checkpoints — use git to revert them.
Warning: context: fork only makes sense for skills with explicit task instructions. A skill that just lists conventions ("use these API patterns") will hand the subagent guidelines but no task, and return without output.
Don't echo the description's trigger phrases in the body. The forked subagent inherits the same skill registry; if the body restates the trigger phrases verbatim, the subagent can re-match its own skill and recurse. Address the task directly ("Research $ARGUMENTS thoroughly...") rather than "when the user asks for X, do Y". The runtime now guards against tight loops, but a self-triggering body still wastes turns.
---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
---
Research $ARGUMENTS thoroughly:
1. Find relevant files
2. Analyze the code
3. Summarize findings
Priority order (higher wins on name conflicts): enterprise > personal > project. Plugin skills are namespaced plugin-name:skill-name and cannot conflict.
| Location | Path | Applies to |
|---|---|---|
| Enterprise | Managed settings | Everyone in the org |
| Personal | ~/.claude/skills/<name>/SKILL.md | All your projects |
| Project | .claude/skills/<name>/SKILL.md | This repo only |
| Plugin | <plugin>/skills/<name>/SKILL.md | Where plugin is enabled |
Live change detection: edits under ~/.claude/skills/, .claude/skills/, or .claude/skills/ inside an --add-dir directory take effect mid-session. Creating a top-level skills directory that didn't exist at startup requires /reload-skills (rerun after each later change there). Detection covers SKILL.md text only — for a skill folder that is also a plugin, changes to hooks/, .mcp.json, agents/, or output-styles/ need /reload-plugins.
Nested discovery: skills in a .claude/skills/ below where the session started don't load at startup — they load the first time Claude reads or edits a file there, and until then can't be invoked by name. /add-dir <subdirectory> loads them immediately (v2.1.257+). On a name clash both stay available: the nested one gets a directory-qualified name (/apps/web:deploy), and invoking the unqualified name loads the root skill with a note listing the variants so Claude also invokes the one matching the files it's touching (v2.1.203+).
Added directories: an --add-dir skill whose directory name clashes with an enterprise, personal, or project skill (or one in an earlier-added directory) is prefixed with the added directory's folder name: /cli:verify for --add-dir ../cli. Two added directories sharing a folder name start the prefix from the parent folder (/b/cli:verify). Requires v2.1.309+.
Skills synced from claude.ai: these are named /anthropic-skills:<name> (v2.1.269+); the bare /<name> works only while no other command uses it. Name comparison ignores case, spacing, and invisible characters. In local sessions their ! commands, @ references, and ${CLAUDE_PROJECT_DIR}/${CLAUDE_SESSION_ID} reach Claude as literal text. The name anthropic-skills (and anthropic-skills:*) is reserved: outside a plugin, a skill folder, frontmatter name, or command file so named doesn't load. Opt out per machine with syncClaudeAiSkills: false in user settings (v2.1.275+); already-synced skills move to ~/.claude/skills/.trash/.
When invoked, rendered SKILL.md content enters the conversation as a single message and stays there for the rest of the session. Claude Code does not re-read the file on later turns — write guidance as standing instructions, not one-time steps.
Re-invoking a skill whose rendered content is identical adds only a short "already loaded" note (v2.1.202+); content that differs, because arguments or injected command output changed, is appended in full. An allowed-tools grant does not persist with the content — it clears on your next message and re-applies when you invoke the skill again.
Auto-compaction: on summarization, Claude Code re-attaches the most recent invocation of each skill after the summary, keeping the first 5,000 tokens of each, with a combined 25,000-token budget. Older skills can be dropped. If a skill stops influencing behavior after compaction, re-invoke it to restore the full content.
Control which skills Claude can invoke without editing each SKILL.md.
Permission rules (/permissions or settings.json) — Skill(name) exact match, Skill(name *) prefix match. Use in allow/deny to grant or block specific skills. Deny the bare Skill tool to disable all skills at once. A deny rule also matches an alias or an unqualified name — Skill(review) blocks the bundled /code-review, and Skill(deploy) blocks a nested apps/web:deploy (v2.1.260+). Skill(skill:deploy) (parameter form) blocks the skill under any of its names, alias and display name included. An allow rule matches only the skill's own name; approve synced skills as Skill(anthropic-skills:pdf) or Skill(anthropic-skills *).
skillOverrides setting — per-skill visibility states without touching the skill file (useful for shared/MCP-provided skills). The /skills menu writes this to .claude/settings.local.json; cycle with Space, save with Esc:
| Value | Listed to Claude | In / menu |
|---|---|---|
"on" (default) | Name + description | Yes |
"name-only" | Name only (frees description budget) | Yes |
"user-invocable-only" | Hidden | Yes |
"off" | Hidden | Hidden |
As of v2.1.199, "off" also hides the skill from the command lists advertised to Remote Control clients and Agent SDK callers, not just the terminal / menu.
In managed settings or a --settings file, an entry written under a bundled skill's alias applies to the skill behind it, but can only restrict it further; an entry under the skill's own name wins (v2.1.260+). In user, project, and local settings, entries match skill names only.
Plugin skills are not affected by skillOverrides — manage those through /plugin.
Find unused skills: /skill-doctor (v2.1.252+) reports each skill's context cost and how often it's been invoked, and flags never-invoked skills with where to turn them off. Terminal-only — it isn't available over Remote Control.
Keep SKILL.md under 500 lines. Link each supporting file from SKILL.md (For API details, see [reference.md](reference.md).) and keep links one level deep: a file reached only through another supporting file, or not linked at all, is effectively invisible. Scripts in scripts/ are executed, not loaded.
Before writing any supporting script, call the Skill tool for "uv". It governs how the script declares its dependencies and how the skill body tells Claude to run it.
Pick model- or user-invocation per writing-for-agents' SKILL-MECHANICS.md. A workflow with side effects is user-invoked (disable-model-invocation: true) regardless.
Command:
---
name: my-command
description: What this command does
argument-hint: [expected arguments]
disable-model-invocation: true
allowed-tools: Bash(gh *), Read
metadata:
author: <github-login>
---
# Command Title
## Workflow
### Step 1: Gather Context
...
### Step 2: Execute
...
## Success Criteria
- [ ] Expected outcome 1
- [ ] Expected outcome 2
Skill:
---
name: my-skill
description: What it does. Use when [trigger conditions].
metadata:
author: <github-login>
---
# Skill Title
## Quick Start
[Immediate actionable example]
## Instructions
[Core guidance]
## Examples
[Concrete input/output pairs]
Author: metadata.author is the GitHub login of whoever creates the skill, resolved at creation time with gh api user --jq .login. If that fails, ask the user. Never hardcode a login or use git user.name: these files are shared, and whoever clones them gets their own login. A third-party skill gets its repo owner instead; /vendor-skills sets that.
Invoke it directly with /skill-name, then check auto-triggering with a request phrased the way the user would phrase it. Measure invocation and output quality separately: run realistic prompts in a fresh session with the skill available and again with it disabled via skillOverrides, and compare. For a skill shipped in a plugin, claude plugin eval (v2.1.269+) runs each prompt with and without the plugin, grades it, and exits non-zero below a threshold so CI can gate on it. For iterating on a single skill in-conversation, install the skill-creator plugin (/plugin install skill-creator@claude-plugins-official), which stores test cases in evals/evals.json, runs each in an isolated subagent, and reports pass rate against token and time overhead.
name matches the directorymetadata.author set to a GitHub logindisable-model-invocation: true if it has side effectsallowed-tools set for the tools it runs without promptinguv skill, handle their own errors, and say how to recovercontext: fork on a reference-only skill (the fork gets no task and returns nothing)Skill not triggering:
description / when_to_useWhat skills are available?/skill-name if user-invocableMalformed frontmatter YAML loads the body with empty metadata, so /skill-name still works but there's no description to match on. Run claude plugin validate .claude/skills (or ~/.claude/skills) to find files whose frontmatter doesn't parse (v2.1.233+), or --debug to see the parse error.
Skill triggers too often: Make description more specific, or set disable-model-invocation: true.
Descriptions cut short: With many skills, descriptions are trimmed to fit a budget (1% of the model's context window), dropping the least-invoked skills' descriptions first. Run /doctor for an estimate of the listing's cost and its biggest contributors. Front-load key use cases, set low-priority skills to "name-only" in skillOverrides, or raise the budget with the skillListingBudgetFraction setting (e.g. 0.02) or a fixed SLASH_COMMAND_TOOL_CHAR_BUDGET. Each entry's combined text is capped at 1,536 chars regardless (skillListingMaxDescChars).
Skill stops influencing behavior mid-session: Content is usually still in context — the model is picking other tools. Strengthen the description/instructions, or use hooks to enforce behavior deterministically. After compaction, re-invoke to restore.
For detailed guidance, see:
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub sustinbebustin/.dotfiles --plugin meta9 skills in this plugin
/brainstorm-modsBrainstorm mods and plugins worth building, for one project or globally, then design and build the one you pick./claude-docsAnswer Claude Code questions (CLI, Agent SDK, plugins, hooks, skills, slash commands, MCP, settings) from a locally cached copy of the official docs./create-agentsDesigning, authoring, and auditing Claude Code subagents — frontmatter, tool scoping, model choice, and memory. Use when creating, editing, or auditing an agent file in `.claude/agents/`.