Skill Context Explosion: Three Compounding Mechanisms and a Four-Phase Fix
> TL;DR: This is not a problem solved by "just use progressive disclosure." 5-6 long skill descriptions can exhaust the character budget; Transformer n² attention exponentially dilutes signal; and 3 similar skills are harder to disambiguate than 100 dissimilar ones. Three mechanisms stack — no single fix addresses all of them.
Why "progressive disclosure" is only half the answer
The most common candidate answer is progressive disclosure — skill metadata (name + description) enters context at session start, full content loads only on invocation. Anthropic's engineering blog confirms this as a core design principle:
> "Progressive disclosure is the core design principle that makes Agent Skills flexible and scalable." — Anthropic Engineering Blog, 2025-10-16
But progressive disclosure only solves the first layer (on-demand full-content loading). Metadata-layer crowding itself triggers three compounding mechanisms.
The three compounding mechanisms
Mechanism 1: Character budget truncation — the hard ceiling
Even metadata costs budget. Anthropic's PDF guide requires descriptions "under 1024 characters"; with name, trigger conditions, compatibility, and metadata fields, a single skill's metadata easily reaches 1,000-1,500 characters. Per community observation of Claude Code internals:
- Roughly 1% of total context, or a fixed fallback (~8,000 characters), is allocated to tool/skill metadata
- Beyond budget, new skill metadata gets truncated or ignored — the model may not see a skill exists at all
- Math: 1,200 chars per skill / 8,000 char budget → saturated at 6-7 skills. Detailed descriptions (good practice) accelerate failure.
- Anthropic's Claude Code docs explicitly warn: if more than 20-50 skills are enabled simultaneously, expect slowness/degradation — "Recommend selective enablement."
- Anthropic engineer Thariq Shihipar (Claude Agent SDK Workshop, 2026-01) advocates folder-based organization, recording real gotchas, writing descriptions as triggers ("when to use", not "what it does"), and giving Claude code (helper functions) rather than prose.
- Japanese developer takuyanagai0213 grew 100 skills in 4 months: PR output went from 2/month to 175/month (87.5x), $200/month Max Plan consumed tokens equivalent to ~$4,900/month (24.5x leverage) — critically, the 100 skills are not all activated simultaneously; they load selectively per task.
- GitHub user alirezarezvani publishes claude-skills with 235 production-ready skills across 12 domains — but the active working set is far smaller than the total inventory.
- Park et al. (2026), "Agent Skills in the Wild": scanned 42,447 public skills, 31,132 validly analyzed — 26.1% contain security vulnerabilities, 14 vulnerability patterns, 86.7% detection precision; skills with executable scripts have double vulnerability odds (OR=2.12)
- Snyk ToxicSkills: 3,984 skills scanned, 13.4% critical issues, 36.82% with some security issue
- Li et al. (2026): 98,380 skills scanned, 157 confirmed malicious
- Anthropic added
disableSkillShellExecution(2026-04); CVE-2026-25253 is cited as the first agentic-AI-related CVE - Bronze (fail): "Progressive disclosure already solved it; metadata is only ~100 tokens."
- Silver (pass): acknowledge metadata char budgets, n² attention dilution, and disambiguation with similar skills.
- Gold (win): layered solution — Phase 0 budget bump as stopgap, Phase 1 cleanup, Phase 2 four-piece toolkit, Phase 3 architectural refactor — plus the security angle, with real-world examples (Thariq's namespace+path strategy; 100-skill selective enablement; 235-skill repo with small working set).
- Anthropic Engineering Blog: "Equipping agents for the real world with Agent Skills" (2025-10-16)
- Claude Code Docs: "Extend Claude Code" (2025-09-01)
- Chroma Research: "Context Rot: How Increasing Input Tokens Impacts LLM Performance" (2025)
- Liu et al.: "Lost in the Middle: How Language Models Use Long Contexts" (TACL 2024)
- Park et al.: "Agent Skills in the Wild" (2026)
- Snyk: "ToxicSkills" Analysis (2026)
- Li et al.: Large-Scale Skill Security Scan (2026)
- Thariq Shihipar: Claude Agent SDK Workshop (2026-01-14)
- takuyanagai0213: Zenn article on growing 100 Claude Code skills (2025-11-27)
- alirezarezvani: "claude-skills" GitHub repo (235 skills)
- GitHub Issues: anthropics/claude-code #22345, #51165
- MorphLLM: "Context Rot: Why LLMs Degrade as Context Grows" (2026-03-13)
- ByteByteGo: "A Guide to Context Engineering for LLMs" (2026-04-06)
> ⚠️ Note: the "1% or 8,000-char fallback" figures come from community observation; Anthropic has not published the exact budget algorithm. But the existence of a hard cap on metadata is verified by multiple engineering teams.
Mechanism 2: n² attention dilution — Transformer's mathematical fate
Self-attention is quadratic: n tokens → n² pairwise relations (10K tokens ≈ 100M relations; 1M tokens ≈ 1 trillion). Softmax normalization means attention weights dilute exponentially as the denominator grows. Chroma's 2025 "Context Rot" study (testing 18 frontier models) found:
> "What matters more than whether relevant information is present is how that information is presented. Position and context size determine whether the model can actually use the information." — Chroma Research, 2025
Concretely: with 20 skills' metadata packed at the end of the system prompt, when a user says "deploy," the model must find the right description — but it may sit in the "lost in the middle" zone. Result: the model ignores the correct skill entirely or invokes the wrong one. "Context rot" was coined by Chroma (Kelly Hong, Anton Troynikov, Jeff Huber) and later adopted by Anthropic's blog.
Mechanism 3: Disambiguation difficulty — similarity is poison
3 similar skills are deadlier than 100 dissimilar ones. Chroma's distractor interference experiments:
> "Adding semantically similar but irrelevant content causes degradation beyond what context length alone explains. Distractors that are topically related to the query but factually irrelevant appeared most frequently in hallucinated responses."
Example: /deploy-staging, /deploy-production, /deploy-rollback all share keywords like "deploy" and "CI/CD". Per community interpretation of BFCL v4 data, accuracy may drop 1-8 percentage points in near-duplicate distractor scenarios; DiaBENCH reports 29.2% of test cases contain near-duplicate distractors.
Industry reality: "100+ skills" is a theoretical ceiling, not a performance recommendation
The phased rescue plan
Phase 0 (5-minute stopgap): raise the char budget
Raise SLASH_COMMAND_TOOL_CHAR_BUDGET (community-reported env var) to 24000. This relieves truncation but amplifies attention dilution — about 2/3 of the effect is negative cost. It postpones the crash point rather than fixing it.
Phase 1 (half-day audit): skill cleanup
1. Scan all SKILL.md files
2. Group by function (deploy, debug, data access, code review...)
3. Delete skills with zero invocations in 30 days
4. Merge overlapping skills
5. Compress descriptions to under 200 characters, keeping only trigger keywords
Official guidance: move detailed docs to references/, keep SKILL.md under 5,000 words.
Phase 2 (structural fixes): the four-piece toolkit
1. Paths: restrict auto-activation by glob patterns / project directories
2. disable-model-invocation: removes the skill from the model's auto-selection pool entirely — context cost drops to zero; only callable via /skill-name manually. Known limits: plugin skills' flag was reported buggy (2026-02-01); context: fork + Skill tool errored in v2.1.113.
3. context: fork — run in an isolated subagent; main agent only sees the summary. Community reports ~70% token savings with 5 parallel subagents (unverified original source).
4. Plugin packaging — bundle related skills with namespacing (e.g., /my-plugin:review).
Phase 3 (architecture refactor): from "all active" to "on-demand activation"
1. Index Skill pattern: 1 auto-detect skill lists all others; the rest get disable-model-invocation: true — ~26 tokens vs ~2,000+ tokens for 20 skill metadata (see GitHub Issue #22345)
2. Agent Team pattern: multiple independent sessions coordinating via messaging, each with its own context window
3. Memory Scope pattern: use memory features to retain cross-session invocation history
The security dimension: skill supply-chain attacks
Bonus interview point: disable-model-invocation is also security isolation — fewer auto-triggered skills means a smaller attack surface.
Interview answering framework
What this question really tests
1. Understanding of Transformer's mathematical constraints — n² attention is an architecture invariant 2. Engineering experience — you only know the char budget is a hard wall after 5-6 skills broke in production 3. Layered thinking — stopgap → root fix → architecture, not one trick 4. Security awareness — skill count correlates with vulnerability exposure
In one sentence: this question separates "people who read the docs" from "people who got burned by context rot in production."