Feature Request: Option to disable paste text collapse in input field

Open 💬 45 comments Opened Feb 4, 2026 by wesleysmyth

Summary

When pasting multi-line text into the Claude Code prompt input, the UI collapses it showing [Pasted text #N +X lines]. While this is a nice space-saving feature, it makes it difficult to review pasted content before submitting.

Problem

As a user, I often:

  1. Paste text from another source (error messages, code snippets, requirements)
  2. Want to review what I pasted before sending
  3. Cannot see the full content because it's collapsed

This is especially problematic when:

  • Recovering text after a crash (took a photo of screen, OCR'd it, want to verify accuracy)
  • Pasting code that may have formatting issues
  • Combining multiple pasted sections into one prompt

Proposed Solution

Add a configuration option to control paste collapse behavior. Options could include:

Option A: Global Setting

// settings.json or .claude/settings.json
{
  "input": {
    "collapsePastedText": false  // default: true
  }
}

Option B: Keyboard Toggle

  • Ctrl+Shift+E (or similar) to expand/collapse pasted text in the input field
  • Or a visual indicator that's clickable to expand

Option C: Threshold Setting

{
  "input": {
    "collapsePastedTextThreshold": 20  // only collapse if > 20 lines, 0 = never collapse
  }
}

Workarounds Attempted

  • Creating a /expand slash command - this only works after submission, not in the input field
  • Hooks - no paste event hook available

Environment

  • Claude Code CLI
  • macOS / Linux terminals
  • Various terminal emulators (iTerm2, Terminal.app, Warp, etc.)

Additional Context

This would significantly improve the UX for users who frequently paste content and want to verify it before sending. The current behavior optimizes for visual cleanliness but sacrifices reviewability.

---

Happy to contribute a PR if someone can point me to where this UI behavior is implemented!

View original on GitHub ↗

45 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18369
  2. https://github.com/anthropics/claude-code/issues/11033
  3. https://github.com/anthropics/claude-code/issues/3412

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

PaulRBerg · 5 months ago

In the latest version (v2.1.34), they've decreased the threshold above which the pasted text is hidden in the input. It's much lower now and this is impacting my productivity big-time.

Please implement this feature!

zleo77818 · 5 months ago

Supporting this as a voice input user

I just commented on #3412 with more details, but wanted to +1 here as well since this issue specifically focuses on the configuration aspect.

I use voice-to-text dictation as my primary input method in Claude Code on Windows. The [Pasted text #1 +N lines] collapse makes it impossible to verify whether my voice transcription is accurate before submitting — which is critical since speech recognition often produces errors.

I can confirm what @PaulRBerg reported: the collapse threshold was noticeably lowered in recent versions. Even short inputs (3-4 lines) are now collapsed, making the problem much worse than before.

Proposal C (configurable threshold with 0 = never collapse) from the issue description would perfectly solve my use case. A simple toggle like "collapsePastedText": false would also work.

that-lucas · 5 months ago

I can't understand how this is the default with no override in CC when @bcherny himself uses dictation the whole time.

PaulRBerg · 5 months ago

yep, it's really bad UX to see this

!Image

jupdike · 5 months ago

Vote for this. This drives me bananas. Let me copy a prompt, kill a session, relaunch Claude, and paste and continue editing. Not allowing this, somehow, in any way, is utter divine madness. I have wasted an hour on this! Absolutely unhelpful and unexpected. I'm a big boy. I know how to edit multiline interactively. I'm not scared of it. That's arguably all Claude Code is!

PaulRBerg · 5 months ago

yep, very bad UX. what happened to Claude Code as of lately? the UX has gotten worse.

jupdike · 5 months ago

I ended up switching to the VS Code integration (CC plugin) just to be able to edit the prompt without an hour of trying to work around weird Terminal blaming CC blaming Terminal hogwash

HyggeHacker · 4 months ago

When dictating into Claude Code, it automatically collapses into [Pasted Text]. This immediately disallows the user from being able to see if what they've dictated is correct and accurate.

People who rely on dictation for any number of reasons including disability can no longer effectively use this.

This isn't a feature request, it's a request to fix a BREAKING CHANGE.

Overall, the design choice of hiding pasted text into a powerful AI agentic system, and not having that be configurable… That is bananas to me.

We may be seeing the "Claude is building Claude" effects. No way this kind of UX nightmare should have made it this far.

PaulRBerg · 4 months ago

I really struggle to understand the product design rationale behind this.

In 90% of cases, I want the pasted text to be visible. It's only when I paste some random error from Sentry or something really verbose that I want it hidden.

josephcrivello · 4 months ago

+1

It is extremely annoying that there is no easy way to override this behavior

jtaub · 4 months ago

Painful that this can happen with as little as four characters. Can replicate this behavior in v2.1.59 with as little as this:

a
b
c
d
ncan33 · 4 months ago

I really want this to be fixed. The [Pasted text #N +X lines] is driving me crazy. I want to be able to see what is pasted.

danh-boldcraft · 4 months ago

+1 for threshold, would like it to be more like 15 lines than 4

zommuter · 4 months ago

Not ideal, but I managed to use tmux send-keys -t <pane> "$(xclip -selection clipboard -o)" to get the clipboard contents "typed" into claude code when it's in <pane> (e.g. 0) inside tmux.

jorgemartins-uon · 4 months ago

Suggestion: "Cmd+Shift+V" on mac to paste inline instead of collapsed?

PaulRBerg · 4 months ago

@jorgemartins-uon no. I don't want to have to learn a special pasting command just for Claude Code.

This feature is bonkers. Pasted text should appear normally by default.

BigKunLun · 4 months ago

If you use voice-to-text tools that paste via clipboard + Cmd+V, VoiceInput-Patch can work around this. It intercepts Cmd+V in terminals and re-types the content character-by-character via CGEvent Unicode key events — since the terminal sees keyboard input rather than a paste, the text shows up inline without being collapsed into a "[Pasted text]" block.

Da1sypetals · 4 months ago

Anthropics UIUX team is shit. VSCode extension cannot rewind conversation. TUI is completely broken.

PaulRBerg · 4 months ago

@Da1sypetals that's not true and I think we should be grateful to Anthropic for creating a product as awesome as Claude Code.

however, we do have to criticize them for leaving us in the dark here in these GitHub issue threads. There's a dearth of human responses, and this is not OK.

jtaub · 4 months ago

What's interesting to me is, the Claude Code CLI is without a doubt the single greatest developer tool released in my lifetime, and yet it has this absolute boneheaded UX experience around an extremely common use case that greatly impairs one's ability to use it.

Imagine if VSCode and IntelliJ had this "feature" when you pasted text into the editor. The experience in Claude today is about as frustrating as that.

viktor-ferenczi · 3 months ago

This is very bad UX and hitting me all the time. Integrate some full-featured editor widget inside Claude Code instead of trying to reinvent the wheel in various bad ways. Proper, performant multi-line code boxes long have been a solved problem.

viktor-ferenczi · 3 months ago

This has many duplicates and they're getting closed. It is because this issue is important, that's why it is so "popular" on the bug tracker. Please handle it instead of just auto-closing the tickets.

zonblade · 3 months ago

there is a cheat for this..

  1. paste the text
  2. enter
  3. cancel/interrupt
  4. double esc and go to message before

kinda hacky but works, but yeah native setting would be much better LOL

Aevum11 · 3 months ago

Yup. Still an issue. It is an obvious bug/error, so it needs to be fixed, instead of keeping a broken version.

jorgemartins-uon · 3 months ago
@jorgemartins-uon no. I don't want to have to learn a special pasting command just for Claude Code. This feature is bonkers. Pasted text should appear normally by default.

Cmd+Shift+V is not new - it’s the standard macOS shortcut for Paste and Match Style, which in many cases effectively means pasting as plain text.

I like the collapsed paste option because it can make things look less messy, but I also want a quick way to paste plain text when needed. I do not want to switch this in settings every time - a simple shortcut would be much better.

I would also be happy with the reverse: default Cmd+V for plain text and Cmd+Shift+V for collapsed paste. My main point is that this should be something you can choose on the fly, not through a fixed config change.

deathbychocolate · 3 months ago

This has been incredibly annoying for me as well.

Just the other night I was in the middle of writing a detailed reply to CC in order to generate a test plan. I decided I would finish my reply at another time because I had to do something else first. Because this long reply was never sent to Claude, I had to copy and paste it and it automatically collapses it, meaning I can not edit it anymore. If I want to make edits to the text I need to type it all from scratch.

This is not the first time this happens. My personal preference would be to have the text expand and collapse in a similar way we show CC's full thought process (ctrl+o), though keep them separate.

skullydazed · 3 months ago

I found a workaround that works for me, although it is not without side effects. In vim mode, if you press ^G it will open the prompt in a vim editor, and you can paste and edit to your heart's content. The only problem is that shift-enter may be broken for the rest of your session once you send that prompt.

cyrus-cai · 3 months ago

I ran into the same issue and hacked together a workaround using Hammerspoon — it intercepts Cmd+V in terminal apps and types the clipboard content as keystrokes instead of pasting, so Claude Code doesn't fold it.

Been using it for a while with Typeless and it works well. Try it out if you're on macOS: https://github.com/cyrus-cai/claude-code-paste-enhancement

HyggeHacker · 3 months ago

Nice, thank you cyrus, I'll check this out.

On Mon, Mar 30, 2026 at 8:47 AM Cyrus Cai @.***> wrote:

cyrus-cai left a comment (anthropics/claude-code#23134) <https://github.com/anthropics/claude-code/issues/23134#issuecomment-4154788408> I ran into the same issue and hacked together a workaround using Hammerspoon — it intercepts Cmd+V in terminal apps and types the clipboard content as keystrokes instead of pasting, so Claude Code doesn't fold it. Been using it for a while with Typeless and it works well. Try it out if you're on macOS: https://github.com/cyrus-cai/claude-code-paste-enhancement — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/23134?email_source=notifications&email_token=AFP6VBFH3BBP5WGAG3XVU7D4TJUHTA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJVGQ3TQOBUGA4KM4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4154788408>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AFP6VBBQMVGLVP7OSHLXHH34TJUHTAVCNFSM6AAAAACT7OBWWWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCNJUG44DQNBQHA> . You are receiving this because you commented.Message ID: @.***>

--
James King
GPG Fingerprint: 8C14 02C6 3208 D552 D22C F4C6 9240 A9D0 6827 468B

that-lucas · 3 months ago
I ran into the same issue and hacked together a workaround using Hammerspoon — it intercepts Cmd+V in terminal apps and types the clipboard content as keystrokes instead of pasting, so Claude Code doesn't fold it. Been using it for a while with Typeless and it works well. Try it out if you're on macOS: https://github.com/cyrus-cai/claude-code-paste-enhancement

@cyrus-cai if it wasn't for losing the new line chars I'd say this would do it, but pasting a ton of text that sometimes is inherently newline-dependent (think CSV), doesn't help. It becomes illegible therefore hard to edit, which is one of the main arguments here to have the text pasted as is.

that-lucas · 3 months ago
there is a cheat for this.. 1. paste the text 2. enter 3. cancel/interrupt 4. double esc and go to message before kinda hacky but works, but yeah native setting would be much better LOL

And the token consumption of this can be higher than $1 just to edit pasted text.

plopot · 3 months ago

Workaround: Hammerspoon-based paste enhancement (macOS)

I built a working solution using [Hammerspoon](https://www.hammerspoon.org/) that bypasses the bracketed paste detection while preserving formatting (newlines, UTF-8 characters including diacritics).

How it works

Instead of a normal Cmd+V (which triggers bracketed paste - Claude Code folds it), Hammerspoon intercepts the keypress and types the clipboard content line by line using hs.eventtap.keyStrokes(), with Shift+Enter between lines to insert newlines without triggering submit.

Key design decisions after several iterations:

  • hs.timer.doEvery instead of chained doAfter - recursive timer chains would break after ~10-15 lines. A single repeating timer is reliable.
  • keyStrokes per line, not per character - character-by-character was too slow and still dropped characters. Full-line keyStrokes works well with 80ms intervals.
  • Configurable line threshold - texts above MAX_LINES (default: 50) fall through to normal paste (Claude Code folds as usual). This keeps long pastes fast while short/medium ones display inline.

Setup

  1. brew install --cask hammerspoon
  2. Grant Accessibility permissions
  3. Find your terminal's bundle ID (in Hammerspoon console: hs.timer.doAfter(3, function() print(hs.application.frontmostApplication():bundleID()) end) then switch to your terminal within 3 seconds)
  4. Add the script to ~/.hammerspoon/init.lua
  5. Adjust MAX_LINES and TICK_INTERVAL to taste

The script

local TERMINAL_APPS = {
    ["com.mitchellh.ghostty"] = true,
    ["com.googlecode.iterm2"] = true,
    ["com.apple.Terminal"] = true,
    ["dev.warp.Warp-Stable"] = true,
    ["com.todesktop.230313mzl4w4u92"] = true,  -- Cursor
    ["com.jetbrains.intellij"] = true,         -- IntelliJ IDEA
    -- Add your terminal's bundle ID here
}

local TICK_INTERVAL = 0.08  -- 80ms between lines
local MAX_LINES = 50        -- above this = normal paste (Claude Code folds)
local typing = false
local pasteTimer = nil

local function typeClipboard()
    if typing then return true end
    local text = hs.pasteboard.getContents()
    if not text or #text == 0 then return end

    text = text:gsub("\r\n", "\n"):gsub("\r", "\n")

    local lines = {}
    for line in text:gmatch("([^\n]*)\n?") do
        table.insert(lines, line)
    end
    if lines[#lines] == "" then table.remove(lines) end

    if #lines > MAX_LINES then
        return false
    end

    typing = true
    local idx = 0

    pasteTimer = hs.timer.doEvery(TICK_INTERVAL, function()
        idx = idx + 1
        if idx > #lines then
            if pasteTimer then
                pasteTimer:stop()
                pasteTimer = nil
            end
            typing = false
            return
        end

        if idx > 1 then
            -- Adjust modifier to match your Claude Code newline binding
            -- Common options: {"shift"}, {"alt"}, or {"shift", "alt"}
            hs.eventtap.keyStroke({"shift"}, "return")
        end

        local line = lines[idx]
        if #line > 0 then
            hs.eventtap.keyStrokes(line)
        end
    end)
    return true
end

hs.hotkey.bind({"cmd", "shift"}, "V", typeClipboard)

terminalPasteWatcher = hs.eventtap.new({hs.eventtap.event.types.keyDown}, function(event)
    local flags = event:getFlags()
    local keyCode = event:getKeyCode()
    if keyCode == 9 and flags.cmd and not flags.shift and not flags.alt and not flags.ctrl then
        local app = hs.application.frontmostApplication()
        if app and TERMINAL_APPS[app:bundleID()] then
            local intercepted = typeClipboard()
            if intercepted == false then
                return false
            end
            return true
        end
    end
    return false
end)
terminalPasteWatcher:start()

Notes

cyrus-cai · 3 months ago
> I ran into the same issue and hacked together a workaround using Hammerspoon — it intercepts Cmd+V in terminal apps and types the clipboard content as keystrokes instead of pasting, so Claude Code doesn't fold it. > Been using it for a while with Typeless and it works well. Try it out if you're on macOS: https://github.com/cyrus-cai/claude-code-paste-enhancement @cyrus-cai if it wasn't for losing the new line chars I'd say this would do it, but pasting a ton of text that sometimes is inherently newline-dependent (think CSV), doesn't help. It becomes illegible therefore hard to edit, which is one of the main arguments here to have the text pasted as is.

@that-lucas I tested @plopot's approach, it seems nice.

@plopot would you like to open a PR at https://github.com/cyrus-cai/claude-code-paste-enhancement?

that-lucas · 3 months ago

Thanks @plopot for the improvement on top of @cyrus-cai's solution. I'll be using this for the time being.

But let's agree that having to have one more startup app installed consuming RAM just to solve this - and not in a good way - is a total PITA.

For those reasoning about that local TICK_INTERVAL = 0.08 -- 80ms between lines, I managed to get down to 0.025, lower than that it won't line break.

nikita-materi · 3 months ago

Please fix this collapse, I want to edit my pasted text and I can't

yasha-spare · 2 months ago

It's hard to describe how much I hate this "pasted text" collapse feature 😆 I want to see exactly what I pasted and be able to edit it. Would absolutely love a setting to be able to turn this off, or at least be able to set the threshold really high, it's enabled now for even tiny amounts of text.

that-lucas · 2 months ago

This is resolved. ✅

Now, when you paste something big it initially comes up as [Pasted text #5 +24 lines] and a new tooltip appears below:

paste again to expand

<img width="1847" height="215" alt="Image" src="https://github.com/user-attachments/assets/86d31088-1d65-4e99-a262-b19285d44467" />

If you repeat your paste command again, then it expands.

TLDR

Just hit Cmd + V + Cmd + V and it will expand the text automatically.

Observed on MacOS, Claude Code @ v2.1.116 running via npx.

PaulRBerg · 2 months ago

@that-lucas that's an OK-ish workaround but it's still a bad UX when pasting snippets. For example, I am using Raycast Snippets. 'Pasting again' means re-running the same snippet. Snippets may have input arguments so I need to enter multiple inputs again.

There should be a boolean setting (in settings.json) for disabling this behavior.

<img width="1496" height="604" alt="Image" src="https://github.com/user-attachments/assets/573cba93-6aa3-4953-a354-8d316d5cd836" />

seichisato-ai · 1 month ago

+1 — this is a significant UX issue for me too. I use Claude Code in VS Code's integrated terminal and frequently paste multi-line text (error logs, code snippets, longer prompts). Being unable to review or edit the pasted content in place forces clunky workarounds (write to a tmp file then @file, or open an external editor via chat:externalEditor).

Option A (input.collapsePastedText: false) would be the ideal per-user opt-out. Option C (threshold) is a nice secondary. The current threshold also seems to trigger well below the documented 10k-character limit — even pastes of a few hundred chars across ~4 lines get folded, which is surprising.

Would love to see this prioritized.

maciejszarski1 · 1 month ago

Adding a concrete use case for this: I use a speech-to-text tool (Typeless) for dictation. It inserts dictated text by pasting, so any multi-line dictation gets collapsed into [Pasted text #N +X lines] — which means I can't review or correct the transcription before sending. For dictation this isn't cosmetic, it's a real usability/accessibility problem: the whole point is to see and edit the transcribed text inline.

A collapsePastedText: false option (or a configurable threshold, or a keybinding to expand a placeholder inline) would fix it. +1.

that-lucas · 1 month ago

@maciejszarski1 not sure how Typeless "pastes" the content into the focused field, but if it has strategies on how to do this (like Handy has) you can set it to use Cmd + V and keep the content in the buffer, so after you stop talking/use your keyboard shortcut to transcribe, the content is inserted, then the [Pasted ...] placeholder appears, and you can Cmd + V to paste the text a second time which will then expand and show you.

maciejszarski1 · 1 month ago

Thanks @that-lucas. Unfortunately, I don't think Typeless lets you paste the dictated text again.

kiprobinsonknack · 22 days ago

repeating a comment from another issue: https://github.com/anthropics/claude-code/issues/3412#issuecomment-4791722403

Cmd+V, Cmd+V is not a good solution:

  1. How is a user supposed to discover this?
  2. Literally no other application I've ever used going back to Windows 3.1 doesn't paste when you paste, why are we doing this in the first place?
  3. I literally never want the collapsed text, based on some Googling it seems no one else wants this feature, I should be able to turn it off once in a system setting and never have to do this double-paste nonsense
  4. It wouldn't be that unlikely that I would want to paste the same thing multiple times, now I've got to do four pastes to paste something twice? how does that make sense
  5. Other people are saying this solution still breaks accessibility for speech input tools. (I can't vouch for this personally.)
rafmartom · 17 days ago

Why software has to assume things from the user? That is a horrible decision. If you assume people want to make these kind of placeholders , and you assume that this feature should be enabled by default . Then at least you should provide of a Flag , Config file directive in order to disable this.