Feature Request: Deferred Loading for Skills (SkillSearch, like ToolSearch)
Summary
ToolSearch successfully defers MCP tool definitions until needed. The same pattern should be applied to Skills, which currently load all descriptions into every session's system prompt.
Problem
With 50+ skills (project + personal + plugin), the system prompt includes ~5,000–8,000 tokens of skill descriptions in every session, even when no skill is invoked. This is ~3-4% of the context window consumed before the conversation starts.
Real-world breakdown from my setup:
| Source | Skills | SKILL.md Size |
|--------|--------|---------------|
| Project (.claude/skills/) | 20 | ~114 KB |
| Personal (~/.claude/skills/) | 16 | ~69 KB |
| Plugins | ~16 | ~100 KB |
| Total | ~52 | ~283 KB |
While full SKILL.md content is already deferred (Tier 2/3), the Tier 1 descriptions for 52 skills still consume significant prompt space.
Proposed Solution
Implement a SkillSearch tool following the ToolSearch pattern:
Current (always loaded):
- commit: Create git commits in Conventional Commits format. Used when creating or proposing commits.
Generates commit messages in type(scope): subject format.
- pdf-to-markdown: Convert PDF files to Markdown. Extracts text, tables, and figure descriptions...
- openspec-new-change: Start a new OpenSpec change using the experimental artifact workflow...
- generate-docs: Analyze repositories and auto-generate documentation for API/batch/screen/model...
- code-review: Perform code reviews following engineering practices...
[...50+ more entries with full descriptions]
Proposed (deferred):
Available skills (use SkillSearch to discover):
commit, pdf-to-markdown, openspec-new-change, generate-docs, code-review, ...
Available deferred skills (must be loaded before use):
SkillSearch("keyword") to find and load skill definitions on demand.
Implementation Options
- SkillSearch tool — New tool parallel to ToolSearch. Claude searches by keyword, gets skill description + metadata, then invokes via Skill tool.
- Extend ToolSearch — Add skills as a searchable category within the existing ToolSearch tool.
skillSearchThresholdsetting — Similar totoolSearchThreshold, auto-defer when skill count exceeds N (e.g., 10).
Why This Matters More Now
- The plugin ecosystem is growing — each plugin can add multiple skills
- Power users accumulate project + personal + plugin skills quickly
- Unlike MCP tools (which may never be used), skills are always listed in the system prompt
- The precedent is already set with ToolSearch — this is a natural extension
Prior Art
- Issue #19445 proposed this but was closed as stale (Feb 2026)
- ToolSearch proves the pattern works well in production
- The three-tier skill loading (metadata → instructions → resources) already partially implements this — just need to defer Tier 1 as well
---
Submitted via Claude Code
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗