claude-code - 💡(How to fix) Fix [BUG] Slash command autocomplete should prioritize built-in commands over skills with the same prefix

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…

Error Message

Error Messages/Logs

Fix Action

Fix / Workaround

Current Workaround

  • #11431/pr_comments ranks higher than /commit when typing /com: same underlying problem
  • #37278 (closed) — Proposed sort by frequency → user-defined → built-ins, but never implemented
  • #41088 (closed) — Proposed configurable slash command priority/ordering
  • #62409 — Plugin skill shadows built-in /release-notes (dispatch resolution issue)
  • #62500 — Plugin skill shadows built-in /doctor
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

Slash Command Autocomplete Priority Issue

Problem

After installing a skill (e.g., nature-polishing), the slash autocomplete list becomes polluted with skill entries that disrupt the user's muscle memory for built-in commands.

Concrete example:

  • The skill nature-polishing starts with na
  • The built-in command /new (displayed as /clear (new)) starts with ne

Since autocomplete is purely alphabetically sorted, typing /n shows nature-polishing first, before /new.

Consequences:

  1. The user has to type more characters (/ne instead of /n) to reach the built-in command they want
  2. Muscle memory for common command prefixes is broken every time a new skill is installed
  3. Accidentally pressing Enter on the wrong entry invokes the skill instead of the intended built-in command, wasting API credits / response tokens

General priority rule:

Built-in commands > User-defined slash commands > Plugin/User skills

This ensures that installing a skill never degrades the user's ability to quickly access built-in functionality.

Current Workaround

Rename the skill directory to add a prefix that sorts after built-in commands (e.g., z-nature-polishing), which is not user-friendly and shouldn't be necessary.

Related Issues

  • #11431/pr_comments ranks higher than /commit when typing /com: same underlying problem
  • #37278 (closed) — Proposed sort by frequency → user-defined → built-ins, but never implemented
  • #41088 (closed) — Proposed configurable slash command priority/ordering
  • #62409 — Plugin skill shadows built-in /release-notes (dispatch resolution issue)
  • #62500 — Plugin skill shadows built-in /doctor

Suggested Fix

Change the autocomplete sort logic so that when a built-in command and a skill both match the typed prefix, built-in commands are always ranked first.

Ideal ordering:

  1. Built-in commands (prefix match)
  2. User-defined slash commands (~/.claude/commands/)
  3. User skills (~/.claude/skills/)
  4. Plugin skills

This is a simple sort policy change that would have an outsized positive impact on daily UX for users with installed skills.

What Should Happen?

Built-in commands should be prioritized above skills in the slash autocomplete list when both share the same prefix.

Reasonable sorting order:

  1. Exact prefix match on built-in commands — highest priority (current behavior for these individually is fine)
  2. Built-in commands should rank above skills when both match the same prefix

Error Messages/Logs

Steps to Reproduce

  1. Install a skill whose name starts with na (e.g., nature-polishing).
  2. Type /n in the chat input box to trigger slash command autocomplete.
  3. Observe the sorting order in the autocomplete list:
    • Expected behavior: Built-in command /new (displayed as /clear (new)) should appear at the top.
    • Actual behavior: The skill nature-polishing appears before /new due to alphabetical sorting.
  4. Type /ne and verify that /new now appears as expected.
  5. (Optional) Press Enter to execute the first item in the autocomplete list (i.e., nature-polishing), and confirm that the skill is incorrectly invoked instead of the built-in /new command.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.141

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

<img width="1647" height="228" alt="Image" src="https://github.com/user-attachments/assets/578e970e-cff2-497b-a2d9-3ff6b2c2e728" />

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 [BUG] Slash command autocomplete should prioritize built-in commands over skills with the same prefix