C:/Program Files/Git/context Command Shows Non-Skills as Skills + Cross-Project Skill Pollution

Resolved 💬 3 comments Opened Dec 23, 2025 by DAESA24 Closed Feb 14, 2026

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.md
  • project-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 /context in Project B, my-skill appears 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:

  1. Skill discovery is scanning parent directories or sibling projects incorrectly
  2. Skills are being cached globally and not properly scoped to their source project
  3. The /context command itself has a bug in how it reports skill sources

---

What Should Happen?

  1. 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 named agents/ or workflows/) should NOT be auto-discovered as skills.
  1. Proper Project Scope Isolation: Project-scoped skills (in .claude/skills/) should only be visible within their source project directory, not across unrelated projects.
  1. Accurate /context Reporting: The /context command should accurately reflect what is actually loaded as skills, matching the documented skill discovery locations.

---

Steps to Reproduce

Setup

  1. Have skills installed in ~/.claude/skills/ (User scope)
  2. Have a project with markdown files in directories named agents/ or workflows/ (NOT in .claude/skills/)
  3. 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):

  1. Open Claude Code in VS Code in a project that has markdown files in directories like framework/agents/ or framework/workflows/
  2. Ensure these directories are NOT inside .claude/skills/
  3. Run the /context command
  4. Observe the "Skills" section - files from those directories appear as "Project" skills

For Issue 2 (Cross-project pollution):

  1. Open Claude Code in VS Code in Project B (which has no .claude/skills/ directory)
  2. Run the /context command
  3. 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 /context diagnostic 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-skill from project-alpha as "Project" scope (BUG - wrong project)
  • agent-role.md and workflow-name.md as "Project" skills (BUG - not registered skills)

---

Questions for Clarification

  1. Is the /context output showing actual tokens loaded, or is it a reporting bug where these files aren't actually loaded?
  2. What mechanism is discovering non-skill-directory files as skills? Is there undocumented auto-discovery based on directory names?
  3. Is cross-project skill visibility intentional for some use case, or is this a scoping bug?
  4. Are skills being cached somewhere that persists across projects?

View original on GitHub ↗

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