[BUG] /rename consumes following newline and slash command as part of the name argument

Resolved 💬 3 comments Opened May 15, 2026 by bukzor Closed May 19, 2026

Version

Claude Code 2.1.142

Repro

In an interactive session, submit this as a single message (with a real newline between the two lines):

/rename heredoc-archeology
/color orange

Expected

  • /rename takes heredoc-archeology as the new session name (terminating at the newline).
  • /color orange is dispatched as a second slash command.

Actual

  • The session is renamed to the literal string heredoc-archeology\n/color orange (newline and second command included in the name).
  • The /color command is never dispatched.

Confirmed via the echoed Session renamed to: … line, which contains the trailing /color … text on a second line.

Impact

Pasting or typing multi-command sequences silently corrupts the first argument. The user has no indication the second command was swallowed.

Suggested fix

Slash command argument parsing should terminate the argument at the first newline (matching shell/CLI conventions). A trailing slash-command line should be re-dispatched as its own command, or at minimum rejected with an error rather than silently appended.

Related

  • #56899 — /effort <level> on first line of multiline message (different command, related parsing surface).

View original on GitHub ↗

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