Agent Skills
Skills are reusable, filesystem-based resources that give Claude domain-specific expertise on demand. Unlike subagents (separate context windows) or tools (executable functions), Skills are prompt templates that inject specialized instructions into the current conversation context when triggered. Key insight: Skills do not execute code. They prepare Claude to solve a problem by expanding into detailed instructions, modifying tool permissions, and optionally switching models — then Claude executes from that enriched context.How Skills Work
Skills operate via a meta-tool architecture:- At startup — Claude loads all Skill metadata (name + description only, ~100 tokens/skill) into its context via the
Skillmeta-tool’s description - User sends request — Claude reasons over available skills and decides whether to invoke one (pure LLM reasoning, no algorithmic matching)
- Skill tool fires — Two messages are injected:
- Message 1 (visible):
<command-message>The "pdf" skill is loading</command-message>— status for the user - Message 2 (
isMeta: true, hidden): full SKILL.md content — instructions for Claude
- Message 1 (visible):
- Execution context modified — Allowed tools pre-approved, model optionally overridden
- Claude continues with enriched context and restricted/expanded tool access
Skill Structure
Every Skill is a directory containingSKILL.md and optional bundled resources:
SKILL.md Frontmatter
when_to_use appears in source code — appended to description with ” - ” separator. Not in official docs; avoid in production until documented.
Custom slash commands are now merged into skills via the argument-hint frontmatter field — no separate slash command format.
Progressive Disclosure
Three loading levels — only what’s needed enters context:
Critical: Script code never enters context — only script output. A 500-line Python script in
scripts/ costs ~0 tokens; only what it prints is visible to Claude.
references/ vs assets/: references/ (markdown docs) cost tokens — text is read into context via the Read tool. assets/ (templates, images) cost zero tokens — referenced by path only, never read into context. Prefer assets/ for large binary or template files.
The Skill meta-tool’s description contains a dynamically generated <available_skills> block with a 15,000 character budget for listing all loaded skills. Near this limit, skill descriptions may be truncated — keep descriptions concise.
Skill Scopes (Claude Code)
Common Patterns
Script Automation — offload deterministic logic toscripts/:
Relationship to Subagents
From the official docs:- Skills: run in the main conversation context; reusable prompts/workflows
- Subagents: separate context windows; isolated execution with own tools/model/permissions
- Preloading skills into subagents: via
skills:frontmatter field — full skill content injected at subagent startup
skills: field.
Security
Skills from untrusted sources are a prompt injection vector. A malicious SKILL.md can:- Invoke tools in harmful ways
- Exfiltrate data via network calls
- Execute arbitrary bash
SKILL.md and bundled scripts before installing. Bash in allowed-tools warrants extra scrutiny.
Rule: treat Skills like software packages — only use from trusted sources.
Skill Composition Patterns
Skills can be chained through context: invoke one skill to produce context/artifacts, then invoke another skill that operates on that output. Common compositions:- grill → to-prd → to-issues: planning session → PRD → task breakdown
- grill → handoff → prototype → handoff back: handle high-fidelity questions via prototype detour
- diagnose → tdd: establish feedback loop → implement fix with red-green-refactor
Grill-* Skills: Specific Antipatterns
The/grill-me and /grill-with-docs skills fail in predictable ways. Key patterns:
Low vs. high fidelity questions (Ryan Singer / Shape Up):
- Low-fidelity — answerable by Q&A: “what URL?”, “which field is optional?” → grillable
- High-fidelity — needs prototype to answer: “how will this 12-field form feel?” → ungrillable; hand off
When NOT to Use Skills
Skills add ~1,500+ tokens of overhead per invocation. Avoid when:- Task is one-off with no reuse potential — just prompt directly
- Context window is already constrained — skill injection may push into “dumb zone”
- The workflow is already defined in CLAUDE.md — no need for a skill to reinject context
- User is at implementation stage with a detailed plan — skills designed for planning/setup phases pay less dividends here
Visual Artifact Skills
Builder.io’s skills package adds a concrete pattern: skills that produce reviewable artifacts instead of more chat text./visual-planturns implementation plans into MDX documents with diagrams, file maps, annotated code, open questions, and UI/prototype review surfaces./visual-recapturns a branch, commit, PR, or diff into a visual recap with annotated diffs, API/schema summaries, architecture diagrams, and UI impact notes.
/plan-arbiter implements Multi-Vendor Adversarial Review for competing plans, /efficient-frontier implements Model Tier Routing, and /read-the-damn-docs is an operational form of the context7/current-docs rule.
Related Pages
- Agent Harness — harness components including skill/progressive disclosure as context management
- Agent Subagents — subagents and how skills can be preloaded into them
- Agent Teams — teams and skill loading behavior
- Indirect Prompt Injection — attack vector via malicious skill content
- Claude Code Plugins — plugin system that namespaces and bundles skills
- Builderio Skills — Builder.io skill catalog with visual plan/recap artifacts