
Skills Load on Demand: How Progressive Disclosure Keeps Context Lean
- كاتب موثّق
- Claude Code 2.x
محتويات المقال
The common misconception
Skills are Markdown instructions in .claude/, exactly like and rules, which do load at startup.Claude can pick a skill on its own, so it must already know what's inside, or so it seems. Installing a plugin makes its skills "available" right away, which reads like "loaded". Skills aren't free, and people have seen their context fill up after adding many.
What actually happens
Three levels, loaded at three moments
The listing. At startup, the name and description of every skill go into Claude's context. The description is what Claude matches your request against, so it has to say what the skill does and when to use it. Anthropic's Agent Skills overview estimates about 100 tokens per skill for this level. The body. When you type /name, or Claude decides the task matches the description, the SKILL.md body enters the conversation. Only then.Everything else in the folder. Reference files load only when Claude reads them. Scripts run, and only their output enters context; the code itself never does.
The listing has a budget
disable-model-invocation: true keeps its description out of context entirely, and only you can run it, which suits skills with side effects such as /deploy. The skillOverrides setting can set a skill you didn't write, such as one committed to a shared repo, to "name-only" or "off".
Once loaded, a skill stays
One file vs a skill folder
---description: Incident runbook---# Triage1. Check the dashboards ... (30 lines)# Rollback, all 12 services## billing ... (160 lines)# Customer message templates... (90 lines)# Log query cookbook... (120 lines)---description: Run an incident (triage, rollback, customer updates). Use when the user mentions an outage, an incident or an alert.---1. Run ${CLAUDE_SKILL_DIR}/scripts/recent-errors.sh and summarize the top five errors.2. Find the failing service and the deploy just before it.3. To roll back, read reference/rollback.md, that service only.4. For a customer update, start from reference/comms.md.incident/├── SKILL.md # steps and pointers, loaded when used├── reference/│ ├── rollback.md # read only when rolling back│ └── comms.md # read only for a customer update└── scripts/ └── recent-errors.sh # run, never read: only output in contextrollback.md and the script's output. The cookbook of log queries became the script, which runs the same way every time.
How to apply it in your project
Measure first Check the Skills row in /context, run/doctorfor the listing's estimated cost, and/skill-doctorfor usage.Move procedures out of CLAUDE.md A runbook, a release checklist or a style guide Claude needs only sometimes becomes a skill. Split the big SKILL.md Keep the steps and the critical rules at the top, move reference material into files, and turn repeatable lookups into scripts. Write the description for matching Put the key use case first, in the words your team actually types, and say when to use the skill. Hide what Claude shouldn't pick Set disable-model-invocation: trueon skills with side effects, and useskillOverridesfor skills you didn't write.
Key takeaways
At startup Claude sees each skill's name and description, not its instructions. SKILL.md loads when you run the skill or the task matches; then it stays for the rest of the session. Supporting files load only when read, and scripts cost only their output. The listing has a budget: too many skills and the least-used lose the descriptions that make them trigger. Lead SKILL.md with what matters most, because compaction keeps only the start.
التعليقات (0)