Sub topic 11
Progressive disclosure: metadata, instructions, resources
This chapter assumes you have read the chapters on the context window and on the anatomy of a skill. You should know that a skill is a folder with a SKILL.md file that has name and description frontmatter.
The problem it solves
Every token in the context window costs space and attention. If you installed 30 skills and loaded all of them at the start of every session, most of the window would hold text that has nothing to do with the current task. Progressive disclosure avoids this by loading a skill in stages, and only as far as the task needs.
The three levels
Most tools that support skills follow the same pattern. Details vary by product, so check your tool's documentation.
| Level | What is loaded | When | Typical cost |
|---|---|---|---|
| 1. Metadata | `name` and `description` of every skill | At session start | A few dozen tokens per skill |
| 2. Instructions | The body of `SKILL.md` | When the agent decides the skill matches the task | Hundreds to a few thousand tokens |
| 3. Resources | Reference files and script output | Only when the instructions point to them | Depends on the file |
The agent always sees level 1. It reads level 2 only after it picks a skill. It reads level 3 only when a step in the body requires it.
A worked example
Take the changelog-entry skill from earlier. Its folder looks like this:
changelog-entry/
├── SKILL.md
├── reference/
│ └── format.md
└── scripts/
└── check_format.pySuppose you ask, "Fix the typo in the README." The agent has the changelog-entry description in context, sees no match, and never opens the folder. The skill cost only its metadata.
Now you ask, "Draft a changelog entry for the login fix." The description matches, so the agent reads the body of SKILL.md. The body says to read recent entries in CHANGELOG.md and group the changes. That is usually enough, so reference/format.md stays unread.
If the entry needs a rare section type, the last line of the body applies: "For the full format rules, see reference/format.md." Only now does the agent read that file.
Writing for each level
- Level 1: Make the description specific enough to trigger the skill, and short enough to carry in every session.
- Level 2: Keep the body to the steps the agent needs on every run. A common guideline is to stay under a few hundred lines.
- Level 3: Move rarely needed detail into separate files. Say in the body exactly when to read each one, for example "If the change touches the API, read
reference/api-rules.md."
Scripts are a special case. The agent can run a script and read only its output, so the script's source never enters the context. This suits checks and conversions that would be long to describe in prose.
Common errors
- Putting the whole manual in
SKILL.md, so every activation is expensive. - Vague descriptions, so the skill never reaches level 2 or triggers on unrelated tasks.
- Deeply nested references, where one file points to another that points to a third. The agent may skim or skip them. Link each file directly from
SKILL.md.
Exercise
A skill's SKILL.md body is 900 lines, and 700 of them describe an edge-case format that applies to about one request in twenty. How would you restructure it, and which loading level does each part end up at?
Show answer
Keep the common steps in SKILL.md (level 2). Move the 700 lines of edge-case rules into a file such as reference/edge-cases.md (level 3), and add a line in the body like "If the request involves the legacy format, read reference/edge-cases.md." The description stays unchanged at level 1. Now 19 of 20 requests never load the edge-case text.