Why the Collapsed [Pasted text #N] Still Costs You the Full Context
A look at what that placeholder actually does, and doesn't do.
Paste a large block of text into Claude Code, and the input line doesn't fill up with hundreds of lines of text. Instead you see something like [Pasted text #1 +312 lines], a short, tidy placeholder. It looks like the tool is being considerate about how much you're sending. It isn't, not in the way that matters.
What the placeholder actually is
The collapse is a rendering decision, not a context-size decision. Printing 312 raw lines into your terminal's input box would make the box unreadable and your scrollback a mess, so the CLI swaps the visible text for a short summary. That's a genuine usability fix for a genuine problem: nobody wants to scroll past a stack trace to see what they typed after it.
What it doesn't do is shrink what gets sent. The placeholder lives in the input renderer; the message that actually goes to the model is built from the text you pasted, not from the three words showing on your screen.
What the model receives
This is the part that surprises people: the full pasted text is still part of your message when it reaches the model. The collapse is UI-only. If you paste 300 lines of a log file to ask about one error on line 40, the model still processes all 300 lines; the placeholder only kept your terminal from having to render them.
That's not a line-by-line confirmed detail from Anthropic's documentation. It follows from how a terminal-based AI CLI has to work: for the model to act on what you pasted, the underlying text has to travel to it as part of the message. Collapsing the display without also dropping the payload isn't an unconfirmed bug so much as the only way the feature can work: if the text didn't reach the model, pasting it in the first place would have been pointless.
Claude Code, Codex CLI, and Gemini CLI all collapse large pastes into a short placeholder in the input display, so the same design question applies to all three. The clearest confirmation of how that works comes from Codex CLI, whose implementation is open source. In openai/codex, file codex-rs/tui/src/bottom_pane/chat_composer.rs, a doc section titled "# Large Paste Placeholders" documents the behaviour, the file defines const LARGE_PASTE_CHAR_THRESHOLD: usize = 1000;, and the code's own comment states that above that threshold the composer "inserts a placeholder element (expanded on submit) and stores the full text in pending_pastes." That's the mechanism this guide describes, in the exact terms of the code that runs it: shrink what's shown, keep the full text on hand, expand it back into the message right before it's sent.
That's Codex's source, not Claude Code's (the two are separate codebases, and this doesn't claim Claude Code's implementation is line-for-line identical). What it does establish is that the pattern is real and verifiable, not a guess: at least one major AI CLI ships exactly the placeholder-plus-full-text behavior described above, in public code. For Claude Code specifically, the public record is thinner: a closed feature request (claude-code#65280) asked for large pastes to be written to a file automatically "for token efficiency," citing that pasted content "occupies context tokens for the entire conversation, not just the turn it was introduced." It never mentions the [Pasted text #N] placeholder by name, and it was closed by an automated stale-issue bot after a period of inactivity ("Closing for now — inactive for too long"), not by a maintainer weighing in. It's a record of a user hitting the same cost concern this guide describes — not evidence of how the placeholder works under the hood.
What you can do about it
If you want the input box tidy and the model's context small, the placeholder alone won't get you there. You need to change what you paste, or change what happens to it before it's sent. There are a few honest ways to do that, each with real tradeoffs: reference the file by path instead of pasting it, paste only the excerpt you actually need, or offload large pastes to a file automatically before they ever reach the input line. The next guide walks through all three, including where each one falls short.
CtxVault handles this automatically
Copy over your line threshold anywhere, and CtxVault writes it to a file before you even decide where to paste it. Paste into your terminal and you get a path instead of the wall of text that would've sat behind that placeholder.
Get CtxVault — €14,99