Duplicate skills in /context when multiple CLAUDE.md files resolve to the same .claude/skills/ directory
Description
When a project uses @ imports in CLAUDE.md to create a multi-file instruction chain, and multiple files in that chain cause the skill scanner to walk the same .claude/skills/ directory, the skill appears multiple times in /context output.
Reproduction
Directory structure
C:\Projects\
├── CLAUDE.md # root — imports both children
├── BawrLabs\
│ ├── CLAUDE.md # studio instructions
│ └── .claude\skills\startup\SKILL.md # one physical skill file
└── Homestead\
├── CLAUDE.md # imports Home_Dev + BawrLabs
└── Home_Dev\
└── CLAUDE.md # project-level dev instructions
Import chain
C:\Projects\CLAUDE.md
├── @./BawrLabs/CLAUDE.md ← first time BawrLabs is in scope
└── @./Homestead/CLAUDE.md
├── @Home_Dev/CLAUDE.md
└── @../BawrLabs/CLAUDE.md ← second time BawrLabs is in scope
Steps
- Open Claude Code with the working directory set to
C:\Projects\BawrLabs - Run
/context - Observe the Skills section:
Skills · /skills
Project
└ wow-addon-dev: 91 tokens
└ end-session: 7 tokens
└ startup: 6 tokens ← duplicate
└ startup: 6 tokens ← duplicate
└ gate2-prep: 6 tokens
There is only one physical startup/SKILL.md on disk (in BawrLabs/.claude/skills/startup/). There is no .claude/skills/ directory in the Homestead repo at all.
Expected behavior
The skill scanner should deduplicate by resolved file path (or skill directory path). Each unique SKILL.md should appear exactly once in /context, regardless of how many times its parent directory is reachable through @ import chains.
Actual behavior
The same skill appears twice — once for each CLAUDE.md file that brings BawrLabs/ into scope.
Environment
- Claude Code CLI on Windows 11 (10.0.26200)
- Shell: bash
- Model: claude-opus-4-6 (1M context)
Notes
- The duplicate is cosmetic — invoking the skill works fine and runs the single physical file
- Both entries show identical token counts (6 tokens) and identical descriptions ("Studio Startup")
- The same issue could affect any skill in a
.claude/skills/directory that is reachable through multiple@import paths
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗