Agent Skills and Claude Code
Why this lesson
Section titled “Why this lesson”Lesson 9 catalogued the six canonical patterns. Each pattern lives or dies by the instructions you put in front of each LLM call: a router's classification prompt, a chain's per-step prompt, an orchestrator's task-decomposition prompt, an autonomous agent's overall guidance. Until now those instructions have lived in your application code as strings. This lesson is what happens when they become durable artifacts on disk: reusable, shareable, version-controllable, and auto-discovered by an agent harness when relevant. The capability the lesson builds: explain what Agent Skills are, how Claude Code reads them, and the durable-instructions pattern they enable.
Two specific Anthropic products land here. Agent Skills are the on-disk format. Claude Code is the worked agent harness that reads them; it is also useful in its own right as a complete agentic coding tool. Both are Anthropic-built. Both fit on top of the lesson 8 loop substrate and any of the lesson 9 patterns.
Agent Skills (the durable-instructions layer)
Section titled “Agent Skills (the durable-instructions layer)”The Agent Skills overview in the Anthropic docs frames Skills this way: Agent Skills are modular capabilities that extend Claude's functionality. Each Skill packages instructions, metadata, and optional resources (scripts, templates) that Claude uses automatically when relevant. The same page makes the contrast with prompts the point: Unlike prompts (conversation-level instructions for one-off tasks), Skills load on demand, so you don't have to repeat the same guidance across conversations. A prompt is a thing you type; a Skill is a thing you save once and reuse forever.
The on-disk shape is small. A Skill is a directory with a SKILL.md file at the root. The file has YAML frontmatter with two required fields:
---name: pdf-processingdescription: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.---Below the frontmatter, the body is ordinary Markdown: a title, then whatever sections the Skill needs. A Quick start section is usually the first one, and it names the library to reach for and shows the shortest call that works. For the PDF Skill above, that start points at pdfplumber, opening a document and pulling the text off its first page.
import pdfplumber
with pdfplumber.open("document.pdf") as pdf: text = pdf.pages[0].extract_text()The body then closes by pointing at its own companion files instead of inlining them, for example a line sending the reader to a FORMS.md in the same directory for advanced form filling.
The frontmatter rules are short. The name is brief and uses only lowercase letters, numbers, and hyphens, with no XML tags, and it cannot use the reserved words "anthropic" or "claude". The description must not be empty, has a length cap, and carries no XML tags either. The table below gives the exact limits. The body of SKILL.md is the instructions Claude reads after the description matches; additional files in the Skill's directory (FORMS.md, REFERENCE.md, a scripts/ folder with Python or other code) are referenced from SKILL.md and loaded only when needed.
| As of November 2026: frontmatter field | Required | Rules |
|---|---|---|
name | Yes | Maximum 64 characters; lowercase letters, numbers, and hyphens only; no XML tags; cannot contain the reserved words anthropic or claude |
description | Yes | Non-empty; maximum 1,024 characters; no XML tags; must say both what the Skill does and when Claude should use it |
| Source | Agent Skills overview, Skill structure |
Progressive disclosure (the architecture trick)
Section titled “Progressive disclosure (the architecture trick)”Skills work because they do not all sit in the context window at once. The docs name the pattern progressive disclosure, and the load order maps cleanly onto three levels:
| As of November 2026: level | When loaded | Token cost | Content |
|---|---|---|---|
| 1: Metadata | Always (at startup) | About 100 tokens per Skill | name + description from YAML frontmatter; included in system prompt |
| 2: Instructions | When the Skill is triggered | Under 5k tokens | SKILL.md body with instructions and guidance |
| 3+: Resources | As needed | None until accessed | Bundled files; reference files load when read; scripts run through bash and only their output enters context |
| Source | Agent Skills overview, How Skills work |
The metadata is what lets Claude find the Skill. The full instructions only load when the description matches the user's request. The bundled resources only load when SKILL.md references them. The overview's architecture section puts the mechanism plainly: Skills exist as directories on a virtual machine, and Claude interacts with them using the same bash commands you'd use to navigate files on your computer. So Claude reads SKILL.md via bash, then reads FORMS.md if the task needs it, runs a script if the Skill names one, and takes only the output back into context.
Two operational consequences. You can install many Skills without context penalty, because Level 1 is small. Bundled content has effectively no context cost until accessed, because Level 3 stays on the filesystem. This is why a Skill can include comprehensive API documentation, large datasets, or extensive reference materials without bloating every request that does not need them.
How Claude finds and uses a Skill
Section titled “How Claude finds and uses a Skill”The description field is the router. At startup, Claude sees the names and descriptions of all installed Skills in its system prompt. When a user request comes in that matches a Skill's when-to-use clause in its description ("use when working with PDF files"), Claude invokes the Skill by reading SKILL.md via the bash tool (lesson 5's Anthropic-schema client tool). That brings the instructions into context. If the instructions reference additional files, Claude reads those too via bash. If the instructions reference scripts, Claude runs the scripts and takes only their output. Claude Code works the same way in spirit with one shortcut: it loads a triggered Skill through its own Skill tool, and you can also call a Skill directly by typing a slash and its name.
This is the lesson 9 routing pattern (lesson 9, pattern 2) realized in concrete terms: the classifier is the model's own description-matching judgment; the specialized followup is the Skill's SKILL.md body; the resources the followup uses are the bundled files. A Skill is not a tool in the lesson 4, 5, or 6 sense; it is a durable, on-disk package of guidance that the agent can route to.
The Anthropic docs are explicit that the description is load-bearing: it should describe both what the Skill does and when Claude should use it. A vague description means the Skill never triggers; a precise one means it triggers reliably.
Where Skills live
Section titled “Where Skills live”Three surfaces support Agent Skills, with different sharing models and small differences in mechanics:
- Claude API. Custom Skills upload through the Skills API endpoints. Pre-built Anthropic Skills (PowerPoint, Excel, Word, PDF) are named by a short skill ID in the container parameter, alongside the code execution tool, whose container the Skills run in. Uploaded Skills are shared workspace-wide; all workspace members can access them. Skills run in a sandbox with no network access, and they are not eligible for zero data retention. The request details are in the table below.
- Claude Code. Filesystem-only, no upload step. Personal Skills live at ~/.claude/skills/; project-shared Skills live at .claude/skills/ (committed to the repo), and plugins can share them too. Claude Code discovers them automatically. The pre-built document Skills do not come with it. This is the simplest surface for team Skills under version control.
- claude.ai. Custom Skills upload as zip files from the Skills page in the app's customize menu, on the plans listed in the table below, with code execution turned on. Uploaded Skills are personal by default; on organization plans, people can share them with colleagues, and owners can provision them for everyone. Pre-built Skills work behind the scenes for document tasks.
| As of November 2026 | Claude API | Claude Code | claude.ai |
|---|---|---|---|
| How a custom Skill gets there | Upload through the Skills API (/v1/skills endpoints) | A folder in ~/.claude/skills/ (personal) or .claude/skills/ (project); plugins can also share Skills | Zip upload in Customize > Skills |
| Pre-built Skills | pptx, xlsx, docx, pdf, passed by skill_id in the container parameter (type anthropic) | Not available; the open-source Claude API skill comes bundled | Active automatically when you create documents |
| Beta header | None. The Skills API is out of beta, and the code execution tool needs no anthropic-beta header | Not applicable | Not applicable |
| Tool it needs | Code execution tool (the docs' Skills examples use code_execution_20250825) | Built in | Code execution must be enabled |
| Sharing | Workspace-wide | Personal, project (through Git), or plugins | Personal by default; on Team and Enterprise, shareable, and owners can provision Skills organization-wide |
| Runtime limits | No network access; no runtime package installation | Same network access as any program on your computer; install packages locally, not globally | Network access depends on user and admin settings |
| Plans or accounts | Claude Console account and API key | Pro, Max, Ultra, Team, Enterprise, or Console account (the free claude.ai plan does not include Claude Code); third-party providers also work | Custom Skills: Pro, Max, Ultra, Team, and Enterprise per the Agent Skills overview (the Help Center also lists Free) |
| Zero data retention (API) | Not eligible; Skill data is kept under the standard retention policy | n/a | n/a |
| Sources | Agent Skills overview, Skills guide, Code execution tool | Claude Code setup | Using Skills in Claude |
Custom Skills do not sync across surfaces. A Skill uploaded to the API is not visible in claude.ai; a Claude Code filesystem Skill is not visible on the API. Plan per surface.
Claude Code (the worked agent harness)
Section titled “Claude Code (the worked agent harness)”Skills are the durable-instructions layer; Claude Code is one of the canonical agents that reads them. The Claude Code overview positions it this way: Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools. Available in your terminal, IDE, desktop app, and browser.
For Track 22's purposes, Claude Code is the worked example of a lesson 8 style loop in production. It runs in the terminal (the claude command in a project directory), or as a VS Code or JetBrains extension, or as a desktop app, or on the web at claude.ai/code, which the Claude mobile app reaches too. Using it takes a paid plan or a Console account; the table above lists which. All surfaces connect to the same underlying engine, so your project's configuration travels with you: a CLAUDE.md file at the project root that Claude Code reads at the start of every session for project context, your settings, and your MCP servers (the lesson 6 connector). Alongside those sit your installed Skills at ~/.claude/skills/ or .claude/skills/, and your hooks (shell commands before or after Claude Code actions like auto-formatting after every file edit).
The features worth mapping back to the rest of Track 22:
- The loop is the lesson 8 loop. Claude Code makes Messages API calls, dispatches on each tool-use request, runs its tools, sends back the tool results, iterates. It is your 30-line loop, scaled, productionized, with a polished UI and a much larger built-in tool inventory (file editing, bash, web fetch, git operations).
- The tools span lessons 4, 5, and 6. Built-in tools (a shell tool plus file reading and editing tools, close cousins of lesson 5's bash and text editor tools) are the lesson 5 idea. Custom tools you define for agents built on the Agent SDK are lesson 4. MCP servers you register in the configuration are lesson 6, the same open protocol. Everything Track 22 taught about tools applies here.
- CLAUDE.md is the cached system prompt. Per lesson 7, a stable project-context document at the top of every session is a clear prompt-caching candidate; Claude Code does this for you.
- Auto memory builds across sessions. Claude Code saves learnings (build commands, debugging insights, project conventions) across sessions without explicit prompting. This is durable context distinct from Skills (Skills are pre-authored guidance; auto memory accumulates from observed work).
- Sub-agents and the Agent SDK are how patterns 4 (orchestrator-workers) and 6 (autonomous agent) get implemented inside Claude Code. Sub-agents are spawned focused inner loops (lesson 11 covers them directly). The Agent SDK lets you build custom agents powered by Claude Code's tools and capabilities, with full control over orchestration, tool access, and permissions.
A representative install and launch on macOS, Linux, or WSL is one line, a curl-pipe-to-bash from the install script URL (literal below), then the claude command in any project directory:
curl -fsSL https://claude.ai/install.sh | bashWindows has PowerShell, CMD, and WinGet installers; Homebrew and the main Linux package managers are options too. The full surface map and install paths are at code.claude.com/docs.
Skills and Claude Code together (the lesson 9 patterns, durable)
Section titled “Skills and Claude Code together (the lesson 9 patterns, durable)”The composition is where the lesson pays off. Take the lesson 9 routing pattern: a customer-service application that dispatches queries by category. In the in-code version, the classifier prompt and each specialized prompt are strings in your application. In the Skills and Claude Code version, each specialized branch is its own Skill on disk: billing-questions/SKILL.md, technical-support/SKILL.md, feature-requests/SKILL.md. The descriptions are precise enough that Claude's own routing judgment picks the right one. The bundled resources (escalation runbooks, FAQ snippets, response templates) sit beside each SKILL.md and load only when that branch triggers. The whole routing layer becomes a versioned, reviewable repository of guidance rather than scattered strings.
The same is true for the other patterns. Prompt chaining (lesson 9 pattern 1) becomes a chain of Skills where each step's SKILL.md hands off to the next via the bundled scripts. Orchestrator-workers (pattern 4) becomes an orchestrator Skill that names worker Skills, with each worker as a focused independent Skill. Autonomous agents (pattern 6) become Claude Code itself plus the Skills you authored for the domain. The patterns are unchanged; the durability and team-shareability of the instructions behind them is what Skills and Claude Code add.
Security and trust
Section titled “Security and trust”The Skills docs are direct about the trust model: Use Skills only from trusted sources: those you created yourself or obtained from Anthropic. Skills bring code and instructions into your agent's environment; a malicious Skill can direct Claude to invoke tools in ways that do not match the Skill's stated purpose, leak data, or execute harmful code. The docs name four specific risks worth keeping in mind: tool misuse, data exposure, external-source compromise, and Skills that fetch data from external URLs (whose content may contain instructions the agent picks up).
The discipline carries over from lesson 6's denylist guidance and lesson 8's tool-inventory-is-surface-area rule. Audit every Skill before installing. Prefer Anthropic-published Skills (the PowerPoint, Excel, Word, and PDF set; the open-source repository at github.com/anthropics/skills) and team-authored ones over third-party drops. In Claude Code specifically, project-committed .claude/skills/ go through code review like any other code, which is the right default posture.
Why this matters when you use Claude
Section titled “Why this matters when you use Claude”Before this lesson, every pattern you implemented from lesson 9 lived in your application code as strings. Those strings did not have version history, did not get code-reviewed, did not get reused across applications, and did not auto-discover when the model needed them. After this lesson, the same patterns live as Skills on disk: Git-tracked, code-reviewable, auto-discovered by description, surface-portable (with the caveat that you upload per surface). Claude Code is one Anthropic-built agent harness that reads them; the same on-disk format works on the Claude API for any agent harness you build.
The two highest-leverage takeaways for the week. For any in-application agent you have today, identify the three or four prompts that get edited most and convert them to Skills; you will get version history, the ability to A/B them, and team review for free. If you are coding professionally, install Claude Code, write a project CLAUDE.md with your conventions, and add a .claude/skills/ directory under version control; the auto-discovered Skills become how your team's coding norms travel with the repository.
Lesson 11 picks up directly on the sub-agents and Agent SDK mentions in this lesson: how patterns 4 and 6 spawn focused inner loops using Subagents (the Anthropic-managed primitive) and Claude Managed Agents (the cloud-hosted version). Lesson 12 closes the track with what changes when any of this goes to production.
What you should remember
Section titled “What you should remember”- Agent Skills (verbatim): modular capabilities that extend Claude's functionality. Each Skill packages instructions, metadata, and optional resources (scripts, templates) that Claude uses automatically when relevant. They are the on-disk durable-instructions layer for the lesson 9 patterns.
- On-disk shape: a directory with SKILL.md at the root. YAML frontmatter requires a name (short, lowercase letters, numbers, and hyphens, no XML, no reserved words) and a description (non-empty, length-capped, no XML, saying both what and when). Body is markdown instructions. Optional bundled files (FORMS.md, REFERENCE.md, scripts/) load on demand.
- Progressive disclosure (the load order): Level 1 metadata always loaded in the system prompt (small, per Skill); Level 2 SKILL.md body loaded when triggered; Level 3 bundled resources loaded as needed via bash (no cost until accessed). The description is the router; precise descriptions trigger reliably.
- Three surfaces, no sync: Claude API (uploaded through the Skills API; pre-built by skill ID in the container, alongside the code execution tool; workspace-shared; not eligible for zero data retention). Claude Code (filesystem at ~/.claude/skills/ or .claude/skills/; no upload; auto-discovery). claude.ai (upload as zip; personal by default, shareable on organization plans). Custom Skills do not sync across surfaces.
- Claude Code (verbatim): an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools. Available in your terminal, IDE, desktop app, and browser. Worked example of the lesson 8 loop in production; its tools span lesson 4 (custom tools via the Agent SDK), lesson 5 (built-in shell and file tools), and lesson 6 (MCP servers via configuration).
- Project configuration in Claude Code: CLAUDE.md at the project root is the cached system prompt Claude Code reads at the start of every session (auto-cached per lesson 7). Auto memory accumulates learnings across sessions. .claude/skills/ committed to the repo is how Skills travel with the project.
- Sub-agents and the Agent SDK are how patterns 4 (orchestrator-workers) and 6 (autonomous agent) get realized; Lesson 11 covers them directly.
- Security: Use Skills only from trusted sources: those you created yourself or obtained from Anthropic. Audit before installing; prefer Anthropic-published or team-authored Skills.
- Composition: Skills plus Claude Code equal the lesson 9 patterns as durable team artifacts. Routing becomes a directory of branch Skills; chaining becomes a chain of Skills; orchestrator-workers becomes an orchestrator Skill calling worker Skills; autonomous agent becomes Claude Code reading your domain Skills.
A loop in lesson 8. A catalog of patterns in lesson 9. The durable-instructions layer in this lesson, plus one Anthropic-built agent harness that reads it. Lesson 11 takes the orchestrator and autonomous patterns deeper with Subagents and Claude Managed Agents. Lesson 12 ships the result.