Feature request: SKILL.md paths field should respect .gitignore

Resolved 💬 2 comments Opened Apr 11, 2026 by jiangyuan Closed May 22, 2026

Problem

The paths frontmatter field in SKILL.md uses glob matching to auto-activate a skill when Claude operates on matching files. However, it does not respect .gitignore — a paths: "**" pattern will also match untracked/ignored files (e.g., log/, .DS_Store, build artifacts).

This makes it impossible to write a skill that triggers on "any repo-tracked file change" without also triggering on gitignored files.

Expected behavior

paths glob matching should exclude files matched by .gitignore (and optionally .git/info/exclude), consistent with how tools like rg, fd, and git ls-files behave by default.

Use case

A repository workflow skill (plan-issue-mr-workflow) needs to auto-activate whenever any repo-tracked file is modified, but NOT when operating on gitignored files like logs, build outputs, or local config. Currently the only options are:

  1. paths: "**" — too broad, matches ignored files
  2. Explicitly listing every tracked directory — brittle, requires updating paths whenever the repo structure changes
  3. Omitting paths entirely — loses the deterministic auto-trigger benefit

Proposed solution

When resolving paths globs, filter results through the repository's .gitignore rules (similar to git ls-files --cached --others --exclude-standard). This could be:

  • Default behavior (recommended — matches developer expectations)
  • Opt-in via a flag like paths-respect-gitignore: true

View original on GitHub ↗

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