[Bug] Project skills loading full files instead of frontmatter during discovery phase
Bug Description
Subject: Skill token consumption discrepancy - Full files loaded instead of frontmatter only
Issue Description:
Project skills are consuming significantly more tokens than documented. According to the official documentation, only the frontmatter (name and description) should be loaded during the discovery phase, with full SKILL.md files loaded only when a skill is invoked. However, I'm observing that entire skill files are being loaded into context at conversation startup.
Documented Behavior:
- Discovery phase: "Claude loads only the name and description of each available Skill"
- Full SKILL.md loaded only during Activation phase (when skill is invoked)
- Source: Official Claude Code skills documentation
Actual Observed Behavior:
Skills consuming tokens without being invoked:
- go-crud-tests: 571 lines → 3.9k tokens (frontmatter is only 8 lines)
- go-crud-handler: ~490 lines → 3.1k tokens
- go-crud-storage: ~560 lines → 3.1k tokens
- go-crud-model: ~365 lines → 2.4k tokens
- go-crud-usecase: ~345 lines → 2.2k tokens
- go-crud-migration: ~275 lines → 2.1k tokens
Total: 17.8k tokens consumed at conversation start for skills that haven't been invoked.
Expected Behavior:
If only frontmatter were loaded, these 6 skills should consume approximately 200-400 tokens total (not 17.8k).
Example Skill Structure:
Lines 1-8: Frontmatter (YAML between ---)
Lines 9-571: Detailed documentation and examples
Impact:
- ~18k tokens consumed per conversation for unused skills
- Reduces available context window significantly
- Contradicts documented behavior
Questions:
- Is this the intended behavior, and if so, should the documentation be updated?
- If this is a bug, can skill loading be optimized to match documented behavior?
- Are there workarounds to reduce token consumption for project skills?
Environment:
- Claude Code CLI (latest version)
- macOS (Darwin 25.1.0)
- Model: claude-sonnet-4-5-20250929
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 2.0.76
- Feedback ID: 843cee0e-9b7a-4377-a32e-e1d77cace68a
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗