[Bug] Skill invocation creates duplicate context in memory
Bug Description
Skill invocation creates duplicate context in memory.
Expected: A more efficient solution like
- Pruning the previous context, and then adding the new duplicate context
- Referring back to previous context still in memory
Reproduction Example
invoke search-tool-selection three times
The "search-tool-selection" skill is running
The "search-tool-selection" skill is running
⎿ PostToolUse:Skill says: search-tool-selection invoked
⎿ PostToolUse:Skill says: search-tool-selection invoked
The "search-tool-selection" skill is running
The "search-tool-selection" skill is running
The "search-tool-selection" skill is running
⎿ PostToolUse:Skill says: search-tool-selection invoked
The "search-tool-selection" skill is running
The "search-tool-selection" skill is running
The "search-tool-selection" skill is running
● Done! I've invoked the search-tool-selection skill three times. Each invocation loaded the full skill documentation, which covers:
- Tool strategy - Philosophy of using Grep for content, Glob for files, bash rg only for pipelines
- Decision flow - How to determine search type and apply tool-specific optimizations
- Discovery patterns - How to explore what exists (Phase 1→2→3 workflow)
- Quick decision matrix - Scenario-based tool selection
- Anti-patterns - Common mistakes to avoid
- Performance comparison - Speed and context costs of each tool
The skill uses progressive disclosure - it loads core patterns immediately for simple searches, but automatically loads advanced references when it detects
complex keywords (pipelines, transforms, filters, etc.) or discovery keywords (what commands, how do I find, explore, etc.).
Is there a specific search scenario you'd like help with?
look at your context, is the content related to search-tool-selection in there once or three times
● You're right - the search-tool-selection skill content appears three times in the context. I should have noticed and called this out.
Each time the skill was invoked, the entire YAML documentation was loaded into the conversation context, creating unnecessary duplication. This wastes tokens,
especially since the content is identical across all three invocations.
The efficient approach would have been to invoke the skill once, review the content, and then reference or use that information for subsequent operations
rather than re-invoking it three times.
This is a good reminder about context efficiency - when testing or demonstrating a skill, a single invocation is usually sufficient unless you're testing
different aspects of it or expecting the output to change.
Environment Info
- Platform: darwin
- Terminal: kitty
- Version: 2.0.32
- Feedback ID: b4b80077-f43c-464d-932e-59dec20bac18
Errors
[{"error":"Error\n at ZT (/$bunfs/root/claude:54:1142)\n at <anonymous> (/$bunfs/root/claude:59:9841)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:861:50)\n at processTicksAndRejections (native:7:39)\n at spawnSync (unknown)\n at spawnSync (node:child_process:226:22)\n at Ss (/$bunfs/root/claude:89:1336)\n at SG (/$bunfs/root/claude:89:3474)\n at read (/$bunfs/root/claude:854:3024)\n at request (/$bunfs/root/claude:61:2146)\n at processTicksAndRejections (native:7:39)\n at spawnSync (unknown)\n at spawnSync (node:child_process:226:22)\n at Ss (/$bunfs/root/claude:89:1336)\n at SG (/$bunfs/root/claude:89:3474)\n at read (/$bunfs/root/claude:854:3024)\n at read (/$bunfs/root/claude:854:2152)\n at <anonymous> (/$bunfs/root/claude:3616:5887)\n at L (/$bunfs/root/claude:11:15095)","timestamp":"2025-11-05T16:26:38.986Z"}]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗