🧠Advanced

Agent Skills

Packaged knowledge and workflows loaded only when relevant — progressive disclosure for AI agents.

What Skills Are

Skills are folders containing instructions, scripts, and resources that teach an agent how to perform a specialized task consistently. Introduced in October 2025, they extend agent capabilities beyond general reasoning. Claude can invoke skills automatically based on the description matching the conversation, or you can trigger them via slash commands.

Progressive Disclosure

The core mechanism behind skills. At session start, only the YAML frontmatter (name + description, ~100-200 tokens per skill) loads into the agent's context. The full SKILL.md body and any auxiliary scripts only load when the skill is selected for use. This keeps the working context clean and avoids the context pollution problem that affects MCP.

StageWhat LoadsToken Cost
Session startOnly YAML frontmatter for every skill~100-200 per skill
Skill selectionAgent matches user intent against name + description fieldsZero additional
Skill activationFull SKILL.md body + script referencesVariable, only when used

Skill File Structure

text
.claude/
  skills/
    git-pushing/
      SKILL.md           ← YAML + workflow instructions
      scripts/
        smart_commit.sh  ← Auxiliary script the skill invokes
markdown
---
name: git-pushing
description: Stage, commit, and push git changes with conventional commit messages. Activates when user says "push changes", "commit and push", "push to github", or similar git workflow requests.
---

# Git Push Workflow

## When to Use
Automatically activate when the user:
- Explicitly asks to push changes
- Mentions saving work to remote
- Completes a feature and wants to share it

## Workflow
**ALWAYS use the script** — do NOT use manual git commands:

```bash
bash skills/git-pushing/scripts/smart_commit.sh
```

The script handles staging, conventional commit message, Claude footer, and push -u.
💡Tip

Skill selection is driven entirely by the YAML frontmatter. The body content does NOT influence whether Claude picks the skill. Adding trigger phrases inside ## When to Use is redundant — they only matter if duplicated in the description field.

Installing Skills from Marketplaces

Skills can be installed via the plugin marketplace system. Anthropic publishes official skill collections (anthropics/skills) including brand-guidelines, document creation, and example skills. Third-party marketplaces extend this with community skills.

bash
# Add the official Anthropic skills marketplace
/plugin add marketplace anthropic/skills

# List installed skills
/plugins

# In a fresh Claude session
> which skills do you have?

Skills with Auxiliary Scripts

Skills are not limited to static Markdown. They can include executable scripts in any language — Python, Bash, Node — that the agent runs as deterministic tools. This enables hybrid workflows: the skill provides procedural knowledge, scripts provide deterministic execution, and the agent orchestrates both.

  • Skill instructs agent to ALWAYS run a specific script
  • Script handles deterministic logic (git commands, file operations, API calls)
  • Script can itself call claude -p to get AI-generated content (commit message, summary)
  • Result: structured workflow with selective AI augmentation

Skill Resilience

Skills are not rigid bindings. If a referenced script path is wrong but the file still exists somewhere, the agent will search and find it. If a script execution fails, the agent falls back to its default reasoning to complete the task. Skills inject context and instructions — they do not replace the agent's general capability.

Skills vs MCP vs Subagents

PrimitivePurposeContext Cost
SkillProcedural knowledge + scripts, loaded on demandLow — frontmatter only until selected
MCP serverExternal tool/API access via standardized protocolHigh — all tool definitions load upfront
SubagentSpecialized AI personality with isolated contextZero in main context — runs in side chain
ℹ️Info

Skills can run inside isolated subagent context by setting context: fork in the YAML. The agent field selects which subagent type handles execution (Explore, Plan). This combines skill packaging with subagent context isolation.

Before you continue

We use analytics cookies to understand how the documentation is used and improve the experience. Privacy Policy.