claude-code - 💡(How to fix) Fix [BUG] /rename consumes following newline and slash command as part of the name argument

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

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.

Fix Action

Fix / Workaround

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.

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.

RAW_BUFFERClick to expand / collapse

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).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING