Feature: Deferred skill discovery to reduce context window overhead
Problem
Every message in a Claude Code session includes the full skill catalog in <system-reminder> blocks. With plugins and custom commands, this can be 50-100+ skill entries injected into every single message — consuming ~4-5K tokens of context window per message that could be used for actual conversation.
This causes noticeably faster context compaction, especially in sessions with heavy tool use (where system-reminders are injected frequently). Users lose chat history much sooner than expected.
Current behavior
User message arrives
→ Platform injects ALL skill names + descriptions into system-reminder
→ Agent scans full list to find relevant skills
→ Agent invokes Skill tool for the 1-2 that match
→ 98% of the injected skill catalog was wasted context
Proposed behavior
Deferred skill loading, similar to how ToolSearch works for deferred tools:
- Per-message injection: Only skill names (no descriptions) — or better, nothing at all
- On-demand discovery: A
SkillSearchmechanism (or extendToolSearch) that takes a query and returns matching skill names + descriptions - Invocation:
Skilltool works exactly as today — invoke by name, content loads on demand
User message arrives
→ Lightweight skill index (names only, ~500 bytes) or nothing
→ Agent uses SkillSearch("building UI components") → returns "frontend-design"
→ Agent invokes Skill tool as today
→ 95% context savings
Impact
- Context window: ~4-5K tokens saved per message (50-100 skills × ~50 tokens each)
- Session longevity: Significantly longer conversations before compaction
- Scalability: Plugin ecosystem can grow without degrading session quality
- No functionality loss: All skills remain available, just discovered on-demand
Environment
- Windows 11, Claude Code CLI + Desktop
- 7 plugins enabled (superpowers, frontend-design, code-simplifier, typescript-lsp, pyright-lsp, accesslint, accessibility-agents)
- 26 custom commands
- Total: ~70+ skills injected per message
Workaround
Currently none — disabling plugins removes both the catalog AND the ability to invoke those skills. They're coupled.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗