Vibe Engines
YouTube
AI System Design

Design Claude Skills

Learn AI system design by designing a skill system for an AI assistant like Claude.

The numbers to beat1instructions file0+reference files0+scripts

The whole design, in writing

Learn AI system design by designing a skill system for an AI assistant like Claude. An interactive guide covering why a hundred skills cannot all be carried in a 200,000-token context window, the folder (instructions file, extra files, scripts), the always-loaded label, a matcher where the description is the trigger, progressive loading in three levels, on-demand reference files, scripts that are run and never read, and the trust gate for skills someone else wrote.

Every step of the build above, written out: the problem each piece solves, the option that was taken and the ones that were not, the numbers, and how it fails in production.

The big idea

"Design a skill system" — why is this even hard?

An assistant should be able to do specialised things — format a report, fill a PDF, follow your team’s review checklist. Each of those needs pages of instructions. Give it a hundred skills at about 5,000 tokens each and that is 500,000 tokens of instructions, against a context window of, say, 200,000. Two and a half bags. The window is the one scarce thing, and it is also where the thinking happens.

UserClaude
New in this step: User, Claude. · swipe to pan the diagram

Do not carry the books — carry the labels. Put each skill on a shelf, keep only a name and a description in the window, open the instructions when the task needs them, open a reference file only when a step needs it, and run a script instead of reading it. Then treat the whole shelf as software someone wrote, because it is.

What the new pieces do

Userclient
The person asking. Their request is the only thing that decides which skill, if any, should be opened.
Claudemodel
The model and its context window — the one scarce thing. Everything a skill system does is about deciding what is allowed into this window, and when.

Step 1 · The folder

A skill is a folder, not a paragraph

A skill has to bundle three different kinds of thing: the instructions, the reference material those instructions point to, and small programs for work a program does better than a model. How do you package them so Claude can reach any of it without carrying all of it?

Skill FolderSKILL.md · files · scripts
New in this step: Skill Folder.

How should a skill be packaged?

  1. That is the everything-in-the-prompt build: a hundred of them is two and a half windows, and the bag is full before hello.

  2. Separate files mean separate costs. Instructions, manuals and code can each be reached on their own, so only what a task needs ever moves into the window.

  3. It adds a retrieval system to build and tune, and it still has no way to separate the instructions from the manual from the program.

A Skill Folder holds one SKILL.md (a name and description on top, instructions below), optional reference files and optional scripts. It sits on a shelf. Nothing in it is in the window yet.

Why this piece earns its place

The folder is the unit of reach, so its shape decides what can ever be made cheap. Splitting instructions from references from scripts is what lets the later steps exist at all: a skill that is one blob can only be loaded whole or not at all. Names are constrained for the same reason — a short, lowercase, hyphenated identifier is something a matcher and a human can both scan across a hundred entries without ambiguity. The part that gets underestimated is authorship: a folder is written once by someone who knows the task and read many times by a model that does not, so the instructions file has to be self-sufficient, and anything that would bloat it belongs one file over. A folder you cannot split is a folder you will end up loading whole.

  • 1instructions file
  • 0+reference files
  • 0+scripts

What the new pieces do

Skill Folderstore
A skill is a folder: one instructions file (SKILL.md), optional reference files, optional scripts. It lives on a shelf, not in the prompt.

Step 2 · The label

What is always carried

Claude cannot choose a skill it has never heard of, so something about every skill must be in the window all the time. How little can that something be and still let it choose?

Claude10K of labelsSkill FolderSKILL.md · files · scriptsLabel Indexname + description
New in this step: Label Index.

What should be loaded for every skill, every conversation?

  1. A hundred skills × 5,000 tokens is 500,000 — more than the window. The standing cost has to be a rounding error.

  2. A tag cannot say what the skill does or when to use it, so the model has nothing to match against and picks badly.

  3. About 100 tokens each: a hundred skills is ~10,000 tokens, 5% of the window, and it is enough for Claude to know every skill exists.

The Label Index: every skill’s name and description, about 100 tokens apiece, always loaded. 100 × 100 = 10,000 tokens — 5% of a 200,000 window. The folders stay on the shelf.

Why this piece earns its place

The label is the only part of a skill that is paid for every turn, so every word in a description is a recurring cost. That is the argument for brevity and also for precision: a description has to carry two things in a few sentences — what the skill does and when it applies — and it has to do it distinctly enough that it cannot be confused with its neighbours. Treat it like an API contract rather than a blurb. It is also the number that does not stay flat: labels cost nothing per skill on the day you have ten and half the window on the day you have a thousand, so a skill shelf needs a retirement policy the way a cache needs an eviction policy. The standing cost is small, but it is the one that scales with your ambition.

  • ~100tokens per label
  • 10,000for 100 skills
  • 5%of the window

What the new pieces do

Label Indexalways
Each skill’s name and description, about 100 tokens apiece. The only part of a skill that is always carried — 100 skills cost ~10,000 tokens.

Step 3 · The matcher

The description is the trigger

A request arrives: “turn this spreadsheet into a report.” A hundred labels are in the window. Something has to decide which skill, if any, applies — and that decision gets made with no access to the instructions.

Label Indexname + descriptionMatcherrequest vs. labels
New in this step: Matcher.

How does Claude decide which skill to use?

  1. The model is already a language matcher. The description is the trigger, so its wording decides whether the skill is ever chosen.

  2. A keyword table is brittle, needs maintenance per skill and misses paraphrases the model would catch for free.

  3. That loads every skill — the exact cost the label was designed to avoid — and burns turns on failures.

The Matcher is Claude itself: it lays the request beside the labels and chooses. No new service. That makes the description the trigger — written as what it does + when to use it, in the third person. A vague description is never picked, and nothing reports the miss.

Why this piece earns its place

Because the matcher has no instructions to consult, a miss is silent in a way most failures in a system are not. There is no exception, no log line, no timeout — the skill simply never fires and the assistant answers from general knowledge, often plausibly. That makes description quality a testable property you have to test on purpose: write a set of requests that should trigger the skill and a set that should not, run them, and treat a missed trigger as a defect in the description. The two failure directions matter separately. Too broad, and the skill steals requests it does not handle well; too narrow, and it never fires on the phrasing real users use. Tune with real requests, not with the wording you imagined.

  • 1,024chars max description
  • what + whenthe two halves
  • silentfailure when vague

What the new pieces do

Matcherservice
Claude itself, reading the request beside every description and choosing one. There is no search engine: the description is the trigger.

Step 4 · The loader

Open the book only when it matches

A label matched. Now Claude needs the actual instructions — but only that skill’s, only now, and not a byte of any other. How do they get into the window?

ClaudeSkill FolderLabel IndexMatcherLoader
New in this step: Loader. · swipe to pan the diagram

When should a skill’s instructions enter the window?

  1. That is the step-2 mistake again. Instructions you may never use are the most expensive tokens in the window.

  2. Progressive disclosure: level one always, level two on a trigger. The bag goes from ~10,000 to ~15,000 tokens, 33× less than carrying everything.

  3. Dribbling instructions in makes the skill inconsistent mid-task and wastes turns. Load it whole, once, when it is chosen.

The Loader reads SKILL.md with an ordinary file read — level two. Typically under 5,000 tokens, so the window goes from ~10,000 to ~15,000: 7.5%, 33× less than carrying all 100. When the task ends, nothing else was ever touched.

Why this piece earns its place

The loader is deliberately unremarkable — a file read — and that is the point: the skill system adds almost no new machinery, it only reorders when existing machinery runs. What it does add is a step. The window grows by a few thousand tokens and the user waits for one extra read before the work starts, so each level has to stay small enough that the wait is invisible. That is the real constraint on instructions: they are not free to be long just because they are loaded rarely, because they are loaded whole when they are loaded. Past a few hundred lines the right move is not a longer file but a second file — which is what the next level is for. The shape to aim for is a short instructions file that knows where the manuals are.

  • <5,000tokens at level 2
  • 15,00010K labels + 5K body
  • 33×less than all-in

What the new pieces do

Loaderlevel 2
On a match, reads the skill’s instructions file — typically under 5,000 tokens — into the window. Nothing else from the folder comes with it.

Step 5 · The extras

A manual that costs nothing until opened

Some skills need a lot: a 40-page style guide, a schema reference, a set of templates. Putting that in the instructions file brings back the cost problem at level two. Where should the manual go?

Claude10K of labelsReference Filesopened on demand
New in this step: Reference Files.

Where does a large reference document belong?

  1. Then every trigger of the skill loads the whole manual, including the 95% of requests that never touch it.

  2. The label is capped and paid every turn. A manual there is the worst possible place for it.

  3. Level three: a file costs zero tokens until it is read, and SKILL.md only needs to say when to read it.

Reference files sit beside the instructions and are opened one at a time, only when a step names them — level three. Keep them one level deep from SKILL.md, so Claude reads a file directly and never follows a chain of links.

Why this piece earns its place

The discipline here is about what the instructions file is for: it is a table of contents with opinions. Each pointer — “for the invoice schema, read this file” — turns a conditional cost into a conditional read, so a skill can ship a whole library and a given task pays for one chapter. The one-level-deep rule exists because a file that points to a file that points to a file is a path Claude may only partly follow, and partial reads of a manual are worse than none: it will answer with confidence from half a document. Flat structure also makes the dependency visible to a reviewer, which matters at the trust step, because everything the skill can pull in is then one directory listing away.

  • 0tokens until opened
  • 1 leveldeep from SKILL.md
  • on demandper step

What the new pieces do

Reference Fileslevel 3
Bundled manuals and templates, kept one level deep from SKILL.md. A file costs nothing until a step tells Claude to open it.

Step 6 · The script runner

Run the program, never read it

Some work is better done by code than by a model: parsing a file, summing a column, validating a form. A 2,000-token script would cost 2,000 tokens to read. Should Claude read the script to know what it does?

Script Runnerrun, never readSandboxoutput only → bag
New in this step: Script Runner, Sandbox.

How should Claude use a bundled script?

  1. The 2,000-token source never loads; a 50-token result does. That is 40× cheaper, and the answer is identical on every run.

  2. Reading it pays the full source cost for no benefit — the output is what the task needs.

  3. Slower, costlier, and different on every run — the opposite of why a script was bundled.

The Script Runner executes a bundled script in a Sandbox; only its output returns to the window. 2,000 tokens of source for a 50-token result: 40× cheaper, deterministic, and it cannot be talked into a different arithmetic answer.

Why this piece earns its place

Two properties come free and they are worth saying separately. The first is cost: source code is the most expensive way to describe a computation, and not loading it is the saving. The second is reliability: a program returns the same answer on the same input, while a model asked to redo the arithmetic returns a plausible one. The cost you take on is real and belongs in the design review — someone now maintains code, its packages and its failure modes, and the environment it runs in has to exist on every surface the skill can reach. And note what the runner changes about risk: a script runs with whatever access the sandbox grants it, which is why this step is the one the trust gate cares about most. Cheap and deterministic is also a good description of a thing you must not run unread.

  • 2,000tokens of source
  • 50tokens of output
  • 40×cheaper

What the new pieces do

Script Runnerservice
Executes a bundled script. The source never enters the window; only what it prints does.
Sandboxexec
Where the script actually runs. A 2,000-token program returning a 50-token result is 40× cheaper in the window — and identical every run.

Step 7 · The trust gate

A skill is software someone wrote

Everything so far assumed the folder is honest. But skills get shared — a teammate’s, a community one, one a vendor ships. Instructions can redirect Claude; scripts run code. What is the slot you only discover when a stranger hands you a skill?

ClaudeSkill FolderReference FilesScript RunnerSandboxTrust Gate
New in this step: Trust Gate. · swipe to pan the diagram

A colleague shares a skill folder. What do you do before installing it?

  1. The description is what the skill says about itself. The instructions and scripts are what it actually does.

  2. A skill is instructions and code, so the review is a code review: the files, the scripts, the network calls, the scope.

  3. A skill that exfiltrates data does exactly what its code says and looks fine from outside.

The Trust Gate: read every file, check that scripts do what the description claims, prefer skills you wrote or from a source you trust, scope sharing as narrowly as each surface allows, and sandbox what runs.

Why this piece earns its place

Nothing about the system so far makes a stranger’s skill dangerous — and nothing makes it safe. The properties that make skills powerful are the same ones that make them a vector. Instructions are read as guidance, so a hostile file can steer the assistant without ever looking like code. Scripts run, so a mismatch between a description and a script is the whole attack. And progressive loading, the cost optimisation, also means the dangerous file may not load until a specific step, so a casual first run proves very little. What you can do is cheap and boring: read it all, diff updates the way you would diff a dependency, keep the audience small, and run scripts where they cannot reach what they should not. A review is a few minutes; skipping it is how an unread folder ends up in production.

  • every fileread before use
  • narrowestsharing scope
  • 0unread installs

What the new pieces do

Trust Gategate
A skill is instructions and code from someone. Read every file, check the scripts do what the description says, share at the narrowest scope.

The payoff

You designed a skill system

From “put everything in the prompt” to a shelf: a folder per skill, a label that is always carried, a matcher that is just the model reading descriptions, instructions loaded on a trigger, manuals opened one at a time, scripts run and never read, and a gate that treats the whole shelf as software.

UserClaudeSkill FolderLabel IndexMatcherLoaderReference FilesScript RunnerSandboxTrust Gate
The finished design, end to end. · swipe to pan the diagram

Now install a thousand skills and watch the labels crowd the window, then install one nobody read and watch the gate matter. Those two are the whole trade-off: reach costs standing tokens, and power costs trust.

Everything you assembled, in order

  • Skill folder — instructions + optional files + optional scripts
  • Label — name + description, ~100 tokens, always loaded
  • Matcher — the model reads the request beside every description
  • Loader — level 2 — instructions read only on a match
  • Reference files — level 3 — opened on demand, one level deep
  • Script runner — run it, never read it; only output enters
  • Trust gate — read, scope and sandbox — a skill is software
  • The numbers — 10K labels → 15K working, vs. 500K all-in

Deep cut · 15:00

A hundred books, one bag.

The interactive build above lays out a skill system: a folder per skill, a label that is always carried, a matcher that reads the request beside every label, a loader that opens the instructions only on a match, reference files opened only when a step needs them, a script runner that returns output and never source, and a trust gate. The film builds the same seven parts live inside a chat window, one slot of a side panel at a time, with a bag gauge that climbs only as high as the task needs, and explains progressive loading so that a child could follow it.

  • See the bag: a hundred skills at 5,000 tokens each is 500,000 tokens, two and a half bags of 200,000. Labels alone are 10,000, 5% of the bag; one working skill makes it 15,000, 7.5%, which is 33 times less than carrying everything.
  • Take it into the interview: the description is the trigger, so a vague one is a silent failure; a script is run and never read, so a 2,000-token program costs a 50-token result; and a skill is software, so someone reads it before it is shared.

Where an interviewer pokes next

Getting the boxes right is the easy half. These are the questions that separate a candidate who drew the diagram from one who has run the thing. Answer each one out loud before you open it.

  1. A skill never fires even though users keep asking for exactly what it does. What do you check first?

    The description. Matching reads the request beside the label alone, so if the wording does not say when the skill applies — or uses different words than users do — it is never chosen, and nothing reports the miss. Test with real requests that should and should not trigger it, and fix the description before touching the instructions.

  2. Why keep reference files one level deep from SKILL.md instead of letting them link onward?

    Because a chain of links is a path Claude may follow only partway, and a partial read of a manual produces confident answers from half a document. Flat structure also keeps everything the skill can pull in one directory listing away, which is what a reviewer needs at the trust step.

  3. Labels are about 100 tokens each. Why is that still a problem at a thousand skills?

    Because it is the one cost paid every turn and it scales linearly: 1,000 × 100 = 100,000 tokens, half a 200,000 window, before the user types anything. Near-identical descriptions also blur, so the matcher gets worse as the shelf grows. You need a retirement policy and distinct descriptions, not just short ones.

  4. Why is running a script safer for correctness but not automatically safer for security?

    A program gives the same answer for the same input, so it fixes the unreliable-arithmetic problem. But it executes with whatever access its sandbox grants, so a script that does something its description never said is exactly as dangerous as any other code. Determinism and trustworthiness are different properties.

  5. Does progressive loading make a skill cheaper per use, or only cheaper to have?

    Mostly cheaper to have. Carrying a hundred skills costs 10,000 tokens instead of 500,000, so you can have all of them at once. A single use still costs its label plus its instructions (plus any file it opens), so the saving per use is that it never pays for the other ninety-nine.

Check yourself — the answers, and why

Eight steps in, these are the calls you should be able to make cold. Pick one, then read why.

  1. A hundred skills at ~5,000 tokens each and a 200,000-token window. Why can they not all be loaded up front?

    The arithmetic is the whole problem: 500,000 tokens of instructions cannot fit in a 200,000-token window, so only labels can be always-on.

  2. What is always loaded for each skill?

    Level one is only the label. A hundred of them is ~10,000 tokens, 5% of the window; the rest of every folder stays on the shelf.

  3. What decides whether the right skill is chosen?

    The description is the trigger. Claude has nothing else to match against, so a vague one is silently never selected.

  4. A 2,000-token script returns a 50-token result. What enters the window?

    A script is run and never read: its source stays out, only output comes in — 40× cheaper and identical every run.

  5. A colleague shares a skill. Before installing, you should…

    A skill is instructions and code from someone. The review is a code review, and progressive loading means a casual first run may never touch the risky file.

How you’d open this design in an interview

Before any boxes: agree what it must do, pin the qualities that shape everything, then build — naming each trade-off as you make it. The walkthrough above is that exact order.

What it must do

Agree on these before drawing a single box.

  • Know: tell Claude which skills exist without carrying all of them.
  • Match: pick the right skill from nothing but the user’s request.
  • Load: bring in that skill’s instructions — and only those — when the task needs them.
  • Run: execute a skill’s bundled programs reliably without reading their code.
  • Trust: stay safe when a skill is instructions and code someone else wrote.

The qualities that shape everything

Each one names the mechanism that buys it.

A hundred skills fit in a 200,000-token window
Each skill is a folder on a shelf, not a block in the prompt. 100 × 5,000 = 500,000 tokens would be two and a half bags, so nothing carries the folders themselves.
Standing cost stays about 5% of the window
Only a name and a description (~100 tokens per skill) are always loaded: 100 × 100 = 10,000 tokens, 5% of a 200,000 window.
The right skill is chosen from 100 labels
The matcher is the model itself, reading the request beside every description. The description (what + when, up to 1,024 characters) is the trigger.
Working cost stays under ~8% of the window
SKILL.md loads only on a match, typically under 5,000 tokens: 10,000 + 5,000 = 15,000, 7.5% — 33× less than carrying everything.
A manual costs nothing until it is read
Bundled reference files are opened one at a time, one level deep from SKILL.md, only when a step needs them.
Deterministic work is cheap and repeatable
A bundled script is run, not read: its 2,000 tokens of source never enter the bag, only a ~50-token output does — 40× cheaper and identical every run.

The trade-offs you say out loud

Senior signal isn’t the boxes — it’s naming what you gave up and why it was the right price.

Carry only labels over loading every skill up front

Everything-in-the-prompt fills the window before the user says hello and leaves no room to think. Labels give a hundred skills for ten thousand tokens — but they still grow, and a thousand labels is half the bag.

Match on the description over a separate search service

The model already understands language, so a good description needs no embedding index or router. The cost is that a vague description is missed silently — there is no error, the skill just never fires.

Load instructions on a trigger over preloading the likely ones

You pay for a skill only on the turn it works. The price is one extra read before the work starts, so each stage has to stay small.

Bundle files and read on demand over one giant SKILL.md

A whole manual can sit beside the instructions for zero tokens until a step opens it. Claude must find and open the right file, which is why references stay one level deep.

Run scripts, never read them over asking the model to do the arithmetic

A program is cheaper, identical every run and cannot be talked out of the answer. Someone has to maintain the code and its dependencies.

The answer, out loud

What a strong answer to “Design Claude Skills” sounds like, first question to last trade-off. It is about 4 minutes of talking; the whiteboard and the interviewer fill the rest of the 45. Read it aloud once, then close the page and give it yourself.

  1. 0–2 min

    Name the problem as arithmetic

    Before I draw anything I want the numbers on the board, because they are the whole design. Say there are a hundred skills at about five thousand tokens each. That is half a million tokens, and the context window is two hundred thousand — two and a half bags. So “put every skill in the prompt” is not a slow design, it is an impossible one. These figures are illustrative; the shape of the argument is not. The window is the one scarce thing, so the design is a way to carry as little as possible while still being able to reach everything.

  2. 2–5 min

    A skill is a folder; the label is what is carried

    I would define a skill as a folder: one instructions file, optional reference files, optional scripts. Then I split what Claude holds into levels. Always loaded is only the name and the description, about a hundred tokens a skill, so a hundred skills is ten thousand tokens — five percent of the window. Everything else stays on the shelf. The design choice I would defend is that the label is written by the skill’s author and is part of the contract, because it is the only thing Claude has when it decides.

    Built in step 2: What is always carried
  3. 5–8 min

    The description is the trigger

    Matching needs no new component. Claude reads the request beside every label and picks one, so the description does the work of a search index. That is why I would insist it says what the skill does and when to use it, written in the third person. The failure mode is quiet: a vague description is never chosen and nothing errors. So I would test descriptions the way I test routing, with real requests that should and should not fire.

    Built in step 3: The description is the trigger
  4. 8–11 min

    Load in levels, never all at once

    On a match, the loader reads the instructions file with an ordinary read, and only then. Typically that is under five thousand tokens, so the bag goes from ten thousand to fifteen thousand — seven and a half percent, thirty-three times less than carrying everything. Reference files go one level deeper again: opened only when a step names them, and kept one level deep from the instructions so Claude never chases a chain of links. Each level exists because the level above would load too much.

    Built in step 4: Open the book only when it matches
  5. 11–13 min

    Run the script, never read it

    For deterministic work I would bundle a script and have it run rather than read. The source never enters the window; only its output does. A two-thousand-token program that returns a fifty-token result is forty times cheaper, identical on every run, and it cannot be talked into a different arithmetic answer. The cost I would own out loud is maintenance: someone has to keep the code and its packages working.

    Built in step 6: Run the program, never read it
  6. 13–15 min

    A skill is software — gate it

    Last, trust. A skill is instructions and code from somebody, so a stranger’s folder can quietly steer Claude or run something I did not expect. I would require a read of every file, a check that the scripts do what the description says, and the narrowest sharing scope each surface allows. Then I would close by naming the trade: labels trade a sliver of standing cost for reach, loading trades one extra read for a small window, and the gate trades speed of install for not being surprised.

    Built in step 7: A skill is software someone wrote

What this teaches

Learn AI system design by designing a skill system for an AI assistant like Claude. An interactive guide covering why a hundred skills cannot all be carried in a 200,000-token context window, the folder (instructions file, extra files, scripts), the always-loaded label, a matcher where the description is the trigger, progressive loading in three levels, on-demand reference files, scripts that are run and never read, and the trust gate for skills someone else wrote.

Key takeaways

  • Skill folder — instructions + optional files + optional scripts
  • Label — name + description, ~100 tokens, always loaded
  • Matcher — the model reads the request beside every description
  • Loader — level 2 — instructions read only on a match
  • Reference files — level 3 — opened on demand, one level deep
  • Script runner — run it, never read it; only output enters
  • Trust gate — read, scope and sandbox — a skill is software
  • The numbers — 10K labels → 15K working, vs. 500K all-in

Concepts covered

  • "Design a skill system" — why is this even hard?
  • A skill is a folder, not a paragraph
  • What is always carried
  • The description is the trigger
  • Open the book only when it matches
  • A manual that costs nothing until opened
  • Run the program, never read it
  • A skill is software someone wrote
built to be reasoned about, not memorized — carry the label, open the book, run the script, read the stranger’s folder first.
Finished this one? 0 / 65 AI System Designs done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More AI System Designs