anthropics / anthropics/claude-code
Slash command autocomplete can select the wrong command after fast typing
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
## Description
When typing a slash command quickly and pressing Enter before the autocomplete list finishes filtering, the wrong command can be inserted or executed.
## Steps to reproduce
1. Open the prompt in the terminal UI.
2. Type `/co` and immediately press Enter while the suggestion list is still updating.
3. Observe that a command other than the intended one is selected.
## Expected behavior
Enter should run the command matching the current input, or wait until the suggestion list has settled before accepting a selection.
## Actual behavior
The stale suggestion is accepted and the wrong command runs.
## Environment
- Claude Code: latest
- OS: Linux
- Terminal: any
## Notes
Likely a race between the debounced filter and the key handler. A small guard that ignores Enter until the list matches the current input would fix it.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in the terminal UI code for slash-command autocomplete, tracing the debounced filtering and the Enter key handler described in the issue. Reproduce by typing /co and pressing Enter immediately; done means Enter no longer accepts a stale suggestion and runs the command matching the current input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100