Claude Skills

Overview

Claude Skills are the primary mechanism for extending the capabilities of Claude Code. They are structured, task-specific instructions that enable Claude to perform complex, multi-step workflows autonomously.

The Architecture of a Skill

A skill is more than just a prompt; it is a encapsulated “mini-agent” defined by:

  • SKILL.md: Contains the logic and metadata.
  • YAML Frontmatter: Used for Dynamic Discovery.
  • On-Demand Loading: Implements Progressive Disclosure to minimize token usage.

Types of Skills

  1. Built-in Skills: Native capabilities (file system, terminal).
  2. Global Skills (~/.claude/skills/): Personal expertise available across all projects.
  3. Project Skills (.claude/skills/): Repository-specific workflows, shared via Git.
  4. Nested Skills: Localized expertise within sub-modules.

Best Practices

  • Explicit Metadata: The description in YAML must accurately reflect the task to enable Dynamic Discovery.
  • Progressive Disclosure: Keep SKILL.md focused; use associated assets/ or templates/ folders for large resources.
  • Skill Injection: Use skills to enforce Spec-Driven Development patterns by creating skills for “Planning” or “Validation.”
  • SubAgent Delegation inside Skills: For heavy sub-tasks within a skill, dispatch SubAgents to keep the skill’s own context window lean. The skill acts as the orchestrator; subagents handle bounded work.

Relationship with Slash Commands

While Custom Slash Commands were the initial way to create prompt shortcuts, Skills represent the evolved, agentic version. Skills provide the same manual invocation (/skill-name) but add the layer of autonomous selection by the AI.

Integration

  • Claude Code: The host environment for skill execution.
  • Custom Slash Commands: The manual-invocation precursor to Skills.
  • MCP: Skills act as the logic layer orchestrating multiple MCP servers.
  • Memory Systems: Skills use the context from claude.md to ground their actions.

Skills vs. Custom Subagents

SkillsCustom Subagents
Execution contextRuns in the parent conversationIsolated context window
State accessFull parent context availableOnly what the subagent prompt specifies
Tool restrictionUses parent toolsConfigurable per-agent allowlist/denylist
ModelInherits parent modelConfigurable (haiku, sonnet, opus)
Persistent memoryVia CLAUDE.mdVia memory: frontmatter field
Use whenWorkflow needs parent contextSide task produces verbose output or needs isolation

A Skill can internally dispatch a SubAgent for heavy sub-tasks, keeping the skill’s own context lean. A custom subagent can have skills preloaded via its skills: frontmatter field, injecting domain knowledge at startup.

References