claude-code - 💡(How to fix) Fix Add auto_invoke flag for skills to prevent eager pattern matching [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46383Fetched 2026-04-11 06:21:44
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1

Root Cause

Teams build specialized skills (CI runners, code review tools, deployment helpers) whose descriptions naturally overlap with common user requests. Without this flag, users get interrupted by false-positive skill matches and have to either deny the prompt or add "don't use X" disclaimers to every message. This is especially frustrating for skills that launch expensive subagents or run external tools before the user can intervene.

Code Example

---
description: Run pr code review (local diff or remote PR)...
auto_invoke: false
---
RAW_BUFFERClick to expand / collapse

Problem

Skills with descriptions that match common natural language patterns get auto-invoked when users don't intend to use them. For example, a skill called pr-review with a description mentioning "code review" and "remote PR" gets triggered whenever a user says "review this PR" — even when they just want Claude to read the diff directly.

There's no way to prevent this without:

  • The user explicitly saying "don't use pr-review" in every message
  • The user denying the permission prompt each time it fires
  • Making the skill description less accurate (counterproductive)

The root cause is that Claude pattern-matches the skill description (not the skill name) against natural language in user messages. Any skill whose description overlaps with common phrasing will false-positive.

Proposed Solution

Add an auto_invoke: false frontmatter flag (or similar, e.g. user_invocable: explicit) to SKILL.md files. When set:

  • The skill would only be invoked via explicit /skill-name syntax
  • It would not be pattern-matched against natural language in user messages
  • The skill would still appear in /help or skill listings so users know it exists

Example

---
description: Run pr code review (local diff or remote PR)...
auto_invoke: false
---

With this flag, saying "review this PR" would NOT trigger the skill, but /pr-review pr 34714 still would.

Why This Matters

Teams build specialized skills (CI runners, code review tools, deployment helpers) whose descriptions naturally overlap with common user requests. Without this flag, users get interrupted by false-positive skill matches and have to either deny the prompt or add "don't use X" disclaimers to every message. This is especially frustrating for skills that launch expensive subagents or run external tools before the user can intervene.

extent analysis

TL;DR

Adding an auto_invoke: false flag to a skill's frontmatter can prevent false-positive invocations by disabling natural language pattern matching.

Guidance

  • To prevent skills from being auto-invoked due to description overlaps, consider adding the proposed auto_invoke: false flag to the skill's frontmatter.
  • Verify that the skill is no longer triggered by natural language phrases by testing with example user messages.
  • Ensure that the skill can still be invoked explicitly using the /skill-name syntax.
  • Review skill descriptions for potential overlaps with common user requests to identify candidates for the auto_invoke: false flag.

Example

---
description: Run pr code review (local diff or remote PR)...
auto_invoke: false
---

This example demonstrates how to add the auto_invoke: false flag to a skill's frontmatter to prevent false-positive invocations.

Notes

The proposed solution relies on the addition of a new frontmatter flag, which may require updates to the underlying platform or framework. Additionally, the effectiveness of this solution depends on the accuracy of the skill descriptions and the user's intent.

Recommendation

Apply the workaround by adding the auto_invoke: false flag to skills with descriptions that overlap with common user requests, as this provides a targeted solution to prevent false-positive invocations without modifying the skill's functionality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Add auto_invoke flag for skills to prevent eager pattern matching [1 comments, 2 participants]