[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
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.
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/18898
- https://github.com/anthropics/claude-code/issues/18892
- https://github.com/anthropics/claude-code/issues/18976
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
same behavior for me:
Expected Behavior
/helpshould display help information/should trigger autocomplete popup showing available commands- Custom commands from
~/.claude/commands/should be accessible
Actual Behavior
/helpreturns "Unknown skill: help"- No autocomplete popup appears when typing
/ - Slash commands are routed to the Skill tool instead of the built-in command handler
Environment
- Claude Desktop (latest version as of 2026-01-18)
- Windows 11
- Claude Code running within Desktop's integrated chat window
Steps to Reproduce
- Open Claude Desktop
- Open Claude Code window within Desktop
- Type
/helpand press Enter - Observe "Unknown skill: help" error
Same 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
- Start typing /clear in the input field
- Type the full command /clear
- Observe the autocomplete dropdown - it shows both /clear and /compact, but /compact is highlighted
- Press Enter
Expected Behavior
Pressing Enter should execute /clear (the command I fully typed)
Actual Behavior
Pressing Enter executes /compact (the highlighted command in autocomplete)
- Claude Code version: Version: 2.1.12
- OS: Windows 10
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
---
name: broken-skill
description: [Description inside square brackets]
---
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 /wo shows /dan:README in 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 in settings.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:
- macOS, Claude Code v2.1.44
- 494 skills loaded via symlinks in ~/.claude/skills/ (pointing to ~/.agents/skills/)
- All skill files have valid YAML frontmatter and UTF-8 encoding (validated programmatically)
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:
- Ghostty: autocomplete filtering breaks (always shows same results regardless of input). Threshold is around ~85 skills.
- Terminal.app (macOS): autocomplete works correctly with all 494 skills.
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).