AI coding

How to Keep a Skill Small Enough That the Agent Loads It

Antonio Evans10 min read

A clean desk with a single index card labeled 'skill', a wastebasket overflowing with crumpled papers, and a small checklist on a clipboard with three items: trigger, steps, failure.
Key points

Key points

  1. 1A skill needs exactly three parts: the trigger (the words or condition that should load it), the steps the agent follows, and the one failure it prevents.
  2. 2The description field carries the whole triggering burden, so it must contain the phrases users actually type plus the outcome, not internal jargon.
  3. 3Progressive disclosure keeps an idle skill cheap (roughly 100 tokens for its name and description) but the loaded body still competes with conversation history, so keep it under about 5,000 tokens.
  4. 4Test the trigger with logged load events and a labeled query set of about 20 prompts, half that should fire and half that should not.

Where a skill's size actually comes from

An Agent Skill is a directory holding a SKILL.md file: YAML frontmatter at the top and a Markdown body below. The frontmatter's name and description are loaded into the system prompt at startup for every skill you install, at roughly 100 tokens each, while the body is read from the filesystem only when the skill is triggered, and bundled reference files and scripts are read only when the agent reaches for them (Claude platform docs). That tiered loading is called progressive disclosure, and it is the reason a large skill collection does not automatically blow your context budget.

The cost model is more subtle than "only the description is loaded". Three numbers matter, and each has a different owner:

TierWhat loadsWhenTypical costWho controls it
Metadata (name, description)Frontmatter onlyEvery run, at startupAbout 100 tokens per skillThe description line you write
InstructionsSKILL.md bodyWhen the skill triggersRecommended under 5,000 tokensThe steps you keep in the file
Resources and scriptsReference files, templatesOn demand during executionNothing until read; script output onlyHow much you bundle and how you reference it

Microsoft's implementation of the same open standard describes the same four stages (advertise, load, read resources, run scripts) and gives the same guidance: keep SKILL.md under 500 lines and move detailed reference material to separate files (Microsoft Learn). So the size problem is not mostly about the metadata. It is about the body, and about whether you wrote a body at all or smuggled a manual into it.

The attention argument explains why the loaded body matters even when it fits. Context is a finite resource with diminishing marginal returns: as token count rises, the model's ability to recall information accurately falls, a pattern sometimes called context rot (Anthropic's context engineering post). Anthropic frames this as an attention budget that every new token depletes. A 4,000-token skill that repeats what the model already knows is not free just because it fits.

The three parts every skill needs, and nothing else

Strip a skill to its irreducible core and you get three things.

The trigger: the exact user phrasing or condition that should cause the agent to reach for this skill. This lives in the description, because the description is what the agent matches the request against (agentskills.io description guide).

The steps: the ordered procedure the agent should follow once loaded. If the steps are subjective, write them as prose guidance. If a step is mechanical and fragile, ship it as a script instead, because scripts run through bash and only their output enters context (Claude platform docs).

The one failure it prevents: the specific mistake this skill exists to stop. This is the part almost everyone drops, and it is the part that decides whether the body earns its tokens. A log-fetching skill whose only job is "call this endpoint with these filters" is what Red Hat's Applied AI team calls a capability skill, one that patches a model gap and will deprecate as models improve. A skill that encodes your team's root-cause analysis order of operations is a preference skill, and it stays valuable because the model cannot invent your process (Red Hat Next).

If you cannot name the failure in one sentence, you probably do not need a skill. You may need a shell command in your project instructions, or nothing at all. Anthropic's own authoring guide makes the same point bluntly: assume the model is already very smart, and challenge every paragraph with "does this justify its token cost?" (Claude skill authoring best practices).

One distinction worth internalizing before you start cutting: skills are not system prompts. A system prompt is static text loaded once at session start. A skill is a file the agent discovers, evaluates for relevance, and loads dynamically, including code it can execute (Verdent's comparison). Anything that must apply in every conversation belongs in always-on project instructions, not in a skill. Claude's own course material draws the line the same way: always-on project standards go in CLAUDE.md, task-specific expertise goes in skills (Claude Academy). Every line you move from a skill into always-on instructions is a line you stopped paying for on every skill load, and every line you move out of always-on instructions into a skill is a line you stopped paying for on every unrelated turn.

What to delete, and the budget to delete toward

Here is a working budget. It is not a specification, it is a decision rule you can apply in one pass:

  • Description: one to three sentences, under about 500 characters of the 1,024-character hard limit. You want room inside the limit for synonyms and near-miss exclusions.
  • Body: under 500 lines and under 5,000 tokens. Microsoft states both numbers as guidance (Microsoft Learn); the token figure matches Anthropic's stated Level 2 budget (Claude platform docs).
  • Scripts: as many as the procedure genuinely needs, referenced by relative path, not pasted inline.
  • Reference files: everything that is lookup material, because they cost nothing until read.

Then delete in this order. Each category below is something the agent either already knows or can derive from the repository.

Delete thisWhyWhere it goes instead
Explanations of what a common format, library or file type isThe model already knows; a PDF explainer is wasteNowhere. Delete it.
Install instructions and dependency setupBelongs in project setup docsYour always-on project instructions
General coding standards and style rulesApplies to every turn, not this taskAlways-on project instructions
Long worked examples of successful runsThe steps already encode the procedureA reference file, or cut
API reference tables and schema dumpsLookup material, not procedureA reference file next to SKILL.md
Historical context, motivation, changelogDoes not change behaviorYour repo's commit history
Restatements of the same rule in three phrasingsOne clear statement is enoughNowhere. Delete it.

Anthropic's guide gives a concrete before and after for exactly this: a roughly 150-token passage explaining what PDFs are, why libraries are needed, which library is recommended and how to install it, versus a roughly 50-token version that just shows the extraction call (Claude skill authoring best practices). Same behavior, a third of the tokens.

The broader reason to be ruthless is that the same discipline applies to the tools around the skill. Guidance on agent tool counts holds that accuracy degrades past roughly 10 available tools, with a working recommendation of fewer than 20; connect a few MCP servers carelessly and you reach 90+ tool definitions and over 50,000 tokens of JSON schemas before the model reasons at all (SwirlAI). Skills help by deferring load, but a bloated skill body reintroduces the same problem on the one turn where precision matters most.

Where does a skill end and a script begin? The Red Hat team reports that moving mechanical steps out of inference and into deterministic scripts cut cost 26% in their experiments while improving accuracy (Red Hat Next). That is the strongest available argument for shrinking the body: every step you can replace with a script call is a step you deleted from the loaded context.

Writing the description line so the router actually fires it

The description carries the entire triggering burden. At startup the agent sees only names and descriptions; when a user request matches one, it reads the body (agentskills.io description guide). Nothing else about your skill exists at decision time.

Four rules do most of the work.

Write it as an instruction, not a label. "Use this skill when..." beats "This skill does...". Anthropic's own PDF skill does this explicitly, listing reading, extracting, merging, splitting, rotating, watermarking, filling forms and OCR, then closing with "If the user mentions a .pdf file or asks to produce one, use this skill" (SwirlAI, quoting the official repo). The list is long because the surface area is genuinely wide, and it names the literal token .pdf.

Use the user's words, not yours. Match against intent, not implementation. If your team calls it "the reconciliation job" but users say "check the books", both phrases belong in the description. Internal codenames that nobody types will never match.

Be pushy about scope. Explicitly cover cases where the user does not name the domain: "even if they don't explicitly mention the file extension." And prune over-broad claims so it does not fire on everything.

Test what should not trigger. The best negative cases are near-misses that share keywords but need a different capability. For a CSV analysis skill, "update the formulas in my Excel budget" shares "spreadsheet" but needs editing, not analysis, and "write a script that reads a CSV and uploads each row to Postgres" shares CSV but is ETL (agentskills.io description guide).

Here is a before and after for an internal expense skill:

# Before: jargon, no user phrasing, no outcome
name: exp-pol-v3
description: Applies the Contoso finance reconciliation policy framework to submitted artifacts.

# After: trigger words, user phrasing, the outcome, and a scope note
name: expense-report
description: File and validate employee expense reports against company policy, and flag anything over the category limit before it is submitted. Use when the user mentions expense reports, receipts, reimbursements, per-diem limits, or "will I get paid back", even if they do not name the policy.

The second version matches the element Microsoft's sample uses in its format documentation, which states the description should say both what the skill does and when to use it and include keywords that help agents identify relevant tasks (Microsoft Learn).

One nuance to design around: agents typically reach for a skill only when the task needs knowledge or capability beyond what they can handle alone. A one-step request like "read this PDF" may not trigger a PDF skill even with a perfect description, because basic tools suffice. Specialized workflows, unfamiliar APIs and uncommon formats are where description quality decides the outcome (agentskills.io description guide). If your skill does something the model can already do in one step, no wording saves it.

Test that the trigger fired

Two mechanisms, one cheap and one rigorous.

The cheap one is a load event in your logs. Most harnesses use named tools for this, which makes instrumentation straightforward. Microsoft's implementation advertises a load_skill tool, a read_skill_resource tool when any skill ships resources, and a run_skill_script tool when any skill ships scripts (Microsoft Learn). If you can log tool calls, you can count skill loads per session and per query without any special hooks. Other harnesses expose filesystem reads, in which case log reads of SKILL.md paths.

The rigorous one is a labeled probe set. Write about 20 realistic queries to a JSON file, 8 to 10 that should trigger and 8 to 10 that should not, and label each one. The official guide's format looks like this (agentskills.io description guide):

[
  { "query": "I've got a spreadsheet in ~/data/q4_results.xlsx with revenue in col C and expenses in col D, can you add a profit margin column and highlight anything under 10%?", "should_trigger": true },
  { "query": "can you write a python script that reads a csv and uploads each row to our postgres database", "should_trigger": false }
]

Then run each query through the real harness, check the log for a load event, and score two numbers: the share of should-trigger queries that loaded (your recall) and the share of should-not-trigger queries that stayed dormant (your precision). Both matter. A skill that never fires is dead weight whose metadata you still pay for on every run. A skill that fires on near-misses poisons turns with irrelevant instructions, which is a known failure mode: context poisoning, where an error enters the context and gets reused, compounds over subsequent steps (Splunk's production context guide).

Vary the should-trigger queries along four axes the guide names: phrasing (formal, casual, typos), explicitness (naming the domain versus describing the need), detail (terse versus context-heavy with real file paths), and complexity (single step versus the relevant task buried in a longer chain) (agentskills.io description guide).

When a query misses, the fix is almost never "add more instructions to the body". The body was not read. Rewrite the description with the words from the failing query, rerun the probe set, and confirm both scores moved.

A worked example of the arithmetic: suppose your probe set has 10 should-trigger and 10 should-not-trigger queries. First run, 6 of 10 fire and 3 of 10 near-misses fire. You have 60% recall and 70% precision. You rewrite the description to add the two missing phrasings from the four misses and to add an explicit exclusion ("not for editing spreadsheet formulas"). Second run: 9 of 10 fire, 1 of 10 near-misses fires. That is 90% recall and 90% precision from one description edit and no body change.

Evaluation discipline pays off beyond triggering. The Red Hat team calls a curated evaluation dataset one of your most valuable assets, because it grounds every optimization decision in evidence rather than intuition (Red Hat Next). The probe set is the smallest useful version of that asset, and it takes an hour to build.

A checklist before you ship

Run this against any skill before it goes into a shared library.

  • Can I state the one failure this skill prevents in a single sentence?
  • Does the description use the words users actually type, including at least one phrase that does not name the domain?
  • Does the description exclude at least one plausible near-miss?
  • Is the body under 500 lines and under roughly 5,000 tokens?
  • Have I deleted format explanations, install steps, style rules and duplicate rules?
  • Is every mechanical, fragile step a script rather than prose?
  • Is every lookup table in a reference file, referenced by relative path?
  • Does the probe set have 8 to 10 positive and 8 to 10 negative queries, and did I record both scores?
  • Did I confirm in the logs, not by eyeballing the answer, that the load event fired?

That last item is the one people skip. A correct-looking answer does not prove the skill loaded; the model may have guessed well. The log proves it.

If you are building skills across several teams and want a shared library with experts that carry the same discipline into a line of business, Quanta Skills is where those packaged skills and experts live.

FAQ

FAQ

How small does a skill body actually need to be?

Aim for under 500 lines and under roughly 5,000 tokens, the figures Microsoft publishes as guidance alongside its note to move detailed reference material into separate files (Microsoft Learn). The token budget matches Anthropic's stated recommendation for the instruction level (Claude platform docs). Below those numbers you are within spec; whether the remaining tokens each earn their place is a separate judgment.

What is the difference between a skill description and the skill body for triggering?

Only the description participates in triggering. At startup the agent loads each skill's name and description, about 100 tokens, and compares the user's request against them; the body is read only after a match (agentskills.io description guide). This means a beautifully written body cannot rescue a vague description, because the body is invisible at decision time.

My skill never fires. Should I add more instructions?

No. Adding body instructions changes nothing, because the body was never read. Rewrite the description to use the phrasing from the queries that failed, add an explicit "even if they don't say X" clause, then rerun your labeled probe set and compare trigger rates (agentskills.io description guide). Rerun the negative cases too, since a broader description can start firing on near-misses.

When should a step be a script instead of prose in the skill?

When it is mechanical, fragile and repeatable: fetching, formatting, validation, exact command sequences. Scripts run through bash and only their output enters context, so they cost no context until executed (Claude platform docs). Red Hat's team reports a 26% cost reduction and better accuracy after moving file fetching from inference to scripts in their root-cause analysis skill (Red Hat Next).

Does keeping skills small mean I should split one big skill into many?

Sometimes, but not automatically. Research on skill design points toward a "less is more" approach, since broad comprehensive skills that try to cover everything tend to serve none of it well (Red Hat Next). Split when the trigger conditions are genuinely distinct, because each skill's description is matched independently and a split gives the router a sharper signal.

Sources

Sources

  1. Agent Skills - Claude Platform Docs
  2. Agent Skills | Microsoft Learn
  3. Effective context engineering for AI agents - Anthropic
  4. Optimizing skill descriptions
  5. Building skills for AI agents: pitfalls and best practices
  6. Skill authoring best practices - Claude Platform Docs
  7. Claude Skills vs MCP vs Agents: Key Differences - Verdent Guides
  8. Skills vs. other Claude Code features · Introduction to agent skills
  9. Agent Skills: Progressive Disclosure as a System Design Pattern
  10. Context Engineering for AI Agents in Production: Architecture, Failure ...
About the author

About the author

Antonio Evans
Antonio Evans

Antonio Evans is the founder of Quanta Intelligence and a fractional CTO who builds HIPAA-ready AI systems for health and life-science companies. Before that he was technical co-founder of FriendsEAT for twenty years, CEO of Socialdraft, and a data engineer at IBM. Antonio lives with his dog Santino in Lisbon, Portugal.

All articles