Long single-line paste collapses to a placeholder, so the slash command is never recognized and runs as a plain prompt
Version: 2.1.233, macOS. Also on disk: 2.1.229, 2.1.231, 2.1.232.
Repro
- Compose a
/compactcommand with a very long argument on ONE line — roughly 3000–4000 characters, no newlines. - Paste it into the prompt.
- The CLI collapses it to
[Pasted text #1 +N lines]. - Press Enter.
Expected: the compaction runs.
Actual: the visible input no longer literally begins with /compact, so the slash command is not recognized. The whole thing is submitted as an ordinary prompt and the model answers it. No compaction happens, and nothing indicates the command did not fire.
Workaround
Submit it, press Escape to halt the inference — the placeholder expands into the real text — then press Enter. It works the second time because the input now begins with the literal /compact.
Why this looks like a regression
This did not happen in earlier versions. Every public description of the collapse rule is stated in lines (">4 lines", "+23 lines"), never in characters on a single line, so a long single-line paste collapsing may be new behavior.
Two recent changelog entries touch this machinery:
- 2.1.224 — "Added a cancel-and-confirm step when removing an unavailable paste changes a command's text"
- 2.1.233 — "Fixed skill/command argument substitution"
Possibly related but distinct: #85485 (pasted content reaching tool-call arguments).
Impact
The failure is silent. A user pasting a prepared /compact argument gets a normal answer instead, and may not notice the compaction never ran until much later — by which point the context they were trying to reclaim is gone.
3 Comments
Reproduced on v2.1.233 (macOS).
Steps:
claudein an empty project./compact(no newlines).[Pasted text #1].Observed: the text is sent to the model as a normal prompt (the model replied "I don't have any prior conversation to compact..."). No compaction ran and nothing said the command was not recognized.
Expected:
/compact <instructions>runs the compact command (in a fresh session that shows "Not enough messages to compact.").Control: pasting the same text a second time expands the placeholder into the literal
/compact ...text; Enter then correctly runs the command.Assessment: This looks like a genuine bug, and a regression. Two separate things are going on:
/after a placeholder is expanded or removed is not accidentally run as a command (e.g. pasting a/var/log/...path mid-prompt, or a stale paste being stripped in front of/clear). That check also catches the case where the whole input is a single live paste whose content starts with a real slash command like/compact, so the command is silently sent to the model as plain text instead. Before 2.1.224 this ran as a command. The fix should let a paste that is the entire input and begins with a slash command run as that command (or at least warn that it didn't).🤖 Generated with Claude Code
Reproduced on Linux with 2.1.233, and bisected the regression.
What I did: pasted a single-line
/compact <argument>of ~3,600 characters into a fresh interactive session. It collapsed to[Pasted text #1], and pressing Enter submitted the whole thing as an ordinary prompt — the model answered it, no compaction ran, and nothing indicated the command didn't fire. Typing/compactwith a short argument in the same session was recognized normally, and the Esc-then-resubmit workaround described in the report also works.Regression window: on 2.1.223 the same paste also collapses to a placeholder, but pressing Enter still runs
/compactcorrectly. On 2.1.224 and every version I tried through 2.1.233 the command is no longer recognized. So this regressed in 2.1.224.One clarification on the collapse rule itself: single-line pastes above roughly 800 characters have collapsed to a placeholder on older versions too (a ~600-character paste does not collapse). What's new in 2.1.224 is that a collapsed paste beginning with a slash command stops being recognized as a command — previously the command still ran despite the placeholder display.
Marking as a reproduced regression.
🤖 Generated with Claude Code
For your information: the label
reproducedon this issue does not prevent it from becoming stale and eventually auto-closed. See https://github.com/anthropics/claude-code/issues/87647 for details, and consider upvoting that for visibility.This means to avoid auto-closing, this issue needs to acquire at least 10 thumbs up, or get new comments every time before the 14 days stale bot interval expires.