[BUG] slash command auto-complete is broken (highlighted command doesn't match what I'm typing)

Status Fixed / completed
Maintainer reply None cached
Activity 13 comments · opened Jan 17, 2026 · closed Aug 19, 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?

I open a vanilla terminal on a MacBook Pro OSX 15.6.1
I start typing /context but the auto-complete jumps to "/compact"
I fully type out /context and press Enter but it runs the /compact command!

Screenshots:

<img width="396" height="94" alt="Image" src="https://github.com/user-attachments/assets/60610097-121a-44a0-97ac-5e6233e448b8" /> <br />

<img width="418" height="104" alt="Image" src="https://github.com/user-attachments/assets/b2e0d1af-2ce0-4f46-bdf7-a1eb506d68c2" /> <br />

<img width="535" height="114" alt="Image" src="https://github.com/user-attachments/assets/abab1c51-60d8-40b6-a023-f26c7bf0c936" /> <br />

<img width="502" height="159" alt="Image" src="https://github.com/user-attachments/assets/65bbac65-7a46-48dc-a0ae-50eeadd8eb65" /> <br />

<img width="489" height="137" alt="Image" src="https://github.com/user-attachments/assets/adb47dd9-1336-4169-9948-a507ad1cb648" /> <br />

If I press Enter at the end here, it runs /compact instead of /context

If I press Esc instead, it finally switches the autocomplete to /context:

<img width="440" height="147" alt="Image" src="https://github.com/user-attachments/assets/877df571-2f69-415d-a148-8d6eead2dbce" />

What Should Happen?

After I type /con the autocomplete should jump to /context

Error Messages/Logs

Steps to Reproduce

Start typing /context

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

v2.1.12

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

12 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18800
  2. https://github.com/anthropics/claude-code/issues/18757
  3. https://github.com/anthropics/claude-code/issues/18892

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

jlagedo · 7 months ago

Same with /clear 🗡️
<img width="874" height="542" alt="Image" src="https://github.com/user-attachments/assets/3b745cb5-b634-4289-9a17-e01f7492d478" />

ffxsam · 7 months ago

Is Anthropic testing stuff before releasing updates? I hate to ask, but it appears that way.

zarSou9 · 7 months ago

I am also experiencing this and it is very annoying. /clear matches /compact for me.

meuerdesign · 7 months ago

Also experiencing this on Linux (v2.1.12). Typing /clear and pressing Tab autocompletes to /compact instead. Tested in both VSCode integrated terminal and standalone terminal - same behavior.

Erodenn · 7 months ago

Experiencing on Windows as well

ffxsam · 7 months ago

Fixed in 2.1.14.

ngphadke · 7 months ago

This is not fixed, still facing it in 2.1.19 - https://github.com/anthropics/claude-code/issues/20537#issuecomment-3793938882
I suspect that an increase in the number of installed slash commands might have something to do with it.

codemile · 7 months ago

FYI, but this workaround for a different issue also fixes this issue.

https://github.com/anthropics/claude-code/issues/22103#issuecomment-3828430196

jaried · 7 months ago

I had a similar issue and found the root cause: one of my skill files was not UTF-8 encoded. After deleting that specific skill file, the autocomplete/fuzzy matching started working correctly.

You might want to check if any of your skill files have encoding issues.

Dema · 6 months ago

Just had similar issue. description field was formatted with newline as this:

---
name: xxxx
description:
    MANDATORY....

Removed new line and autocomplete started working again. Also this skill didn't show up in "/skills" command in opencode before I fixed the description field.

navedk · 5 months ago

Adding a real-world example of how this bug causes data loss.

My case: typed /co, the menu highlighted /context, pressed down arrow to "select" it — but the arrow moved the selection to /clear, which executed and silently wiped my entire conversation with no confirmation prompt.

The autocomplete bug is the root cause, but I'd also suggest a complementary fix: /clear should require a confirmation prompt (e.g. "This will erase your conversation history. Continue? [y/N]"). It's the only irreversible command in the CLI, and a confirmation would act as a safety net regardless of how the wrong command gets triggered — accidental arrow key, muscle memory, or any future autocomplete regression.

Showing cached comments. Read the full discussion on GitHub ↗