Skills: Custom Slash Commands
Markdown files that become slash commands. Codify your team's best practices into reusable workflows anyone can invoke by typing /skill-name.
You type /deploy staging
Claude Code looks for a matching SKILL.md file
SKILL.md loaded into context
The markdown instructions are injected into Claude's conversation, with $ARGUMENTS replaced by "staging"
Claude follows the instructions
Step by step — running tests, building, deploying — exactly as the skill specifies
Result reported
If using context: fork, the result returns to your main conversation cleanly
Type /deploy staging and this entire workflow runs. $ARGUMENTS becomes "staging".
What Are Skills?
Skills extend Claude's capabilities with instructions, templates, and step-by-step workflows, all written in markdown. They come in two flavors:
Reference Skills
Guidelines and conventions that Claude applies contextually. Think coding standards, API patterns, or project-specific rules that Claude should always know.
Task Skills
Step-by-step workflows you invoke with /skill-name. Deploy scripts, review checklists, research workflows — type the command and it runs.
How Skills Actually Work (Under the Hood)
When you type /deploy staging, here's what actually happens inside Claude Code:
- File lookup: Claude Code searches for
SKILL.mdin.claude/skills/deploy/(project), then~/.claude/skills/deploy/(personal), then installed plugins. - Frontmatter parsed: YAML frontmatter is read for name, description, allowed-tools, and context settings.
- String substitution:
$ARGUMENTSis replaced with everything after the slash command.${CLAUDE_SKILL_DIR}becomes the absolute path to the skill's directory. - Context injection: The processed markdown is injected into Claude's conversation as instructions. If
context: forkis set, it runs in an isolated subagent. - Execution: Claude follows the instructions, restricted to the tools listed in
allowed-tools(if specified).
A skill is just markdown injected into the existing conversation. The "cost" is context window tokens, not additional API calls — unless you use context: fork, which spawns a subagent (consuming tokens for that separate conversation).
Anatomy of a SKILL.md
Full SKILL.md structure
---
name: my-skill # Slash command name (/my-skill)
description: What it does # Shown in skill list
disable-model-invocation: true # Only runs when YOU type /my-skill
context: fork # Run in isolated subagent (optional)
allowed-tools: Bash(*), Read # Restrict which tools the skill can use
---
# Instructions for Claude
Use $ARGUMENTS for user input.
Use ${CLAUDE_SESSION_ID} for the current session.
Use ${CLAUDE_SKILL_DIR} for the skill's directory path.
## Steps
1. Do this first
2. Then do this
3. Finally, report the result
Frontmatter Options
| Field | What It Does |
|---|---|
name | The slash command name (e.g., /deploy) |
description | Shown when listing available skills |
disable-model-invocation | If true, Claude won't auto-trigger this — only manual /skill |
context: fork | Runs in an isolated subagent, keeping your main conversation clean |
allowed-tools | Restrict which tools the skill can access (security + focus) |
Built-in Skills
Claude Code ships with several powerful skills out of the box:
/batch
Parallel changes across 5-30 git worktrees. Refactor 1,000 files with 20 agents working simultaneously.
Included/simplify
Code quality review with 3 parallel agents checking for reuse, quality, and efficiency.
Included/loop
Run a prompt on a recurring interval. /loop 5m check deploy status polls every 5 minutes. Underrated.
/debug
Enable debug logging and troubleshoot issues with Claude Code itself.
IncludedNotable Community Skills
The community has built some incredible skills. These are the standouts:
Core competencies covering the full SDLC — TDD, debugging, brainstorming, subagent-driven development with code review. Officially listed in the Anthropic marketplace. This is the most popular community skill set by a wide margin.
Professional-grade security skills: code auditing, vulnerability detection, CodeQL integration, Semgrep analysis, variant analysis, and fix verification. Built by one of the most respected security firms in the industry.
Comprehensive project management workflow with specialized agents and slash commands. Turns Claude Code into a project manager that can break down tasks, track progress, and coordinate work.
Advanced context engineering techniques with minimal token footprint. Helps you get more out of Claude's context window by structuring information efficiently.
Creating Your Own Skill
Step 1: Create the file
Step 2: Write the SKILL.md
Example: Code review skill
---
name: review
description: Run a thorough code review on staged changes
context: fork
---
# Code Review
Review the staged git changes (`git diff --cached`) for:
## Checklist
1. **Security** — SQL injection, XSS, command injection, secrets in code
2. **Performance** — N+1 queries, unnecessary loops, missing indexes
3. **Correctness** — Edge cases, null checks, off-by-one errors
4. **Style** — Consistent naming, no dead code, clear variable names
5. **Tests** — Are changes covered? Any missing edge case tests?
## Output Format
- List each issue with file, line number, and severity (critical/warning/info)
- End with a summary: "Ready to merge" or "Needs changes"
Example: Research skill
---
name: research
description: Deep research on a topic with web search
allowed-tools: WebSearch, WebFetch, Read, Write
---
# Research: $ARGUMENTS
1. Search the web for recent, authoritative sources on "$ARGUMENTS"
2. Find at least 5 distinct sources (prefer: official docs, peer-reviewed, reputable outlets)
3. For each source, extract:
- Key findings or claims
- Supporting data or statistics
- Source URL and publication date
4. Write a research summary to `research-$ARGUMENTS.md` with:
- Executive summary (3-5 sentences)
- Detailed findings organized by theme
- All source URLs as inline citations
- Gaps in current knowledge / areas needing more research
Step 3: Use it
Skill Scopes
| Scope | Location | Visibility |
|---|---|---|
| Personal | ~/.claude/skills/name/SKILL.md | All your projects |
| Project | .claude/skills/name/SKILL.md | Everyone on this repo |
| Plugin | plugin/skills/name/SKILL.md | Anyone with the plugin |
| Enterprise | Managed settings | Org-wide |
Put templates, example configs, or reference data alongside your SKILL.md. Use ${CLAUDE_SKILL_DIR} in your instructions to reference them. Claude will have access to everything in the skill directory.
Advanced Features
Forked Context
Adding context: fork runs the skill in an isolated subagent. This keeps heavy operations (like /batch) from cluttering your main conversation. The result is returned when done. Note: forked skills consume additional tokens for the subagent conversation.
Tool Restrictions
allowed-tools limits what the skill can do. Use glob patterns:
-
Bash(npm *)— only npm commands -
Read, Glob, Grep— read-only access -
Bash(git *), Edit, Write— full dev access
String Substitution
| Variable | Replaced With |
|---|---|
$ARGUMENTS | Everything typed after /skill-name |
${CLAUDE_SESSION_ID} | Current session identifier |
${CLAUDE_SKILL_DIR} | Absolute path to the skill's directory |
What Does It Cost?
| Usage | Cost | Details |
|---|---|---|
| Creating skills | Free | Markdown files. Nothing to install, nothing to pay for. |
| Using skills (inline) | Included | Injected into existing conversation. Uses context window space, not extra API calls. |
| Using skills (forked) | Tokens | context: fork spawns a subagent — a separate conversation that consumes tokens. |
| Community skills | Free | All community skills listed above are open source and free. |