الانتقال إلى المحتوى
Claude وأدوات الـ AI للبرمجةSkills و Hooks و Subagents· 7 دقائق للقراءة

Skills Load on Demand: How Progressive Disclosure Keeps Context Lean

Claude sees a short listing up front, reads SKILL.md when it's needed, and opens bundled files only if the task calls for them.

ReadIn

مقال كل يوم يفرق معاك

21 نوفمبر 2026
  • كاتب موثّق
  • Claude Code 2.x
محتويات المقال

A platform team keeps a 450-line incident runbook in CLAUDE.md: triage steps, rollback for twelve services, customer message templates. Someone suggests moving it into a skill. The lead says there's no point: "skills load into context just like CLAUDE.md." So every session, including one that renames a CSS class, starts with 450 lines of runbook. When they finally do move it, they paste all 450 lines into one SKILL.md and add forty skills from other teams in the same week. Two weeks later, during a real outage, Claude doesn't pick up the incident skill at all.

The common misconception

"Every installed skill's full instructions are in the context window all the time, just like CLAUDE.md." It sounds reasonable:

  • 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.

The half-truth is the last point. Skills do cost context, but in stages, and a cost you don't pay at startup is a cost you can design around.

What actually happens

Three levels, loaded at three moments

Anthropic calls the design : Claude "loads information in stages as needed, rather than consuming context upfront". An has three levels:

  1. 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.
  2. The body. When you type /name, or Claude decides the task matches the description, the SKILL.md body enters the conversation. Only then.
  3. 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.

Anthropic's engineering post draws the conclusion: because files cost nothing until they're read, the amount of context you can bundle into a skill "is effectively unbounded".

The listing has a budget

Level 1 is cheap per skill, not free in total. In Claude Code the listing's budget scales at 1% of the model's , and each entry's description is capped at 1,536 characters. Every skill name is always listed, but when the listing overflows, Claude Code drops descriptions, starting with the skills you invoke least. A skill without its description has lost the keywords Claude matches against, which is how the team's incident skill went quiet.

Two settings take a skill out of the listing on purpose. 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

Level 2 isn't paid once. The rendered SKILL.md enters the conversation as a single message and stays there for later turns, so every line is a recurring cost from then on, much like CLAUDE.md. Claude Code doesn't re-read the file, so instructions meant for the whole task should be written as standing rules. After , Claude Code re-attaches each invoked skill but keeps only its first 5,000 tokens, within 25,000 tokens for all skills, dropping the oldest first. What's at the top of SKILL.md survives; what's at the bottom may not.

One file vs a skill folder

The runbook, first as one big SKILL.md and then split by when each part is needed:

Markdown .claude/skills/incident/SKILL.md
---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)

The first version's description is too vague to reliably match "checkout is throwing 500s", and when it does load, all 400 lines ride along for the rest of the session. The second leads with the words people actually use, keeps only the steps, and points at the rest:

text .claude/skills/incident/
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 context

A billing outage now costs the listing entry, a short body, one section of rollback.md and the script's output. The cookbook of log queries became the script, which runs the same way every time.

Part of a skillEnters contextWhat it costs
Name and descriptionAt session startA small entry per skill, every request
SKILL.md bodyWhen you run it or Claude matches itIts full length, on every later turn
Reference filesWhen Claude reads oneOnly the files read
ScriptsNever; Claude runs themOnly their output

How to apply it in your project

  1. Measure firstCheck the Skills row in /context, run /doctor for the listing's estimated cost, and /skill-doctor for usage.
  2. Move procedures out of CLAUDE.mdA runbook, a release checklist or a style guide Claude needs only sometimes becomes a skill.
  3. Split the big SKILL.mdKeep the steps and the critical rules at the top, move reference material into files, and turn repeatable lookups into scripts.
  4. Write the description for matchingPut the key use case first, in the words your team actually types, and say when to use the skill.
  5. Hide what Claude shouldn't pickSet disable-model-invocation: true on skills with side effects, and use skillOverrides for 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.

📚 المصادر

  1. Extend Claude with skills — Claude Code Docs
  2. Agent Skills overview — Claude Platform Docs
  3. Equipping agents for the real world with Agent Skills — Anthropic Engineering
  4. Explore the context window — Claude Code Docs

التعليقات (0)