[FEATURE] Per-skill lazy/on-demand loading for skills (slash commands)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Problem
Currently, all discovered skills (from ~/.claude/skills/ and .claude/skills/) have their full SKILL.md descriptions loaded into the system prompt at session startup, regardless of whether they are ever invoked. This consumes context window tokens for every skill, even unused ones.
For users with many project-specific skills, the total skill descriptions can exceed the default skillListingBudgetFraction (1%), causing truncation of least-used skills and a warning message every session.
Requested Behavior
Add a setting to enable lazy/on-demand loading for skills, so that only frequently-used skills are pre-loaded at startup, while others load only when explicitly invoked via /skill-name.
Proposed Solution
Proposed Options
- Per-skill toggle: Add a
lazy: truefield in each skill'sSKILL.mdfrontmatter to opt into on-demand loading - Global setting: Add
skillLazyLoading: true(or similar) tosettings.jsonthat applies lazy loading to all non-pinned skills - Budget-based approach: Respect a configurable
skillListingBudgetFractioninsettings.jsonso users can control the token budget for pre-loaded skills
Workarounds
- The only current way to avoid skill pre-loading is
--disable-slash-commands, which disables ALL skills entirely - Alternatively, moving rarely-used skills out of auto-discovered paths works but is inconvenient
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
_No response_
Additional Context
This would be especially valuable for academic/professional projects where multiple specialized skills are defined but only a subset is used per session.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗