[BUG] A slash command inside a collapsed [Pasted text #N] paste is never dispatched — it is submitted as a message
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 a paste is collapsed into a [Pasted text #N +M lines] placeholder, a slash command at the start of that paste is not dispatched. Pressing Enter takes the ordinary submit path instead of the command path — the command silently does not run, with no "unknown command" reply and no indication that the input was treated as a message.
Pasting the same content a second time expands the placeholder back to literal text (the composer footer hint reads paste again to expand), and Enter then dispatches the command correctly.
The discriminator is the collapse, not the paste and not the line count. I varied those independently and the pattern is clean — every collapsed input failed to dispatch, and every uncollapsed input dispatched:
| Payload | Delivered by | Lines | Chars | Collapsed? | /goal dispatched? |
|---|---|---|---|---|---|
| /goal x\ny | paste | 2 | 9 | no | yes |
| /goal x\ny\nz | paste | 3 | 11 | no | yes |
| /goal x\ny\nz\nw | paste | 4 | 13 | yes | no |
| /goal x\ny\nz\nw | typed (Ctrl+J newlines) | 4 | 13 | no | yes |
| /goal x\ny\nz\nw | paste twice | 4 | 13 | no (expanded) | yes |
| /goal <900 chars>\ny\nz | paste | 3 | 910 | yes | no |
Rows 3 and 4 are the same 4-line payload delivered two different ways: typed it dispatches, pasted it does not. Row 6 is only 3 lines but crosses the character threshold, collapses, and also fails to dispatch. So neither "it was pasted" nor "it has newlines" explains the failure — being collapsed does.
This is consistent with the thresholds reported in #85453 (~800 characters or more than 3 lines, described there as hardcoded, same version as this report). I varied line count and character count only; I did not vary pane width or terminal.
This looks like the same root cause as some already-open issues. #82846 reports that leading whitespace stops a slash command being dispatched and the line is sent to the model instead; #68038 reports the same symptom when a Remote Control prefix pushes the / off the first character. In all three cases the / is no longer the first character of the composer buffer at dispatch-check time — here because the buffer holds a [Pasted text #N …] token instead of the text. If that check has one call site, these may be one fix.
What Should Happen?
A slash command that leads the pasted content should dispatch whether or not the paste is currently collapsed — the placeholder is a display affordance, and Paste large content already says "The full content is still sent to Claude when you submit."
If instead this is deliberate — command dispatch intentionally disabled while a paste is collapsed — then the actionable defect is that nothing says so and nothing shows it. The footer hint says only paste again to expand. The slash-command and skills documentation says nothing about paste, and the paste documentation says nothing about command dispatch. A visible signal at submit time, plus one documented sentence, would be enough.
Worth noting that the same docs page already reasons about this exact combination for a different case: "In a shell mode command or a / command, where the removal would change what runs … Claude Code cancels the submission and keeps the original text in the input." So a / command whose input carries a paste placeholder is already a contemplated state, and elsewhere the product takes care not to silently change what runs.
Error Messages/Logs
# COLLAPSED (single paste of the 4-line payload) — no command dispatched
❯ [Pasted text #1 +3 lines]
────────────────────────────────────────────────────────────────────────────
paste again to expand
# after Enter: the submit path is taken, and no goal indicator appears.
# (My repro session was logged out, so this shows routing only — see note below.)
⏺ Login expired · Please run /login
# EXPANDED (same payload pasted twice) — command dispatched
❯ /goal x
y
z
w
# status line afterwards:
◎ /goal active (8s)
What I could not observe: because the repro session was logged out, no request completed, so I cannot say what the model actually receives for the collapsed case — prose, the literal [Pasted text #N] token, or empty content. #77946 and #82590 report pasted content arriving empty on the model side, so that is a live possibility. It does not affect this report either way: the command does not run.
Steps to Reproduce
Originally hit during ordinary interactive use — a multi-line /goal pasted into a running session arrived as a plain message. The scripted reproduction below was then run under tmux 3.6a on macOS; I did not vary the outer terminal, so I cannot rule out terminal-specific paste handling.
Manual
- Run
claudein any directory. - Copy a slash-command invocation of 4 or more lines, or over ~800 characters:
````
/goal x
y
z
w
- Paste it into the prompt once. The input collapses to
[Pasted text #1 +3 lines]. - Press Enter. Observed: the command does not run; the input is submitted as a message.
- Repeat, but paste the same content twice before Enter. The placeholder expands and the command dispatches.
Scripted
tmux paste-buffer -p wraps the buffer in bracketed-paste markers, so the CLI sees the same ESC[200~ … ESC[201~ framing a terminal paste produces:
tmux new-session -d -s pastebug
tmux send-keys -t pastebug 'claude' Enter
sleep 12 # wait for the composer
printf '/goal x\ny\nz\nw' > /tmp/payload.txt
tmux load-buffer -b p1 /tmp/payload.txt
tmux paste-buffer -b p1 -t pastebug -p # collapses to the placeholder
tmux capture-pane -p -t pastebug -S -20 # ❯ [Pasted text #1 +3 lines]
tmux send-keys -t pastebug Enter
sleep 4
tmux capture-pane -p -t pastebug -S -30 # no goal indicator: not dispatched
Then repeat in a fresh session with two paste-buffer calls before Enter; the status line shows ◎ /goal active. Each case above was run in a freshly restarted Claude Code process, with the composer verified empty and no goal active before the case, so the goal indicator can only come from that case.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.226 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Terminal was tmux 3.6a on macOS.
Adjacent fixes in this area suggest dispatch-after-paste has been treated as a defect before: v2.1.132 — "Fixed pasting text starting with / silently swallowing the input or triggering an unknown-command reply"; v2.1.147 — "Fixed slash commands followed by a tab or newline being treated as an unknown command."
Related but distinct: #82846 and #68038 (same symptom, different reason the / is not first), #77868 (commands highlighted mid-sentence but not dispatched), #85453 (the collapse thresholds), #56885 (a docs-clarification request on this surface, closed NOT_PLANNED). Issues about viewing or expanding the placeholder (#11033, #23134, #29375, #48829, #56722, #76801) cover readability rather than dispatch. #60673 is the desktop-app variant, closed NOT_PLANNED.
3 Comments
Related: #85657 — a separate defect on the same surface (the
/resumepicker), filed from the same investigation. That one is about which sessions the picker lists rather than how input is dispatched; no overlap in cause or fix.Reproduced on v2.1.233 (macOS, tmux 3.6a, bracketed paste via
tmux paste-buffer -p).Steps:
claudein an empty directory.``
`/goal x
y
z
w
❯ [Pasted text #1 +3 lines]The prompt collapses to
with the footer hintpaste again to expand`.Observed: the text is sent to the model as a normal message. The model replies "There's no /goal skill available in this session…" and no
/goal activeindicator appears — the command never ran.Observed: the command dispatches —
⎿ Goal set: x / y / z / wand the status line shows◎ /goal active.Expected: the slash command dispatches the same way whether or not the paste is collapsed into a placeholder.
Assessment: This looks like a genuine bug, and a regression. Up through v2.1.223 the slash-command check ran on the expanded paste text, so a collapsed paste that starts with
/goal(or any command) dispatched normally. v2.1.224 added a guard so that text which only becomes slash-leading after a paste placeholder is expanded or removed is treated as a plain prompt — the goal was to stop e.g.[Pasted text #1] /clear everythingfrom running/clearwhen the placeholder is dropped, but the guard is broader than that and also catches the case where the whole submission is a pasted command. The docs describe the placeholder as a display affordance ("The full content is still sent to Claude when you submit") and say nothing about it disabling commands, and 2- and 3-line pastes (which don't collapse) still dispatch, so the current behavior is inconsistent purely on whether the paste collapsed. The fix should be to keep the guard for the removed/mid-string placeholder cases and let a leading pasted command dispatch again.🤖 Generated with Claude Code
Reproduced on Linux with the released 2.1.233 build, driving paste through tmux's bracketed-paste path — so this isn't macOS-specific.
[Pasted text #1 +3 lines]; pressing Enter submitted it to the model as an ordinary message (the command never ran, with no feedback that it wasn't dispatched).That matches your table: the collapse is the discriminator, not the paste or the line count. Since the documentation for large-paste handling says the full content is still sent when you submit — the placeholder is a display affordance — a leading slash command should dispatch the same way whether or not the paste is collapsed. Confirming as a bug. Excellent isolation work in this report, especially the typed-vs-pasted and paste-twice controls.
🤖 Generated with Claude Code