claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Slash command autocomplete highlights wrong item that doesn't match search query

Open MagicTurtle-s opened this issue 10 months ago • 3 comments

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

  1. Start Claude Code CLI
  2. Type /resu (partial match for /resume)
  3. Observe the autocomplete dropdown

Expected Behavior

  • The dropdown should highlight /resume since it matches the search query "resu"
  • Or only show filtered results that match the query

Actual Behavior

  • /o365 is 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

autocomplete-bug

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.

MagicTurtle-s avatar Jan 13 '26 02:01 MagicTurtle-s

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 → /ralph highlighted 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 statusLine config
  • Disabled claude-hud plugin
  • 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.

Kari-Basavaraj avatar Jan 17 '26 10:01 Kari-Basavaraj

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.

rywmark avatar Feb 17 '26 04:02 rywmark

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!

bpasero-ant avatar Nov 29 '26 18:11 bpasero-ant