Slash-command dropdown should open after whitespace, not only at start of prompt
Summary
The full slash-command dropdown (the multi-row two-column listing of every command with its description) only appears when / is the first character of the prompt. When / is typed mid-prompt, only a lighter inline suggestion shows — the rich dropdown is unreachable.
Repro
- Open a Claude Code prompt.
- Type
/. Full dropdown appears with all commands + descriptions. - Clear, then type
please run /. No full dropdown — only a lighter inline suggestion.
Expected
The full dropdown should also open mid-prompt, anywhere / is preceded by whitespace, a newline, or start-of-input. Same rendering, filtering, keybindings, and selection behavior as the start-of-prompt dropdown.
Trigger rule (precise)
Open the dropdown when:
- Char at cursor's left is
/. - Char immediately left of that
/is one of: nothing (start-of-input), space, tab, or newline. - Normal prompt-input mode (not in a paste, modal, etc.).
Applies on any line of a multi-line prompt.
Filter query
The non-whitespace run between the triggering / and the cursor.
Example: please run /use-w| → query is use-w.
Edge cases (must NOT trigger)
https://...—/preceded by:, not whitespacesrc/foo.ts—/preceded byc, not whitespaceand/or—/preceded byd, not whitespace
Edge cases (MUST trigger)
/at start of prompt (regression check)please /- After Shift+Enter, on a new line:
\n/ - Any later line of a multi-line prompt:
... /
Dismissal (mirror existing start-of-prompt behavior)
Esccloses it- Typing whitespace closes it (query run ends)
- Cursor moves out of the query run
- Backspace past the triggering
/
Selection semantics
Selecting a command replaces /<partial query> with /<full command name> in place. Text before and after the cursor is preserved. The mid-prompt /command-name is not auto-invoked — invocation semantics stay unchanged (only start-of-prompt slashes invoke). This is purely a UI/discoverability change.
Why this should be small
The activation predicate for the existing start-of-prompt dropdown likely just needs to be broadened from cursor at col 0 AND char-left is / to char at trigger pos is / AND (trigger at col 0 OR char-left-of-trigger is whitespace). Rendering, filtering, keyboard handling, and selection are reused unchanged. The existing start-of-prompt case still satisfies the broadened predicate, so regression risk is low.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗