[BUG] Slash command autocomplete always selects wrong command regardless of typed input

Status Closed — not planned
Reported on v2.1.12
Maintainer reply None cached
Activity 13 comments · opened Jan 19, 2026 · closed Mar 17, 2026

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

  1. Open Claude Code CLI
  2. Type /context (or any other slash command)
  3. 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-formatting is 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.

View original on GitHub ↗

13 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18898
  2. https://github.com/anthropics/claude-code/issues/18892
  3. 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

achianuri · 7 months ago

same behavior for me:

Expected Behavior

  • /help should display help information
  • / should trigger autocomplete popup showing available commands
  • Custom commands from ~/.claude/commands/ should be accessible

Actual Behavior

  • /help returns "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

  1. Open Claude Desktop
  2. Open Claude Code window within Desktop
  3. Type /help and press Enter
  4. Observe "Unknown skill: help" error
holovskyi · 7 months ago

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

  1. Start typing /clear in the input field
  2. Type the full command /clear
  3. Observe the autocomplete dropdown - it shows both /clear and /compact, but /compact is highlighted
  4. 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

<img width="316" height="113" alt="Image" src="https://github.com/user-attachments/assets/882b64e5-de7b-4b14-aa44-0bd675ac9953" />

Kinvert · 7 months ago

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.

alennartz · 7 months ago

This is major and incredibly disruptive. where are the quality gates?

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.

akiya3 · 7 months ago

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!

kaar · 6 months ago

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]
---
robrobinson-76 · 6 months ago

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

rywmark · 6 months ago

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

rywmark · 6 months ago

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).

github-actions[bot] · 5 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 5 months ago

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.