Duplicate skills in /context when multiple CLAUDE.md files resolve to the same .claude/skills/ directory

Resolved 💬 3 comments Opened Apr 12, 2026 by Royaleint Closed Apr 15, 2026

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

  1. Open Claude Code with the working directory set to C:\Projects\BawrLabs
  2. Run /context
  3. 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

View original on GitHub ↗

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