claude-code - 💡(How to fix) Fix Slash command picker only activates at start of input, despite v2.1.0 changelog claiming "anywhere in input" support [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56002Fetched 2026-05-05 06:00:45
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

The slash command picker dropdown only appears when / is at the very beginning of the input line (position 0). When / is typed after any leading text, the picker never shows — only the first-position / triggers it.

This contradicts the v2.1.0 changelog entry:

Added slash command autocomplete support when / appears anywhere in input, not just at the beginning

Root Cause

Users often chain commands in natural language:

/compact the context and then /security-review

Or compose multi-step workflows:

/review this PR and also /commit

The picker not appearing breaks the flow — the user must delete back to the start, invoke the picker, then retype everything. The @ file autocomplete works mid-text without this limitation.

Code Example

/compact the context and then /security-review

---

/review this PR and also /commit
RAW_BUFFERClick to expand / collapse

Summary

The slash command picker dropdown only appears when / is at the very beginning of the input line (position 0). When / is typed after any leading text, the picker never shows — only the first-position / triggers it.

This contradicts the v2.1.0 changelog entry:

Added slash command autocomplete support when / appears anywhere in input, not just at the beginning

Environment

  • Claude Code version: 2.1.126
  • OS: macOS
  • Terminal: Terminal.app

Steps to reproduce

  1. Open Claude Code interactive session
  2. Type a slash command first, then some text, then another slash: /review this PR /commit
  3. The picker appears for /review at position 0
  4. After typing this PR, type /commit
  5. Expected: picker dropdown appears showing matching commands
  6. Actual: nothing happens — no picker, no suggestions

Variants tested

InputPicker appears?Notes
/cmdYesPosition 0 — works
/cmd /cmd2Yes (both)Consecutive, no text in between
text /cmdYesWhitespace before /
/cmd text /cmd2NoAfter leading cmd + text
/cmd --arg text /cmd2NoAfter leading cmd with args

The pattern: the picker works when / follows whitespace at position 0 or immediately after another slash command. It fails when / comes after any non-command text, even when preceded by whitespace.

Why this matters

Users often chain commands in natural language:

/compact the context and then /security-review

Or compose multi-step workflows:

/review this PR and also /commit

The picker not appearing breaks the flow — the user must delete back to the start, invoke the picker, then retype everything. The @ file autocomplete works mid-text without this limitation.

Related

  • Issue #9750 (feature request for inline autocomplete, closed "not planned")
  • The v2.1.0 changelog entry that suggests this should already work

Suggested fix

Extend the picker trigger logic beyond position 0. When the user types / preceded by whitespace anywhere in the input, activate the slash command picker — matching the behavior of @ file autocomplete which already handles mid-text positions.

extent analysis

TL;DR

Update the slash command picker trigger logic to activate when / is preceded by whitespace anywhere in the input, not just at position 0.

Guidance

  • Review the current implementation of the slash command picker trigger logic to understand why it only works at position 0 or immediately after another slash command.
  • Modify the logic to check for whitespace preceding the / character, regardless of its position in the input string.
  • Test the updated logic with various input scenarios, including those described in the "Variants tested" section, to ensure the picker appears as expected.
  • Consider referencing the implementation of the @ file autocomplete feature, which already handles mid-text positions, for guidance on updating the slash command picker logic.

Example

No code snippet is provided as the issue does not include specific implementation details.

Notes

The suggested fix assumes that the issue is solely due to the trigger logic and that updating it will resolve the problem. However, without access to the codebase, it's uncertain whether other factors might be contributing to the issue.

Recommendation

Apply workaround: Update the slash command picker trigger logic to match the behavior of the @ file autocomplete feature, which already supports mid-text positions. This change should allow the picker to appear as expected when / is typed after leading text.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING