Skills loaded twice after context compaction (111 instead of ~63)

Resolved 💬 3 comments Opened Feb 16, 2026 by nachmanmetodi Closed Feb 16, 2026

Description

After context compaction, skills are re-attached to the conversation without deduplication against skills already present. This causes every user skill to appear twice in the system prompt, wasting significant context tokens.

Steps to Reproduce

  1. Have ~50 user skills in ~/.claude/skills/
  2. Have some plugins enabled (adds ~13 more skill entries)
  3. Start a conversation and work until context compaction triggers
  4. Check the system prompt — skills appear in two separate blocks

Evidence

From the VSCode extension debug log:

2026-02-16T00:18:12.811Z [DEBUG] Forked agent [compact] finished: 1 messages
2026-02-16T00:18:17.548Z [DEBUG] Sending 111 skills via attachment (initial, 63 total sent)

The system prompt contains:

  • Block 1: ~50 skills (user + built-in keybindings-help)
  • Plugin skills: ~13 entries
  • Block 2: ~48 skills (same user skills duplicated, minus keybindings-help and create-beads-orchestration)
  • Total: ~111 entries instead of ~63 unique

Expected Behavior

After compaction, skills should be deduplicated — each skill should appear exactly once in the prompt.

Impact

  • ~48 duplicated skill descriptions waste context tokens
  • With 50 skills, roughly 37% of the skills context budget is wasted on duplicates
  • Reduces effective context window for actual work
  • Problem scales linearly with the number of installed skills

Environment

  • Claude Code version: 2.1.42 (VSCode extension)
  • OS: Windows 11
  • Shell: Git Bash
  • Skills: 50 in ~/.claude/skills/, 8 plugins enabled

Workaround

Reducing the number of installed skills minimizes the impact but doesn't fix the root cause.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗