Slash command autocomplete highlights wrong item that doesn't match search query
Description
When typing a slash command in the CLI, the autocomplete dropdown highlights the wrong item. The highlighted item doesn't match the search query.
Steps to Reproduce
- Start Claude Code CLI
- Type
/resu(partial match for/resume) - Observe the autocomplete dropdown
Expected Behavior
- The dropdown should highlight
/resumesince it matches the search query "resu" - Or only show filtered results that match the query
Actual Behavior
/o365is highlighted at the top even though it contains none of the characters from "resu"- The highlighting appears to default to the first item in the unfiltered list rather than the first matching item
Screenshot
Environment
- Claude Code v2.1.5
- Opus 4.5
- Windows
Additional Context
The filtering logic may be working (various commands are shown), but the selection/highlight logic seems to be operating on the original unfiltered list index rather than the filtered results.
Additional Reproduction Details
I'm experiencing this same issue on v2.1.11.
My observations:
- Typed
/exit→/ralph(4th item) was highlighted instead of/exit(1st match) - Typed
/ex→/ralphhighlighted instead of/excalidraw - The filtering appears to work (matching commands shown), but selection indicator is offset
Environment:
- Claude Code: 2.1.11
- macOS: Darwin 25.0.0 (arm64)
- Terminal: Ghostty 1.2.3, Terminal.app (both affected)
- Shell: zsh
Troubleshooting attempted (none resolved):
- Disabled
statusLineconfig - Disabled
claude-hudplugin - Removed all hooks from settings.json
- Configured Ghostty with
shell-integration-features = no-cursor
This issue may be related to other TUI rendering bugs I'm experiencing:
- #18493 (resize content loss)
- #18716 (/context disappears)
- #18797 (cursor blinks below status bar)
Possibly a common root cause in the TUI rendering layer.
This may share a root cause with #19107. We reproduced the filtering bug on macOS with Ghostty and found it's terminal-specific and triggered by skill count. With 494 valid skills loaded, autocomplete filtering breaks in Ghostty (~85 skill threshold) but works fine in Terminal.app. See https://github.com/anthropics/claude-code/issues/19107#issuecomment-3912142393 for full details.
This was fixed in Claude Code 2.1.83, so we're closing this issue. If you disagree, let us know here and we can re-open it. Thanks for reporting!