[BUG] Slash command autocomplete should prioritize built-in commands over skills with the same prefix

Resolved 💬 1 comment Opened May 31, 2026 by SunYanbox Closed Jun 1, 2026

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-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.
  1. Type /ne and verify that /new now appears as expected.
  2. (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" />

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗