claude-code - 💡(How to fix) Fix Custom slash commands in .claude/commands/ hijacked by built-in skill matcher [1 participants]

Official PRs (…)
ON THIS PAGE

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#54633Fetched 2026-04-30 06:40:16
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3referenced ×1

Custom slash commands defined in .claude/commands/ are silently intercepted and replaced by built-in skills instead of loading the command file.

Error Message

Custom slash commands are unusable when their name or content fuzzy-matches a built-in skill trigger. There is no error or warning — the wrong skill silently runs instead.

Root Cause

Custom slash commands defined in .claude/commands/ are silently intercepted and replaced by built-in skills instead of loading the command file.

Code Example

Execute the following bash command and show the output:
   python3 transit_finder.py --lat 50.23 --lon 8.62 --radius 30 --name "Bad Homburg" --days 7
RAW_BUFFERClick to expand / collapse

Summary

Custom slash commands defined in .claude/commands/ are silently intercepted and replaced by built-in skills instead of loading the command file.

Version

Claude Code 2.1.116

Steps to reproduce

  1. Create .claude/commands/run.md with the following content:
    Execute the following bash command and show the output:
    python3 transit_finder.py --lat 50.23 --lon 8.62 --radius 30 --name "Bad Homburg" --days 7
  2. Type /run in a Claude Code session in that project.

Expected: Claude loads run.md and executes the command.
Actual: The /loop skill is invoked instead (as shown by <command-name>/loop</command-name> in the harness output).

Additional observations

  • Renaming the file to transit.md and typing /transit triggered /fewer-permission-prompts on some invocations and /loop on others — neither is the custom command.
  • The <command-name> tag in the conversation is set to the matched skill name, not the custom command name, which indicates the interception happens at the harness level before the file content is read.
  • The command file content was varied across attempts (different phrasing, neutral language, !-prefixed command) — the name alone appears to be sufficient to trigger the mismatch.

Impact

Custom slash commands are unusable when their name or content fuzzy-matches a built-in skill trigger. There is no error or warning — the wrong skill silently runs instead.

extent analysis

TL;DR

Renaming custom command files to avoid naming conflicts with built-in skills may resolve the issue.

Guidance

  • Verify that the custom command name does not match or closely resemble any built-in skill trigger to prevent interception.
  • Test with a unique and distinct name for the custom command file, such as custom_transit.md, to see if the issue persists.
  • Check the harness output for the <command-name> tag to confirm whether the custom command or a built-in skill is being invoked.
  • Consider reviewing the documentation for built-in skills and their triggers to avoid potential naming conflicts.

Example

No code snippet is provided as the issue is related to command naming and not code syntax.

Notes

The solution may not be foolproof, as the issue seems to be related to a fuzzy-matching mechanism that triggers built-in skills based on command names. Further investigation into the harness and skill trigger mechanisms may be necessary for a more robust fix.

Recommendation

Apply workaround: Rename custom command files to avoid naming conflicts with built-in skills, as this is the most straightforward and least invasive solution given the current information.

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 Custom slash commands in .claude/commands/ hijacked by built-in skill matcher [1 participants]