[FEATURE] Improve Matching Commands - Exact Match, Then Name Fuzzy, then Description Fuzzy
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
When working with Claude Code, I often invoke commands using /some-command, but I find that its selection logic is inconsistent and leads to invocation of the wrong command. For example, we have the built-in /clear command. I also have defined a /clean-code-organization command that includes the word clear in the description.
When I type /clear, that's an exact match of a command name and should be what's "selected" (ie, I type /clear and hit enter, an exact match should be executed). Instead, Claude has highlighted and chosen the /clean-code-organization command.
This has forced me to rename commands to avoid any potential overlap.
Proposed Solution
I believe this can be resolved first checking to see if the input is an exact match, and if not, selecting the first/best result by name, and if none exists, then selecting first/best by description.
Alternative Solutions
None
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
- I'm working in any app.
- I need to clear context.
- I type /clear
- The context actually clears.
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗