[BUG] `/effort <level>` on first line of multiline message fails with misleading "Invalid argument" error

Resolved 💬 2 comments Opened May 7, 2026 by HackedRico Closed May 7, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When /effort <level> is the first line of a multiline message followed by additional prompt text, Claude Code rejects the command with Invalid argument: max — even though max is listed as a valid option in the same error message. The effort level is never set.

The same command works correctly when:

  • Submitted on its own as a standalone message
  • Placed on a later line of a multiline message

This suggests slash commands at the start of a message greedily consume the entire rest of the message as their argument, instead of parsing only the first line/token. The error message is also misleading: it lists max as a valid option immediately after rejecting max, which makes users assume the value was wrong rather than realizing trailing text was the problem.

What Should Happen?

One of the following:

  1. (Preferred) Parse only the first line/token after the command name as the argument. Set the effort level, then treat the remaining text as the user's first prompt at the new level. This matches how users intuitively expect to combine /effort max with a prompt.
  1. (Minimum fix) Improve the error message. Something like "/effort takes a single argument; received 'max' followed by additional text" would make the actual problem obvious instead of contradicting itself by listing max as valid.

Error Messages/Logs

❯ /effort max

  Please refactor the auth module to use the new session API.
  Start with the login flow and write tests for each change.
  Add proper error handling for token expiration.
  Update the docs in https://example.com/auth-guide
  Make sure backward compatibility is maintained.
  Write integration tests covering all edge cases.
  ⎿  Invalid argument: max
     Please refactor the auth module to use the new session API.
     Start with the login flow and write tests for each change.
     Add proper error handling for token expiration.
     Update the docs in https://example.com/auth-guide
     Make sure backward compatibility is maintained.
     Write integration tests covering all edge cases.. Valid options are: low, medium, high, xhigh, max, auto

❯ /effort max
  ⎿  Set effort level to max (this session only): Maximum capability with deepest reasoning

❯ hello
  /effort max
⏺ Effort is set to max. What would you like me to do?

Steps to Reproduce

  1. Open Claude Code in iTerm2 (any project, any model that supports /effort).
  1. Submit a single multiline message that starts with the slash command, e.g.:
/effort max

Please refactor the auth module to use the new session API.
Start with the login flow and write tests for each change.
Add proper error handling for token expiration.
Update the docs in https://example.com/auth-guide
Make sure backward compatibility is maintained.
Write integration tests covering all edge cases.
  1. Observe: command fails with Invalid argument: max and lists valid options that include max. Effort level is NOT set.
  1. Submit /effort max on its own as a standalone message.
  1. Observe: command succeeds, effort level is set.
  1. Submit a multiline message where /effort max is NOT on the first line, e.g.:
   hello
   /effort max
  1. Observe: command succeeds, effort level is set. This confirms the parser CAN find and execute the command from a multiline message — it just fails specifically when the command is the first line and is followed by trailing text consumed as the argument.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.119 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

Note on reproduction: This bug requires a longer multiline message to trigger reliably (~6+ lines with mixed content, including URLs). A short 2-line trailing prompt does not consistently reproduce it, suggesting the parser has a length or content-specific threshold for when trailing text gets consumed as the command argument.

<img width="994" height="489" alt="/effort max parsing failure" src="https://github.com/user-attachments/assets/b94c4c75-dfb2-44e5-8a26-712a7bac69d3" />

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗