[BUG] Command completion selects second item instead of exact match

Resolved 💬 3 comments Opened Jan 17, 2026 by JHaugaard Closed Jan 21, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Description:
When typing a slash command that exactly matches an option in the completion list, the selection defaults to the second item instead of the first (exact match).

Steps to Reproduce:

  1. Start typing /clear in the CLI
  2. Immediately / command choices appear, intially they all look to be custom slash commands. The first on the list is highlighted, in this case “/session-end”
  3. As I type / -> c the custom commands matching that patter appear at the top of the list and “/session-end” moved down the list, but still highlighted blue and so selected.
  4. By the time I get to /–> c –> l – > e –> a –> r in the typing /clear is at the top and /session-end is in the second spot, but still blue and selected
  5. So even though my deisred command has been typed in full the second on the list remains selected, and whe I Press Enter to confirm the /session-end command is entered.

Actual Behavior:
The second item in the completion list is selected/executed instead of the exact match.

Workaround:
Adding a space after the command (e.g., /clear ) executes correctly.

Environment:

  • OS: macOS (Darwin 25.2.0)
  • Claude Code version: 2.1.12

What Should Happen?

Expected Behavior:
The exact match (/clear) should be selected and executed.

Error Messages/Logs

none

Steps to Reproduce

  1. Start typing /clear in the CLI
  2. Immediately / command choices appear, intially they all look to be custom slash commands. The first on the list is highlighted, in this case “/session-end”
  3. As I type / -> c the custom commands matching that patter appear at the top of the list and “/session-end” moved down the list, but still highlighted blue and so selected.
  4. By the time I get to /–> c –> l – > e –> a –> r in the typing /clear is at the top and /session-end is in the second spot, but still blue and selected

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.12

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗