Skip to content

Instantly share code, notes, and snippets.

@alexey-pelykh
Last active June 28, 2026 05:26
Show Gist options
  • Select an option

  • Save alexey-pelykh/faa3c304f731d6a962efc5fa2a43abe1 to your computer and use it in GitHub Desktop.

Select an option

Save alexey-pelykh/faa3c304f731d6a962efc5fa2a43abe1 to your computer and use it in GitHub Desktop.

Claude Code Skill Budget Research

TL;DR: Claude Code has an undocumented ~16,000 character budget for skill metadata. With typical 263-char descriptions, only ~42 skills fit. To show more skills, compress descriptions to ≤130 characters. Note: This is a skills-specific limit—the Tool Search Tool's defer_loading feature does NOT apply to skills.


The Problem

When using Claude Code with 63 installed skills, the system prompt showed:

<!-- Showing 42 of 63 skills due to token limits -->

21 skills (33%) were completely hidden from the agent—it couldn't discover or invoke them.


Background: Skills vs Tools

This investigation revealed an important architectural distinction:

┌─────────────────────────────────────────────────────────────┐
│ TOOLS (API-level)                                           │
│ • Bash, Read, Write, Grep, MCP tools, etc.                  │
│ • defer_loading: true CAN apply here                        │
│ • Solved by: Tool Search Tool beta                          │
├─────────────────────────────────────────────────────────────┤
│ SKILLS (Claude Code-specific)                               │
│ • SKILL.md files in ~/.claude/skills/                       │
│ • Appear in <available_skills> section                      │
│ • defer_loading: DOES NOT APPLY                             │
│ • Needs: skill-specific solutions (hidden flag, compression)│
└─────────────────────────────────────────────────────────────┘

Why this matters: The Tool Search Tool beta (defer_loading) solves context bloat for MCP tools, but it does NOT help with skill visibility. Skills require their own solution.


The Budget

Empirical Findings

Metric Value
Empirical budget ~15,500-16,000 characters
Official documentation None exists
Configurable? No evidence of configuration options

How It's Calculated

Each skill in available_skills consumes approximately:

Component Characters
XML tags ~85
Skill name (avg) ~20
Location field ~4
Total overhead ~109
+ Description Variable
Total per skill = description_length + 109
Budget fills at ~15,700 characters total

Capacity by Description Length

Description Length Skills That Fit
263 chars (observed avg) ~42 skills
200 chars ~52 skills
150 chars ~60 skills
130 chars ~67 skills
100 chars ~75 skills

Evidence

Category Count Total Chars Avg Length
Shown skills 42 11,071 264 chars
Hidden skills 21 5,506 262 chars
All skills 63 16,577 263 chars

Critical observation: Hidden skills had nearly identical average description length (262 vs 264 chars). This proves truncation is based on cumulative total, not individual description length.


Solutions

What Works: Description Compression

Until Anthropic implements hidden: true (#11045), the only working solution is to reduce description lengths.

Target: ≤130 characters per description for collections of 60+ skills.

Before (264 chars):

description: "Provide evidence proportional to stakes for all claims.
Use when: making assertions, declaring completion, presenting findings,
reporting conclusions. Never assert without proof. Calibrate depth to
verification level (deep/standard/trust)."

After (128 chars):

description: "Provide evidence for claims proportional to stakes.
Use when: asserting, completing, presenting. Calibrate to stakes."

Why This Works:

63 skills × (130 char desc + 109 overhead) = 15,057 chars
15,057 < 16,000 budget ✅

Strategy by Collection Size:

Skills Strategy
<40 No action needed
40-60 Compress to ~150 chars
60-75 Compress to ≤130 chars
>75 Compress + reduce skill count

What Doesn't Work

Strategy Does It Solve Visibility? Why
CLAUDE.md orchestration ❌ No CLAUDE.md doesn't affect skill budget
Tiered architecture ❌ No Personal + project skills share same budget
defer_loading / Tool Search Tool ❌ No Only applies to tools, not skills
MCP alternatives ❌ No MCP provides tools, not expertise injection
Project-specific loading ⚠️ Partial Only helps if you reduce personal skills
Subagent-exclusive skills ❌ No Not currently possible (see below)

Subagent-Exclusive Skills: Not Possible Today

Subagents CAN specify which skills to load:

---
name: db-admin
description: Database administration tasks
tools: Bash, Read
skills: database-migration, postgres-ops  # Auto-load these skills
---

BUT this is one-way opt-in only:

  • ✅ Subagent can say "load these skills for me"
  • ❌ Skill cannot say "only show me to these agents"
  • All skills have metadata loaded into main agent regardless

Workaround: Embed specialized knowledge directly in the subagent's .md file instead of creating separate skills. Trade-off: Loses skill benefits (progressive disclosure, reusability, composability).

Proposed Features (Not Yet Implemented)

From #11045:

# Hidden skills - don't consume budget until invoked
name: python-engineering:async-debugging
description: Deep async/await debugging patterns
hidden: true  # Proposed, not implemented

# Router priority - checked first during discovery
name: python-engineering
description: Routes to specialized Python skills
router: true  # Proposed, not implemented

Recommendations

For Skill Authors

  1. Keep descriptions ≤130 characters if you have 50+ skills
  2. Front-load trigger keywords in first 50 characters
  3. Move details to SKILL.md body—descriptions are for discovery only

Description Template

description: "[Verb] [domain]. Use when: [trigger1], [trigger2]."

Related GitHub Issues

All issues have been consolidated to #11045.

Skill Budget Issues

Issue Status Key Contribution
#11045 Open - Canonical Proposes hidden: true and router: true flags
#12782 Closed (dup) First budget calculation (~15K chars, ~371 chars/skill)
#13044 Open Reports 60% of skills hidden (36/92)
#13099 Closed (dup) Documentation request (this research)
#13100 Closed (dup) Feature request for configurable budget (this research)

Agent-Scoped Capabilities (Related)

Issue Status Request
#12633 Open main-agent: false - Subagent-exclusive skills
#6915 Open MCP tools only for subagents
#6587 Open Selective MCP access for subagents

Want this fixed? Upvote #11045 (hidden skills) and #12633 (subagent-exclusive skills).

Note: Issue #12836 (Tool Search Tool support) is about tools, not skills. It will not solve the skill visibility problem.


Appendix

Research Method

  1. Observation: Noted "Showing 42 of 63 skills" message in system prompt
  2. Documentation Search: Searched official docs, Anthropic blog, community resources—no documentation found
  3. Empirical Measurement: Extracted descriptions from all 63 SKILL.md files, measured character counts
  4. Calculation: Computed per-skill overhead (~109 chars), deduced budget from observed behavior

Official Limits (Documented)

Limit Value Source
Description max 1,024 chars Claude Code Docs
Skill name max 64 chars Official docs
SKILL.md body ~500 lines (soft) Official docs
Metadata cost ~100 tokens/skill Anthropic Blog
available_skills budget Not documented

Confidence Levels

Finding Confidence Evidence
Budget is ~15,500-16,000 chars HIGH Direct calculation, matches #12782
No official docs exist HIGH Exhaustive search
Compression solves it HIGH Mathematical certainty
defer_loading doesn't help skills HIGH Architectural analysis
130-char target works MEDIUM Calculated, not tested
Truncation order LOW Filesystem-dependent

Open Questions

  1. Can hidden skills be invoked by name? Unknown—if yes, manual invocation could work
  2. Is the budget configurable? No evidence found
  3. Does budget vary by model? Unknown
  4. Will Anthropic implement hidden: true? Proposed in #11045, no timeline

How to Reproduce

  1. Install 60+ skills in ~/.claude/skills/
  2. Start a new Claude Code session
  3. Examine Skill tool for "Showing X of Y" message
  4. Extract descriptions: grep -h "^description:" ~/.claude/skills/*/SKILL.md
  5. Calculate: total_chars + (skill_count × 109)

Limitations

  • Based on single observation (42/63 split)
  • XML overhead estimated from observed format
  • No source code access for verification
  • Filesystem ordering may vary
  • Budget calculation independently verified by #12782

References

Official

GitHub Issues

Community


Research conducted December 4-5, 2025 using Claude Opus 4.5 Findings contributed to #11045 - the canonical issue for this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment