Intermediate8 min

Path-Triggered Skills and Auto-Invocation

The paths field in SKILL.md restricts a skill to activating only when the working directory matches specific glob patterns. This makes skills context-aware — a component-patterns skill fires in src/components/, not globally — without any manual invocation.

Quick Reference

  • paths: accepts a list of glob patterns — skill activates when CWD matches
  • When paths matches, the skill appears at the top of the / menu automatically
  • Combine paths with disable-model-invocation: true for manual-only path-scoped skills
  • Without disable-model-invocation, Claude may auto-invoke path-triggered skills
  • Path-triggered skills execute code unlike .claude/rules/ which load passively
  • Use case: load component standards when in src/components/, not globally
  • Multiple skills can have overlapping paths — all matching skills are surfaced
  • Plugin-namespaced skills use /plugin-name:skill-name to avoid conflicts

What the paths Field Does

The paths field accepts a list of glob patterns. When Claude Code's working directory matches any of the listed patterns, the skill is surfaced in the / menu and becomes a candidate for auto-invocation. When the CWD doesn't match, the skill is hidden.

This skill only appears when CWD is under src/components/ or src/ui/

When you navigate into src/components/ and open the / menu, component-patterns appears at the top. Navigate to src/api/ and it disappears. The skill adapts to where you're working without any configuration per session.