[FEATURE] /pr_comments ranks higher than /commit when typing /com - improve fuzzy matching, enter selects unexpected command and allow disabling built-in commands
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
<img width="537" height="107" alt="Image" src="https://github.com/user-attachments/assets/de6ada93-02af-4d4b-9478-7a1cafc2a17f" />
The fuzzy matching algorithm for slash commands has poor ranking that prioritizes non-prefix matches over prefix matches. For example, typing /comm + Enter now executes /pr_comments instead of /commit even though /commit starts with "com", /pr_comments doesn't, and I have never used /pr_comments.
Note how both /commit and /pr-comment is highlighted by the same color and /commit is first, yet if I press enter it will input /pr-comment which is completely unexpected.
This behavior recently changed and breaks muscle memory. It's caused me to accidentally execute /pr_comments over 5 times when I meant to commit code. The problems:
- Fuzzy matching ranks commands that don't match the prefix above commands that do
- Built-in commands you never use constantly appear in suggestions and can be accidentally executed
- There's no way to disable or hide unwanted built-in commands
- This breaks established muscle memory from when the matching worked correctly
Proposed Solution
- Improve fuzzy matching algorithm: Prioritize prefix matches over substring matches (e.g.,
/comshould always rank/commitabove/pr_comments) - Allow disabling built-in commands: Add ability to hide unwanted built-in commands via settings or permissions
- Implement frecency ranking: Use frequency + recency to learn from actual usage patterns and rank never-used commands lower
Bonus (not mutually exclusive):
- Add visual separation between built-in and custom commands (related to #11330)
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
What happens now (broken):
- Type
/comand press Enter (muscle memory from when this worked) - Autocomplete executes
/pr_comments- a command I have literally never used intentionally - Have accidentally triggered this 5+ times recently
- Breaks workflow and wastes time
What should happen:
- Type
/comand press Enter - Executes
/commit(prefix match + frequently used) - Or if I had disabled
/pr_comments, it wouldn't even appear in suggestions
Additional Context
- This behavior recently changed - it used to work correctly
- Related to #11330 which addresses built-in vs user command prioritization
- This is actively breaking muscle memory and causing accidental command execution
Showing cached comments. Read the full discussion on GitHub ↗
15 Comments
+1. IMHO, first prefix match against an alphabetically sorted list of
/commandsis probably the best option.From ~~#11573~~:
To me the biggest offender is highlighting equally 2 commands, and the one appearing on top not being the one selected.
It is very bad UI design, so easy to fix.
@adriangalilea what version are you on? I can't repro on latest.
version: 2.0.53
Most of the issues have been fixed, and now at least is not confusing as there’s no 2 highlighted items.
But it's mildly frustrating still:
<img width="746" height="176" alt="Image" src="https://github.com/user-attachments/assets/cd8ff7b4-f945-491e-ae17-6d7a033a6694" />
comis typed, the ones starting bycomshould rank first.pr-commentsand I usedcommita million times, so even writingcshould rank it first, but it may be unexpected for some.pr-commentsyou can replace "pr-comments" with "zuselesscrap" in cli.js until it's fixed
I've been trying to remove pr-comments because I have exactly the same /commit command and it happens to me too.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This is still an issue if it's not been addressed by someone at Anthropic.
I'm hitting this issue with /plugin being overshadowed by /plugin-dev:create-plugin from the official claude-code-plugins marketplace.
When I type /plugin:
Pressing Enter executes the wrong command. This is particularly problematic because plugin commands are hiding built-in commands - I can't access the core /plugin management command without arrow-keying past the plugin command.
Exact matches should always rank first, especially for built-in commands.
Recent Regression Reports (Jan 17-18, 2026)
This issue appears to have regressed or worsened significantly. 5+ duplicate reports in the past 48 hours all describing the same symptom:
Visual Recreation
Even typing the complete command
/context+ Enter executes/compact:Root Cause Hypothesis
The selection index operates on the unfiltered command list rather than the filtered results. When you type a prefix, the menu filters correctly but the highlight remains at index N of the original list.
---
Recent Duplicate Reports
| Issue | Date | Platform | Typed | Selected | Version |
|-------|------|----------|-------|----------|---------|
| #17816 | Jan 17 | Windows |
/resu|/o365| v2.1.5 || #18832 | Jan 17 | macOS |
/context|/preflight| — || #18902 | Jan 18 | macOS |
/status|/statusline| v2.1.12 |Key Observations Across Reports
/context)---
This is breaking muscle memory and causing unintended command execution for many users. The volume of recent reports suggests a regression in the v2.1.x release line.
Still an issue... Any resolution incoming? I began seeing this when I added a lot of skills. Probably breaking at a certain limit. Will repro
This is a really frustrating.
This command ranks high in my slash commands and not having the ability to control all of the slash commands that appear on my machine is a pretty poor user experience.
Hoping this is addressed soon.
Adding a small data point in support of the "allow disabling built-in commands" part of this request. I ran into
/stickersunintentionally today, and it opens a page in the browser when invoked. It's a harmless built-in, but it's also one I'll probably never use, and there's no way to remove it from my command surface. Asettings.jsonoption to allow-list or deny-list specific built-in commands would let teams tailor the command namespace to their actual workflow without affecting anyone else. Happy to help test if useful.Adding a concrete data point + arguing for severity re-classification.
Repro on v2.1.148 (100% reproducible)
claude-md-lint)./clean(typo of/clear) and press Enter — no Tab, no menu interaction.claude-md-lintskill is launched as a sidechain agent and runs to completion. No confirmation, no menu, no error.Session JSONL evidence: a user message records the prompt with no
<command-name>block, and the samepromptIdappears on a sidechain agent JSONL whose first line begins withBase directory for this skill: ~/.claude/skills/claude-md-lint. Proves single-hop silent expansion —Enteris both submit and commit; the resolved target is invisible until execution has already started.Why the current "High / productivity" label likely understates this
The mechanism is "Enter on a non-exact slash command silently executes the fuzzy-resolved target." The blast radius of that execution is whatever skill the matcher picks, which is a function of the user's installed skill set — i.e., arbitrary and unbounded by Claude Code's own design.
Skills can, by their normal contract:
None of those side effects can be reasoned about by Claude Code itself, because skills are user-installable. The question "what does
/<typo>do?" has the answer "anything — we cannot say." That is the shape of an arbitrary-action-on-unintended-input bug, which in most CLI tooling is classified as a safety/security issue rather than a productivity one.Why this is not already covered by the closed cousins
/clear. Its blast argument was bounded — losing context. The argument here is unbounded — losing anything the nearest-named skill happens to be authorized to touch.Request
Unknown command: <typed>, or require explicit Tab / Arrow + Enter through the menu to confirm a non-exact target.Environment: claude 2.1.148, Linux WSL2.
+1
I am more interested in disabling some built in commands. Concrete pain point:
/usage-creditssits adjacent to/usagein the picker. Every accidental hit fires "Request sent to your admin to turn on usage credits." Admin on my team is getting spammed with these requests from users who meant to type/usage.