[BUG] Slash command autocomplete should prioritize built-in commands over skills with the same prefix
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] 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-polishingstarts withna - The built-in command
/new(displayed as/clear (new)) starts withne
Since autocomplete is purely alphabetically sorted, typing /n shows nature-polishing first, before /new.
Consequences:
- The user has to type more characters (
/neinstead of/n) to reach the built-in command they want - Muscle memory for common command prefixes is broken every time a new skill is installed
- 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_commentsranks higher than/commitwhen 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:
- Built-in commands (prefix match)
- User-defined slash commands (
~/.claude/commands/) - User skills (
~/.claude/skills/) - 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:
- Exact prefix match on built-in commands — highest priority (current behavior for these individually is fine)
- Built-in commands should rank above skills when both match the same prefix
Error Messages/Logs
Steps to Reproduce
- Install a skill whose name starts with
na(e.g.,nature-polishing). - Type
/nin the chat input box to trigger slash command autocomplete. - 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-polishingappears before/newdue to alphabetical sorting.
- Type
/neand verify that/newnow appears as expected. - (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" />
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗