[BUG] Slash command autocomplete always selects wrong command regardless of typed input
Description
When typing any slash command in the CLI input, the autocomplete dropdown appears but always highlights/selects /slack-formatting (a custom skill) regardless of what text is typed. The filtered list updates correctly to show matching commands, but the selection remains stuck on /slack-formatting.
Steps to Reproduce
- Open Claude Code CLI
- Type
/context(or any other slash command) - Observe the autocomplete dropdown
Expected Behaviour
The autocomplete should highlight a command that matches the typed input (e.g., commands containing "context" when typing /context).
Actual Behaviour
The autocomplete dropdown shows a filtered list of commands, but /slack-formatting is always selected/highlighted regardless of typed input. The selection does not follow the typed text.
Screenshot
<img width="2078" height="602" alt="Image" src="https://github.com/user-attachments/assets/386d88af-e8b5-4b0d-952a-d7be131ef0cb" />
Environment
- Claude Code Version: 2.1.12
- Platform: macOS Darwin 24.6.0
- Installation Method: Native
Troubleshooting Attempted
- Cleared
~/.claude/history.jsonl- did not fix - Verified
/slack-formattingis not the most frequently used command (only 4 uses vs 268 for/clear) - No unusual settings in
~/.claude/settings.json
Related Issues
- #10937 - Similar autocomplete selection bug (closed as fixed in Nov 2025, but this appears to be a regression or different manifestation)
- #1359 - Session files breaking autocomplete
Additional Context
The /slack-formatting skill is a standard custom skill in ~/.claude/skills/slack-formatting/ with no special priority or configuration. The bug affects all slash command inputs, not just specific ones.
13 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
same behavior for me:
Expected Behavior
/helpshould display help information/should trigger autocomplete popup showing available commands~/.claude/commands/should be accessibleActual Behavior
/helpreturns "Unknown skill: help"/Environment
Steps to Reproduce
/helpand press EnterSame issue on windows
When typing a slash command completely (e.g., /clear), the autocomplete menu highlights a different command (/compact), and pressing Enter
executes the highlighted command instead of the one I actually typed.
Steps to Reproduce
Expected Behavior
Pressing Enter should execute /clear (the command I fully typed)
Actual Behavior
Pressing Enter executes /compact (the highlighted command in autocomplete)
<img width="316" height="113" alt="Image" src="https://github.com/user-attachments/assets/882b64e5-de7b-4b14-aa44-0bd675ac9953" />
I'm having the same. If I type in /compact or any abbreviated version, it defaults to /wandb now that I added that skill. No where in the skill or code or anything does compact exist.
This is major and incredibly disruptive. where are the quality gates?
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.
I encountered the same issue.
In my case, I found that the root cause was a syntax error in the YAML frontmatter of a recently created skill file. If you check the files within your skills directory (especially the most recent ones), you might find a similar error.
Hope this helps!
After @akiya3 pointing to syntax error in skills I managed to isolate and reproduce it. If for example a description is within square brackets it will break the autocomplete.
Example:
skills/broken-skill/SKILL.md
Another reproduction case here — slightly different from the YAML frontmatter cause.
Setup: 11 commands in
.claude/commands/rob/, 7 in.claude/commands/dan/. No YAML frontmatter in any command files — all are plain markdown starting with#headers.Reproduction: Typing
/woshows/dan:READMEin the autocomplete results despite "README" having zero character overlap with "wo". Expected: only commands matching the typed characters should appear (e.g.,/rob:work-on,/rob:worktree,/rob:work-done).Additional note:
Skill(dan:*)is in the deny list insettings.local.json, but denied commands still appear in autocomplete. Ideally, denied commands should be suppressed from visibility entirely, not just blocked at execution time.Platform: Windows, VS Code extension
Additional reproduction case: skill quantity threshold
Found that the autocomplete filtering breaks when too many skills are loaded, independent of any YAML syntax or encoding issues.
Setup:
Behavior: Autocomplete dropdown always shows the same skills regardless of typed input (identical to OP's description). The list does not filter.
Fix: Reduced to 54 skills -> autocomplete works correctly. The exact threshold is somewhere between 54 and 494.
This suggests a separate root cause from the YAML/encoding issues reported above -- the autocomplete search/filter appears to silently fail when the skill count is too high.
Platform: Mac OS, Claude Code CLI, Ghostty Terminal
Update: This is terminal-specific
Further testing reveals this is a Ghostty-specific issue. With 494 skills loaded:
This suggests the bug is in how the Ink/React TUI renders the autocomplete dropdown in Ghostty specifically, possibly related to how Ghostty handles rapid terminal redraws for large lists.
Likely related to #18222 (Ghostty crash on Tab autocomplete with slash commands).
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.