Research date · June 18, 2026
Generated with AI

Agent Skills, From the Ground Up

An Agent Skill is, at its simplest, a folder with a SKILL.md file in it — and yet that folder is one of the more important ideas in how agents are built today. This paper explains skills from the basics and then in depth: the concept, the format, the progressive-disclosure technique that keeps them cheap, how a skill is triggered and run, and the full implementation across the Claude Developer Platform, Claude Code, the Agent SDK, and the open standard. Every claim is cited to official documentation.

What a Skill is, and the problem it solves

Modern models are capable, but capability is not the same as competence at your task. Anthropic frames the gap plainly: “Claude is powerful, but real work requires procedural knowledge and organizational context.” A model knows how to write Python in the abstract; it does not know your company's brand guidelines, your spreadsheet conventions, or the exact steps your team follows each month to finalize its financial accounts. An Agent Skill is how you give it that knowledge.

The official definition: “Agent Skills: organized folders of instructions, scripts, and resources that agents can discover and load dynamically to perform better at specific tasks. Skills extend Claude's capabilities by packaging your expertise into composable resources for Claude, transforming general-purpose agents into specialized agents that fit your needs.” The recurring analogy is worth remembering, because it explains nearly every design decision that follows: “Building a skill for an agent is like putting together an onboarding guide for a new hire.”

Sources: anthropic.com · Equipping agents for the real world with Agent Skills (problem statement; definition; onboarding analogy) · platform.claude.com · Agent Skills · Overview · anthropic.com · Introducing Agent Skills.

The mental shift. You are not giving the agent a new limb (that's a tool). You are giving it the training manual for a job it can already physically do. A skill is procedural knowledge — the workflows, context, and best practices that, in Anthropic's words, “transform general-purpose agents into specialists.”

Why not just put it all in the prompt?

You could paste your conventions into every conversation, or grow your system prompt until it covers every task. The problem is the context window. Anthropic treats it as a scarce shared resource: “The context window is a public good. Your Skill shares the context window with everything else Claude needs to know.” Loading all of your procedural knowledge up front — most of which is irrelevant to any given request — leaves less room for the conversation itself. Skills solve this with the design principle covered in section 3: they make the loaded cost of knowledge proportional to its relevance. As the engineering team puts it, because agents can read files on demand, “the amount of context that can be bundled into a skill is effectively unbounded.”

Sources: platform.claude.com · Agent Skills · Best practices (“The context window is a public good”) · anthropic.com (“effectively unbounded”).

1 · Anatomy of a Skill

“At its simplest, a skill is a directory that contains a SKILL.md file. This file must start with YAML frontmatter that contains some required metadata: name and description.” Everything else — extra instructions, reference docs, scripts, templates — is optional and lives alongside it in the folder.

pdf/  — the skill directory (its name matters) SKILL.md REQUIRED · YAML frontmatter (name + description) followed by Markdown instructions Level 1 + 2 FORMS.md · reference.md · examples.md extra instructions, loaded only when referenced Level 3 scripts/ fill_form.py · validate.py executed via bash; code never enters context Level 3 assets/ · templates · data files any supporting resource — no context cost until something reads it Only SKILL.md is required. The rest is loaded on demand — which is what keeps a skill cheap.
Figure 1 · A skill is a folder. SKILL.md is the entry point; everything else is optional and loads only when the agent needs it.

The SKILL.md frontmatter

The frontmatter is YAML between --- fences. Two fields are required, and the docs specify exact validation rules for each — because these strings end up in the model's system prompt and are how it chooses the right skill.

---
name: pdf-processing
description: Extracts text and tables from PDF files, fills forms, and merges
  documents. Use when working with PDF files or when the user mentions PDFs,
  forms, or document extraction.
---

# PDF Processing

## Instructions
[Step-by-step guidance for Claude to follow]

## Additional resources
- For form-filling, see [FORMS.md](FORMS.md)
- For the full API reference, see [reference.md](reference.md)
name

Claude Platform validation: max 64 chars; lowercase letters, numbers, and hyphens only; no XML tags; not the reserved words anthropic/claude. The open spec adds that the name must match the parent directory and forbids leading, trailing, or consecutive hyphens.

description

Non-empty, max 1024 chars, no XML tags. Must say both what the Skill does and when to use it — it is the trigger signal.

Body

Markdown instructions. Keep it under ~500 lines; split into separate files when it grows. SKILL.md works “like a table of contents.”

Source · Best practices · Skill structure & technical notes (Claude Platform field constraints, “Keep SKILL.md body under 500 lines”) · agentskills.io · Specification (open-spec name rules: parent-directory match; no leading/trailing/consecutive hyphens).
One reference level deep. The docs are specific about linking: “Keep references one level deep from SKILL.md. All reference files should link directly from SKILL.md to ensure Claude reads complete files when needed.” And for any reference file over 100 lines, add a table of contents at the top so the agent can see its full scope even on a partial read. Source: Best practices · referencing files.

2 · Progressive disclosure — the idea that makes Skills work

The whole design rests on one idea: “progressive disclosure: Claude loads information in stages as needed, rather than consuming context upfront.” A skill is loaded in three levels, and most of it usually never loads at all. This is what lets you install a hundred skills without overwhelming the context window.

LevelWhen loadedToken costContent
1 · MetadataAlways — at startup~100 tokens / skillname + description, injected into the system prompt
2 · InstructionsWhen the skill is triggeredUnder 5k tokensThe SKILL.md body, read from the filesystem via bash
3+ · ResourcesAs neededEffectively unlimitedBundled files & scripts — executed/read without loading contents into context
Source: platform.claude.com · Agent Skills · Overview (the three-level loading table, verbatim figures) · anthropic.com (the three levels in Anthropic's words) · agentskills.io · Specification (independently states the same ~100-token / <5000-token budgets).

What actually happens, mechanically

The best-practices “runtime environment” section explains the mechanics behind the table:

Why this matters for selection. Because only Level 1 is always present, the description matters enormously: “The description is critical for skill selection: Claude uses it to choose the right Skill from potentially 100+ available Skills.” A vague description means the skill never triggers; a precise one (what it does and when) makes it trigger at the right moment. That's why section 7 covers in detail how to write it. Source: Best practices · the description is critical for skill selection.

3 · How a Skill is triggered and run

Put the format and the disclosure model together and you get the full runtime picture. Anthropic walks through it as a four-step sequence on the context window — from a request arriving, to the skill being read off disk, to the task being done. Crucially, none of this is a special “skill engine”: the agent simply uses ordinary bash and file reads against a filesystem.

Agent + context window system prompt · conversation Filesystem (the skill) SKILL.md · forms.md · scripts/ Startup: context holds the system prompt + every skill's name & description (Level 1) + the user's request: “Fill in this PDF form.” 1 MATCH request matches the pdf skill's description → decide to use it 2 READ SKILL.md (Level 2) bash: read pdf/SKILL.md instructions now in context 3 FOLLOW REFERENCES (Level 3) read forms.md · run scripts/fill_form.py via bash only the script's OUTPUT returns — not its code 4 COMPLETE THE TASK the agent finishes with the loaded instructions + deterministic script results filled PDF produced — everything irrelevant stayed on disk
Figure 2 · The runtime sequence, adapted from Anthropic's “Skills and the context window” walkthrough. The agent triggers a skill by reading its SKILL.md via bash, optionally follows references and runs scripts, then completes the task. Unused files never touch the context window.
  1. 1
    Match

    “To start, the context window has the core system prompt and the metadata for each of the installed skills, along with the user's initial message.” The agent matches the request against descriptions and decides a skill is relevant.

  2. 2
    Read the body

    “Claude triggers the PDF skill by invoking a Bash tool to read the contents of pdf/SKILL.md.” Now — and only now — the instructions enter context.

  3. 3
    Follow references & run scripts

    “Claude chooses to read the forms.md file bundled with the skill.” Bundled scripts run via bash, and “only the script's output consumes tokens” — the code and the data it processes stay out of context.

  4. 4
    Complete

    “Finally, Claude proceeds with the user's task now that it has loaded relevant instructions from the PDF skill.” Deterministic steps were handled by code; the rest by the loaded guidance.

Source: anthropic.com · Equipping agents for the real world with Agent Skills (the four numbered “Skills and the context window” steps; the deterministic-code rationale) · Best practices (“Only the script's output consumes tokens”).

Why bundle code at all? “Certain operations are better suited for traditional code execution. For example, sorting a list via token generation is far more expensive than simply running a sorting algorithm… many applications require the deterministic reliability that only code can provide.” A skill's scripts give you repeatable, exact behavior for the steps that shouldn't be improvised — and they run on the code-execution substrate covered next. Source: anthropic.com · deterministic code rationale.
API

Implementation on the Claude Developer Platform Messages API + code execution

Skills attach to a request through the container, and run inside the code-execution sandbox.

On the API, “Skills integrate with the Messages API through the code execution tool… both require code execution and use the same container structure.” You name the skills you want in container.skills[], enable the code execution tool, and pass the beta headers. The skill's files are then copied into the sandbox at /skills/{directory}/ and loaded via the same progressive-disclosure mechanism described above.

1 · Attach skills to the request
response = client.beta.messages.create(
    model="claude-opus-4-8",
    max_tokens=16000,
    betas=["code-execution-2025-08-25", "skills-2025-10-02"],
    container={"skills": [{"type": "anthropic", "skill_id": "pptx", "version": "latest"}]},
    messages=[{"role": "user",
               "content": "Create a presentation about renewable energy with 5 slides"}],
    tools=[{"type": "code_execution_20250825", "name": "code_execution"}],
)
Source: platform.claude.com · Agent Skills · Quickstart (request shape) · Using Agent Skills with the API (container + code execution).
2 · Each container.skills entry

Every entry has a type, a skill_id, and an optional version. There are two kinds:

AspectAnthropic (pre-built)Custom
typeanthropiccustom
skill_idShort names: pptx, xlsx, docx, pdfGenerated: skill_01AbCd…
versionDate-based: 20251013 or latestEpoch: 1759178010641129 or latest
AvailabilityMaintained by Anthropic; available to allUploaded via the Skills API; private to your workspace
Source: platform.claude.com · Using Agent Skills with the API (type/skill_id/version table; “You can include up to 8 Skills per request”; files copied to /skills/{directory}/).
3 · Manage custom skills via /v1/skills

The /v1/skills endpoints “give developers programmatic control over custom skill versioning and management” — create, list, and version skills. A bundle is “a directory containing a SKILL.md file at the top level… plus any supporting scripts or resources,” uploaded as a zip (or via the SDK's files_from_dir helper) and capped at 30 MB. To delete a skill you must first delete all its versions, or you get a 400.

Source: anthropic.com · Introducing Agent Skills (/v1/skills) · Skills API guide (bundle rules, 30 MB, versioning, delete behavior) · API reference · List Skills.
Beta headers

Three exact strings: code-execution-2025-08-25 (required for skills), skills-2025-10-02 (enables the Skills API), and files-api-2025-04-14 (upload/download container files).

The sandbox

Python 3.11.12, Linux x86_64, 5 GiB RAM, 5 GiB disk, 1 CPU. Containers expire 30 days after creation. Internet access is completely disabled — no outbound requests, full isolation.

Cost

Code execution is free when paired with web search/fetch; otherwise each org gets 1,550 free hours/month, then $0.05 per hour per container (5-minute minimum).

Source · Code execution tool (sandbox specs, “Internet access: Completely disabled for security”, pricing, and “The code execution tool enables Claude to use Agent Skills”) · Skills API guide (beta headers).
Pre-built skills & availability. Anthropic provides four document skills — pptx, xlsx, docx, pdf — available on claude.ai, the Claude API, Claude Platform on AWS, and Microsoft Foundry. (Code execution, and therefore API-hosted skills, is not currently available on Amazon Bedrock or Vertex AI.) Source: Overview (pre-built skills & surfaces) · Code execution · platform availability.
CC

Skills in Claude Code & the Agent SDK filesystem-based

No API upload — skills are just folders on disk, discovered automatically and loaded on demand.

In Claude Code and the Agent SDK, skills are filesystem artifacts rather than API objects. Claude Code “skills follow the Agent Skills open standard… Claude Code extends the standard with additional features like invocation control, subagent execution, and dynamic context injection.” A notable consolidation: “Custom commands have been merged into skills” — a file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy.

Where skills live · precedence
LocationPathApplies to
EnterpriseManaged settingsAll users in the org
Personal~/.claude/skills/<name>/SKILL.mdAll your projects
Project.claude/skills/<name>/SKILL.mdThis project only
Plugin<plugin>/skills/<name>/SKILL.mdWhere the plugin is enabled

On name clashes, “enterprise overrides personal, and personal overrides project,” and any of these overrides a bundled skill of the same name. Plugin skills use a plugin-name:skill-name namespace, so they can't collide.

Source: code.claude.com · Skills · Where skills live (paths, precedence, “custom commands have been merged into skills”).
Extra frontmatter & dynamic context

Claude Code adds optional fields beyond name/description — including when_to_use, allowed-tools, disallowed-tools, disable-model-invocation, user-invocable, context: fork (run in a subagent), model, effort, and paths (glob-gated auto-activation). It also supports the ${CLAUDE_SKILL_DIR} substitution and !`command` dynamic context injection, which “runs shell commands before the skill content is sent to Claude… so Claude receives actual data, not the command itself.”

---
name: deploy
description: Deploy the application to production
context: fork                    # run in a forked subagent context
disable-model-invocation: true    # only the user can trigger it, via /deploy
allowed-tools: Bash(python3 *)    # pre-approved while the skill is active
---

## Current changes
!`git diff HEAD`                  # output is injected before Claude sees the skill

## Instructions
Summarize the changes above, then deploy using ${CLAUDE_SKILL_DIR}/scripts/deploy.sh
A subtlety: allowed-tools grants, it doesn't restrict

Read this carefully, because it is easy to misread: “The allowed-tools field grants permission for the listed tools while the skill is active… It does not restrict which tools are available: every tool remains callable, and your permission settings still govern tools that are not listed.” And it behaves differently across surfaces — in the Agent SDK the field is ignored entirely: “The allowed-tools frontmatter field… is only supported when using Claude Code CLI directly. It does not apply when using Skills through the SDK.”

Invocation control

By default both you and the model can invoke a skill. disable-model-invocation: true makes it manual-only; user-invocable: false hides it from the / menu (model-only). skillOverrides in settings can control visibility without editing the SKILL.md.

In the Agent SDK

Skills are filesystem artifacts loaded per settingSources; the skills option ("all", a name list, or []) filters them. “The SDK does not provide a programmatic API for registering Skills.”

Plugins

Add a .claude-plugin/plugin.json and a skill folder “can bundle agents, hooks, and MCP servers.” Skills can also be distributed through plugin marketplaces, or provided by an MCP server.

6 · The open standard

On December 18, 2025, Anthropic published Agent Skills “as an open standard for cross-platform portability.” The format — the same SKILL.md-in-a-folder you've seen throughout — is documented at agentskills.io and is no longer Claude-specific: “The Agent Skills format was originally developed by Anthropic, released as an open standard, and has been adopted by a growing number of agent products.”

Sources: anthropic.com (the Dec 18, 2025 open-standard update banner) · agentskills.io · Home.

The result is one creator, one spec, and many independent implementations — including tools from Anthropic's direct competitors. The agentskills.io quickstart states it plainly: “Agent Skills are an open format. The same skill works in any compatible agent, including Claude Code and OpenAI Codex” — and it demonstrates the format in VS Code (where skills live under .agents/skills/ by default). Beyond those, the standard's client showcase lists dozens more implementations — among them Google's Gemini CLI, GitHub Copilot, Cursor, Mistral AI Vibe, Block's Goose, and data platforms like Databricks and Snowflake — each entry linking to that client's own skills documentation. In short, this is not a Claude-only format.

Sources: agentskills.io · Quickstart (“The same skill works in any compatible agent, including Claude Code and OpenAI Codex”; VS Code default path .agents/skills/) · agentskills.io · Client Showcase (lists each named client, with a link to that client's own setup instructions). The list grows over time — treat the named examples as a snapshot as of the research date.

The portable spec is deliberately small. It defines a directory with a SKILL.md (optionally plus scripts/, references/, assets/), YAML frontmatter followed by Markdown, and a tight frontmatter field set: required name and description, plus optional license, compatibility, metadata, and an experimental allowed-tools. It restates the same progressive-disclosure budgets — “Metadata (~100 tokens)… Instructions (< 5000 tokens recommended)… Resources (as needed)” — and the “keep SKILL.md under 500 lines” guidance.

Source: agentskills.io · Specification (directory structure, frontmatter fields, token budgets).
Standard vs. Claude Code: don't mix up the two field sets. The portable standard's frontmatter is the small set above. The many extra fields from section 5 (when_to_use, disable-model-invocation, context, model, paths, …) are Claude Code extensions to the standard, not part of the base spec. A skill that uses only the portable fields runs across compatible agents — the agentskills.io quickstart demonstrates the same skill working in VS Code, Claude Code, and OpenAI Codex (note: some clients default to a different skills path, e.g. .agents/skills/). Source: code.claude.com (“Claude Code extends the standard”) · agentskills.io · Specification · agentskills.io · Quickstart (cross-client portability).

7 · Authoring a good Skill

Anthropic's best-practices guidance is prescriptive, and most of it follows from one premise: “Default assumption: Claude is already very smart. Only add context Claude doesn't already have.” A skill is not documentation for a beginner; it's the missing context for an expert.

Write the description for triggering

  • “Always write in third person” — it's injected into the system prompt.
  • Include both what it does and the triggers/contexts for when to use it.
  • Be specific and include key terms; this is what selects the skill from 100+.

Be concise & match freedom to risk

  • Challenge each line: “Does this paragraph justify its token cost?”
  • “Match the level of specificity to the task's fragility and variability”: high freedom = prose; low freedom = “run exactly this script.”
  • Keep the SKILL.md body under 500 lines; split when it grows.

Prefer scripts & evaluate

  • “Prefer scripts for deterministic operations” — reliability, tokens, consistency.
  • “Build evaluations first”, before writing extensive docs.
  • Iterate with the model (the “Claude A builds for Claude B” pattern); test across Haiku/Sonnet/Opus.

Source: platform.claude.com · Agent Skills · Best practices (concise-is-key; degrees of freedom; third-person descriptions; prefer scripts; build evaluations first; test across models) · anthropic.com · developing & evaluating skills.

Naming & structure conventions. The docs suggest gerund-form names (processing-pdfs, analyzing-spreadsheets) and warn against vague ones (helper, utils). Split content using a “high-level guide with references” or “domain-specific organization” pattern, keep file references one level deep, use forward-slash paths, avoid time-sensitive info, and “solve, don't punt” (handle errors inside scripts rather than leaving them to the model). Source: Best practices · naming, structure, anti-patterns.

8 · Security & trust

Skills are powerful precisely because they carry instructions and code — which is also why they carry risk. Anthropic is direct: “a malicious Skill can direct Claude to invoke tools or execute code in ways that don't match the Skill's stated purpose.” The guiding rule is to “treat [a skill] like installing software.”

Use skills only from trusted sources. “If you must use a Skill from an untrusted or unknown source, exercise extreme caution and thoroughly audit it before use. Depending on what access Claude has when executing the Skill, malicious Skills could lead to data exfiltration, unauthorized system access, or other security risks.” Auditing means reading all bundled files — SKILL.md, scripts, and resources — with particular attention to anything that fetches from external URLs, since “fetched content may contain malicious instructions.” Source: platform.claude.com · Overview · Security considerations · anthropic.com · Security considerations when using Skills.

The security boundary depends on the surface

How much damage a skill could do depends entirely on where it runs — and the three surfaces differ sharply on network access. This is the single most important operational distinction:

SurfaceNetwork accessIsolation / boundaryPackage installs
Claude APINone — “Skills cannot make external API calls or access the internet”Isolated sandbox container, fully isolated from host; files limited to the workspacePre-installed packages only; no runtime installs
claude.aiVarying — “Depending on user/admin settings, Skills may have full, partial, or no network access”Code-execution sandbox; admin/plan-gatedManaged environment
Claude CodeFull — “Skills have the same network access as any other program on the user's computer”Your machine, but not unrestricted by default — access is gated by Claude Code's permission prompts, workspace trust, and permission/deny rules (and disallowed-tools), not a sandbox. (allowed-tools only broadens pre-approved access; it does not restrict it.)Local installs (global installs discouraged)
Source: platform.claude.com · Overview · Runtime environment constraints (per-surface network access, verbatim).
Distribution & the no-sync rule. Custom skills do not sync across surfaces: “Skills uploaded to one surface are not automatically available on others.” Scope also differs — claude.ai custom skills are per-user (no central admin management), API custom skills are workspace-wide, and Claude Code skills are filesystem-based and shared via version control, plugins, or managed settings. In Claude Code, “review project skills before trusting a repository, since a skill can grant itself broad tool access.” Source: Overview · Cross-surface availability & sharing scope · code.claude.com · Skills (project trust).

Summary

The concept

A folder of expertise

A skill packages instructions, scripts, and resources so a general-purpose agent becomes a specialist — “like an onboarding guide for a new hire.” It's procedural knowledge, not a new capability.

The format

SKILL.md + frontmatter

A directory with a required SKILL.md: YAML frontmatter (name, description) plus Markdown, optionally bundling reference files and scripts. Keep the body under ~500 lines.

The key idea

Progressive disclosure

Three levels: metadata always (~100 tokens), the body when triggered (<5k), resources as needed (unbounded). This is what makes 100+ skills affordable.

The runtime

Just files + bash

The agent triggers a skill by reading its SKILL.md via bash, follows references, and runs scripts whose code never enters context. There's no special engine — it's a filesystem and code execution.

The implementation

Container on the API, files everywhere else

On the API: container.skills[] + the code execution tool + beta headers, with a no-network sandbox. In Claude Code / the SDK: folders under .claude/skills/, discovered automatically.

The cautions

Open standard, real risk

The format is now an open standard (agentskills.io). Treat skills like installing software: use trusted sources, audit bundled code, and remember Claude Code skills run with full machine access.

Glossary

Agent Skill — A folder packaging instructions, scripts, and resources that an agent loads on demand to perform a specific task expertly.
SKILL.md — A skill's required entry file: YAML frontmatter (name, description) followed by Markdown instructions.
Progressive disclosure — The three-level loading model (metadata always, body when triggered, resources as needed) that keeps skills cheap.
Level 1 / 2 / 3 — Metadata (~100 tokens, always) / SKILL.md body (<5k, on trigger) / bundled files & scripts (effectively unlimited, on demand).
container — The Messages API parameter that carries skills[] (each with type, skill_id, version) and runs them in the code-execution sandbox.
Code execution tool — The provider-run Python/bash sandbox (code_execution_20250825) that skills run inside on the API; “enables Claude to use Agent Skills.”
Pre-built (anthropic) skills — The four document skills pptx, xlsx, docx, pdf, maintained by Anthropic.
Custom skill — A user-authored skill (id skill_01…), uploaded/managed via the /v1/skills endpoints; workspace-private.
allowed-tools — A Claude Code frontmatter field that grants tool permission while a skill is active; it does not restrict the available tool set (and is ignored by the Agent SDK).
${CLAUDE_SKILL_DIR} / !`command` — Claude Code helpers: the skill's directory path, and shell injection that runs before the skill content reaches the model.
Open standard (agentskills.io) — The portable Agent Skills spec (published Dec 18, 2025): SKILL.md + a small frontmatter set, usable across compatible agents.
Degrees of freedom — An authoring principle: match instruction specificity to a task's fragility (prose for flexible tasks, exact scripts for fragile ones).