Leading whitespace before slash commands is no longer stripped — command text sent as message instead
Version: Claude Code v2.1.119, Opus 4.7 (1M context), Claude Max
Summary
Lines starting with whitespace followed by a slash command (e.g. /plugin uninstall foo) are no longer recognized as slash commands. They're being sent to the model as regular chat messages. Previously, Claude Code stripped leading whitespace before matching against /, so commands pasted from external sources or copied with indentation still worked as commands. This is a regression — observed on 2026-04-24.
Reproduction
- Start a Claude Code CLI session.
- At the prompt, type or paste:
␣␣/plugin(two spaces followed by/plugin). - Observe: the message is sent to the model instead of opening the
/pluginUI.
Expected behavior
Leading whitespace before a slash-command token is stripped; the command is recognized and invoked by Claude Code itself.
Actual behavior
The leading whitespace prevents slash-command recognition; the text is sent to the model as a chat message. The model's response (something like "I can't invoke slash commands for you — type that line at the prompt") is just a downstream effect of the command not being intercepted by the CLI at all.
Example transcript
❯ /plugin uninstall standard-tooling@standard-tooling-marketplace
⏺ I'll wait — that's a command you're running, not a request for me. Let me know when you want me to do something.
❯ /plugin uninstall standard-tooling@standard-tooling-marketplace
⏺ /plugin is a built-in Claude Code command you run yourself in the CLI — I can't invoke it for you. Type that line at the prompt (not in a message to me) and Claude Code will uninstall the plugin.
Impact
Copy-paste workflows that include indentation (run books, step-by-step guides in markdown, previous transcripts where the command appeared in a bulleted or indented block) now silently send the command as a message instead of executing it. Wasted round-trips and confusion about whether the command was accepted.
Regression
This worked historically — pasting commands with leading whitespace from research-run transcripts was routine. The behavior change is recent.
Workaround
Manually remove leading whitespace before / before pressing Enter.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗