C:/Program Files/Git/context Command Shows Non-Skills as Skills + Cross-Project Skill Pollution
Bug Report: /context Command Shows Non-Skills as Skills + Cross-Project Skill Pollution
Preflight Checklist
- [x] I have searched the issue tracker and this appears to be a new issue
- [x] This is a single bug report (not multiple issues combined)
- [x] I am using the latest version of Claude Code
---
What's Wrong?
The /context command in Claude Code for VS Code reveals two related issues with skill discovery and context loading:
Issue 1: Non-Skill Files Being Reported as Skills
The /context command lists files as "skills" that are not registered in any skill directory (~/.claude/skills/ or .claude/skills/). These are ordinary markdown files in project directories that happen to follow certain naming patterns.
Example from /context output:
| Skill | Source | Tokens |
|----------------------------------|---------|--------|
| BMad:agents:analyst | Project | 1.5k |
| BMad:bmm:workflows:architecture | Project | 172 |
| BMad:bmm:workflows:dev-story | Project | 171 |
These files exist at paths like:
project-root/framework/agents/analyst.mdproject-root/framework/workflows/architecture.md
They are NOT in .claude/skills/ - they're just markdown files in a framework directory. Claude Code appears to be auto-discovering them based on directory naming patterns (agents/, workflows/) rather than proper skill registration.
Issue 2: Cross-Project Skill Pollution
Files from one project appear as "Project" skills when working in completely unrelated projects:
Scenario:
- Project A contains a skill development directory at
project-a/skills/my-skill/(NOT in.claude/skills/) - Project B is a completely separate repository with no relation to Project A
- When running
/contextin Project B,my-skillappears as a "Project" skill
Example: A project-specific git automation skill registered in Project A's .claude/skills/ directory appears when working in Project B, which has no such skill configured.
This suggests either:
- Skill discovery is scanning parent directories or sibling projects incorrectly
- Skills are being cached globally and not properly scoped to their source project
- The
/contextcommand itself has a bug in how it reports skill sources
---
What Should Happen?
- Explicit Skill Registration Only: Only files in designated skill directories (
~/.claude/skills/or.claude/skills/) should be treated as skills. Arbitrary markdown files in other directories (even if they're in folders namedagents/orworkflows/) should NOT be auto-discovered as skills.
- Proper Project Scope Isolation: Project-scoped skills (in
.claude/skills/) should only be visible within their source project directory, not across unrelated projects.
- Accurate
/contextReporting: The/contextcommand should accurately reflect what is actually loaded as skills, matching the documented skill discovery locations.
---
Steps to Reproduce
Setup
- Have skills installed in
~/.claude/skills/(User scope) - Have a project with markdown files in directories named
agents/orworkflows/(NOT in.claude/skills/) - Have another separate project with its own
.claude/skills/directory containing project-specific skills
Reproduction Steps
For Issue 1 (Non-skill files reported as skills):
- Open Claude Code in VS Code in a project that has markdown files in directories like
framework/agents/orframework/workflows/ - Ensure these directories are NOT inside
.claude/skills/ - Run the
/contextcommand - Observe the "Skills" section - files from those directories appear as "Project" skills
For Issue 2 (Cross-project pollution):
- Open Claude Code in VS Code in Project B (which has no
.claude/skills/directory) - Run the
/contextcommand - Observe skills from Project A appearing as "Project" scope, even though you're in Project B
Expected Output
| Skill | Source | Tokens |
|-----------------|---------|--------|
| user-skill-a | User | xxx |
| user-skill-b | User | xxx |
(Only skills from ~/.claude/skills/ should appear when the current project has no .claude/skills/ directory)
Actual Output
| Skill | Source | Tokens |
|----------------------------|---------|--------|
| user-skill-a | User | xxx |
| Framework:agents:analyst | Project | 1.5k | ← Not a registered skill
| Framework:workflows:task | Project | 172 | ← Not a registered skill
| other-project-skill | Project | 3.3k | ← From different project
---
Is This a Regression?
Unknown - I don't have baseline data from earlier versions to compare.
---
Environment
- Claude Code CLI Version: 2.0.67 (output of
claude --version) - Claude Code VS Code Extension Version: 2.0.75
- Platform: Anthropic API
- Operating System: Windows 11
- Terminal/Shell: VS Code integrated terminal (PowerShell/Git Bash)
- IDE: VS Code with Claude Code extension
---
Impact
The /context output in my case shows 101 "skills" loaded, but the majority of these are NOT actually registered skills - they're framework files being incorrectly discovered.
Potential impacts:
- If these files are actually being loaded into context (not just reported incorrectly), this wastes significant context budget
- Cross-project skill pollution could cause unexpected behavior or skill invocations
- Makes it difficult to understand what's actually loaded and debug context issues
- Undermines trust in the
/contextdiagnostic command
---
Additional Context
Directory Structure (Sanitized)
~/.claude/skills/
├── skill-a/ # User skill - EXPECTED to load
├── skill-b/ # User skill - EXPECTED to load
└── skill-c/ # User skill - EXPECTED to load
~/projects/project-alpha/
├── .claude/skills/
│ └── project-specific-skill/ # Should ONLY load in project-alpha
└── other-files/
~/projects/project-beta/ # Current working directory
├── .claude/ # Has .claude dir but NO skills subdirectory
│ └── settings.local.json
├── framework/
│ ├── agents/ # NOT a skill directory
│ │ └── agent-role.md # Being reported as skill (BUG)
│ └── workflows/ # NOT a skill directory
│ └── workflow-name.md # Being reported as skill (BUG)
└── (no .claude/skills/ directory)
When working in project-beta, /context shows:
- User skills from
~/.claude/skills/(expected) project-specific-skillfromproject-alphaas "Project" scope (BUG - wrong project)agent-role.mdandworkflow-name.mdas "Project" skills (BUG - not registered skills)
---
Questions for Clarification
- Is the
/contextoutput showing actual tokens loaded, or is it a reporting bug where these files aren't actually loaded? - What mechanism is discovering non-skill-directory files as skills? Is there undocumented auto-discovery based on directory names?
- Is cross-project skill visibility intentional for some use case, or is this a scoping bug?
- Are skills being cached somewhere that persists across projects?
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗