Slash command parser rejects valid args when followed by extra text
Summary
When a slash command is followed by a valid argument and then additional text, the parser treats the entire trailing string as the argument list and rejects it. This forces users to remember to always place slash commands at the END of a message, which is unintuitive for newer users.
Repro
Type into the prompt:
/effort max do more research on iterm2
Expected: effort level set to max, the rest of the message ("do more research on iterm2") sent as the user prompt.
Actual:
Invalid argument: max , do more research on iterm2. Valid options are: low, medium, high, xhigh, max, auto
Workaround
User must manually rewrite as:
do more research on iterm2 /effort max
Proposed fix
When the first whitespace-separated token after a slash command matches a known valid argument for that command, treat everything after that token as the user prompt rather than as additional arguments. This would make /effort max <prompt> and <prompt> /effort max semantically equivalent.
Why it matters
- Reduces friction for users who think left-to-right (set the mode first, then write the prompt).
- Prevents a confusing error state with no clear hint about how to fix it (the error doesn't say "move the command to the end").
- Particularly valuable for non-developer users.
Environment
- Claude Code CLI on macOS Tahoe 26.4
- Model: Opus 4.7 (1M context)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗