Official Docs Breakdown: Agent Skills
hippo: This post is part of the Claude Code Official Docs Breakdown series.
1. What Are Skills?
Skills are Claude Code’s modular mechanism for extending agent capabilities. The core idea is straightforward: you write a SKILL.md file that packages domain-specific knowledge or step-by-step procedures. Claude automatically reads and applies it when relevant, or you can trigger it manually via /skill-name.
Key characteristics:
- Driven by
SKILL.md: Each Skill centers on a Markdown file that Claude adds to its toolkit and loads on demand. - Custom commands merged in: Legacy custom commands (
.claude/commands/) have been merged into Skills. Existing files continue to work, while Skills add multi-file organization, invocation controls, and automatic discovery. - Open standard: Skills follow the Agent Skills open standard, so the same Skill files work across compatible AI tools, not just Claude Code.
2. Official Docs Deep Dive
2.1 Bundled Skills and Storage Locations
Claude Code ships with 5 bundled Skills available in every session. They are prompt-based playbooks that give Claude structured execution workflows:
| Skill | Purpose | Example |
|---|---|---|
/batch |
Orchestrates large-scale changes in parallel, splitting work into independent units and opening a PR for each | /batch migrate src/ from Solid to React |
/claude-api |
Loads Claude API reference documentation (Python, TS, Java, Go, etc.) | Auto-activates when importing the anthropic package |
/debug |
Enables debug logging and troubleshoots issues | /debug connection timeout |
/loop |
Runs a prompt repeatedly on a fixed interval | /loop 5m check if the deploy finished |
/simplify |
Reviews recently changed files for code quality issues | /simplify focus on memory efficiency |
Storage Locations and Precedence
Skills live at four scopes, with higher-priority scopes overriding lower ones:
| Scope | Path | Applies To |
|---|---|---|
| Enterprise | Managed settings configuration | All users in the organization |
| Personal | ~/.claude/skills/<skill-name>/SKILL.md |
All of your projects |
| Project | .claude/skills/<skill-name>/SKILL.md |
This project only |
| Plugin | <plugin>/skills/<skill-name>/SKILL.md |
Anywhere the plugin is enabled |
Plugin Skills use the plugin-name:skill-name namespace, so they never collide with same-named Skills at other scopes.
Monorepo Auto-Discovery
In a monorepo, Claude Code automatically discovers Skills from nested .claude/skills/ directories:
1 | my-monorepo/ |
When editing files under packages/frontend/, Claude loads Skills from both the repository root and the frontend directory. Skills in directories added via --add-dir are also loaded automatically, with live change detection—editing a Skill file takes effect without restarting Claude Code.
2.2 Creating a Skill and Configuring Frontmatter
Three steps to create a Skill:
1 | # Step 1: Create the Skill directory |
A complete Skill example for deploying to production:
1 | --- |
Here, disable-model-invocation: true prevents Claude from triggering a deployment on its own—it only runs when you explicitly enter /deploy, eliminating accidental releases.
Complete Frontmatter Reference:
| Field | Required | Description |
|---|---|---|
name |
No | Display name (lowercase letters, digits, and hyphens; max 64 chars). Defaults to the directory name if omitted |
description |
Recommended | Explains what the Skill does and when to use it. Claude uses this to decide when to auto-load it—always fill this in |
argument-hint |
No | Autocomplete hint, such as [issue-number] or [filename] [format] |
disable-model-invocation |
No | true prevents Claude from auto-invoking the Skill; manual /skill-name invocation only |
user-invocable |
No | false hides the Skill from the / menu; ideal for background-knowledge Skills |
allowed-tools |
No | Tools pre-approved without prompting while the Skill is active; supports wildcards like Bash(gh *) |
model |
No | Model to use while the Skill is active |
effort |
No | Effort level (low/medium/high/max), overriding the session default |
context |
No | Set to fork to run inside an isolated forked subagent context |
agent |
No | Subagent type when context: fork is set: Explore/Plan/general-purpose/custom |
hooks |
No | Hooks configuration scoped to this Skill’s lifecycle |
Invocation Control Matrix
Two frontmatter fields combine to produce three invocation modes:
| Configuration | User-Invocable | Claude-Invocable | Typical Use Case |
|---|---|---|---|
| (Default) | Yes | Yes | General-purpose tools usable both manually and automatically |
disable-model-invocation: true |
Yes | No | High-risk operations like deployments or deletions |
user-invocable: false |
No | Yes | Background knowledge and coding conventions |
Choosing Content Types
Skill content falls into two categories: reference content—knowledge such as coding standards or API conventions that runs inline so Claude applies it directly in the current conversation; and task content—step-by-step workflows like deployments or code generation, typically paired with context: fork to run in isolation without polluting the main conversation context.
2.3 Argument Passing and Dynamic Context Injection
String Substitution Variables
| Variable | Description |
|---|---|
$ARGUMENTS |
All arguments passed at invocation time |
$ARGUMENTS[N] or $N |
Positional argument by index, e.g., $0 (first), $1 (second) |
${CLAUDE_SESSION_ID} |
Current session ID, useful for generating unique identifiers |
${CLAUDE_SKILL_DIR} |
Directory containing the Skill, useful for referencing bundled scripts and files |
When running /migrate-component SearchBar React Vue: $0 → SearchBar, $1 → React, $2 → Vue.
Dynamic Context Injection
The !`command` syntax is a standout feature of Skills. It executes a shell command before Claude receives the prompt, replacing the placeholder with the command’s live output:
1 | --- |
Execution flow: each !`command` runs immediately → its stdout replaces the placeholder in the Skill body → Claude receives a complete prompt populated with live PR data. Combined with context: fork and agent: Explore, the entire review runs inside an isolated, read-only subagent.
Skills vs. Subagents
| Dimension | Skills | Subagents |
|---|---|---|
| Definition | SKILL.md + frontmatter |
.md files under .claude/agents/ |
| Invocation | Auto-loaded or manually triggered via /name |
Referenced via context: fork + agent |
| Context | Inline by default, or isolated via fork |
Always runs in an isolated context |
| Best For | Knowledge injection + task orchestration | Complex standalone execution |
| Permissions | allowed-tools field |
Specified in the agent definition |
They compose cleanly: a Skill can dispatch to a Subagent via context: fork + agent, and a Subagent can in turn load its own Skills.
Permission Controls
Use /permissions to control exactly which Skills are allowed to run:
1 | # Disable all Skills |
Skill(name) performs an exact match, while Skill(name *) matches by prefix with arguments. If too many Skills are registered and their descriptions exceed the context budget, raise the character limit:
1 | export SLASH_COMMAND_TOOL_CHAR_BUDGET=20000 |
3. hippo’s Field Notes
hippo: Here is what I learned using Skills on real projects:
3.1 Organizing Project-Level Skills
In my blog repository, .claude/skills/ holds several Skills: doc-writer (documentation rewriter), evaluator (article scorer), and planner (writing planner). Scope selection turned out to matter a lot—putting these at the project level (.claude/skills/) instead of the personal level (~/.claude/skills/) makes sense because they are tightly coupled to the repository structure, and teammates can use them out of the box.
3.2 Isolated Execution with context: fork
The scoring workflow’s evaluator Skill uses context: fork with a custom agent to run evaluation logic in isolation. All the file reads and intermediate calculations stay out of the main conversation, which stays clean and only receives the final score and recommendations. Before adding context: fork, a single scoring pass caused token consumption in the main conversation to spike; isolation solved that completely.
3.3 Scoping Permissions with allowed-tools
The doc-writer Skill sets allowed-tools: Bash(gh *) to constrain tool access, ensuring it can only run git-related operations and cannot accidentally modify scoring configs or other project files. This is far more granular than global /permissions rules—access is granted only while the Skill is active and revoked automatically once it finishes.
4. FAQ
Q: What if my Skill isn’t triggering automatically?
Check that the description field includes phrases a user would naturally say. Run What skills are available? to confirm Claude detects the Skill, or rephrase your prompt to align more closely with the description. If you want strict manual control, add disable-model-invocation: true and invoke it explicitly with /skill-name.
Q: How do Skills relate to legacy .claude/commands/?
Custom commands have been merged into Skills. Existing .claude/commands/ files keep working, but Skills offer more capabilities: multi-file layouts, frontmatter invocation controls, and automatic discovery. For new projects, use Skills directly.
Q: Why can’t Claude see all of my Skills?
The character budget for loading Skill descriptions into context scales dynamically (2% of the context window, with a 16,000-character fallback). Run /context to check for warnings about excluded Skills, and override the budget with an environment variable if needed: export SLASH_COMMAND_TOOL_CHAR_BUDGET=20000.
5. Summary
Skills are Claude Code’s core extension mechanism, and three concepts cover most of what you need:
SKILL.md+ frontmatter: Define knowledge and workflows in a single file while controlling invocation rules and permissions via frontmatter.- Dynamic injection with
!`command`: Run shell commands before sending the prompt to inject live data, turning Skills from static text into live workflows. context: forkisolation: Offload complex tasks to a subagent so the main conversation context stays clean.
Start with a simple reference Skill (such as team coding conventions) before building task-oriented Skills (such as automated deployments). The quality of a Skill largely comes down to how accurately its description is written—that is what determines when Claude loads it automatically.
Series Navigation
- Index: Claude Code Complete Guide · Series Index
- Previous: Official Docs Breakdown: How Claude Remembers Your Project
- Next: Official Docs Breakdown: Hooks Reference
Based on the official Agent Skills - Claude Code Docs documentation.
Last updated: 2026-03-31




