[BUG] paths: frontmatter never triggers skill auto-loading when Claude reads/edits a matching file

Resolved 💬 4 comments Opened May 24, 2026 by Brikas Closed Jul 11, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The paths: field in SKILL.md frontmatter is documented to auto-load a skill when Claude works with matching files. In practice, the trigger never fires — reading or editing a matching file does not cause the skill to load.

This is a separate bug from #49835 (which tracks paths: making skills completely undiscoverable when no description is set). This report is about the trigger mechanism itself being broken even when the skill IS discoverable.

What Should Happen?

A skill with paths: ["**/*.json"] should automatically load its body when Claude reads or edits a .json file. It never does.

Steps to Reproduce

  1. Create .claude/skills/json-helper/SKILL.md:

```yaml
---
name: json-helper
description: JSON helper. ALWAYS invoke when working with JSON files.
paths:

  • "**/*.json"

---
# JSON Helper
SECRET_WORD: PATHS_TRIGGERED
```

  1. Start a session, ask Claude to read any .json file
  2. Observe: skill does not load, SECRET_WORD never appears in context

Evidence

Inspected raw /v1/messages API traffic via mitmproxy. The skill listing in the system-reminder does not change after Claude reads a matching file — no skill body is injected. The trigger produces no observable effect at the API level.

Workaround

The intended behavior can be replicated manually using a PreToolUse hook on Read|Edit:

{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Read|Edit",
      "hooks": [{
        "type": "command",
        "command": "python .claude/hooks/path_skill_loader.py"
      }]
    }]
  }
}

Where the script checks tool_input.file_path against glob patterns and returns hookSpecificOutput.additionalContext with the skill body if matched. This works reliably — paths: does not.

Is this a regression?

I don't know

Claude Code Version

2.1.150 (Claude Code)

Platform

Anthropic API

Operating System

Windows 10

Terminal/Shell

VSCode Extension

Additional Information

  • Model: claude-sonnet-4-6
  • Related: #49835 (paths: + no description = skill completely absent from listing)
  • Also confirmed on Windows: skill with only paths: and no description is entirely absent from the model's skill listing at the API level (not even listed by name)

View original on GitHub ↗

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