[BUG] Text typed in external editor (Ctrl+G) silently truncated and replaced by [Pasted text #N +N lines] on return
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?
A long prompt composed in the external editor (Ctrl+G → Vim) was silently truncated on submit. Text typed directly in the editor was destroyed, and a [Pasted text #24 +26 lines] block was left in its place — a placeholder that never expanded into anything.
Nothing was pasted. The lost content was typed in the editor buffer.
The prompt interleaved text with 23 images, so I entered and exited the editor repeatedly while composing. All 23 images survived. The text did not. What reached the model was cut mid-sentence on both sides of the image block:
"...se o espaçamento acabar precisando ficar muito grande, o site para desktop pode ficar estranho e ficar parecendo" → [23 images inline] → "...ico alvo tenha dificuldades cognitivas."
Everything between parecendo and …ico alvo is gone, along with the unexpanded [Pasted text #24 +26 lines] block. Hours of writing, unrecoverable — no temp file remains under /tmp/claude-*.
That images and text behave differently across the same editor round-trip is probably the most useful clue here: they appear to take separate paths, and the text path is the broken one.
Steps to Reproduce
- Open Claude Code in a terminal
- Press
Ctrl+Gto open the external editor - Type a long prompt — no pasting involved
- Exit and re-enter the editor several times, interleaving images with the text
- Save and exit with
:wq, then submit - Sections of the typed text are gone, replaced by
[Pasted text #24 +26 lines]
Expected Behavior
Text written in the external editor reaches the model verbatim. If a placeholder is created, it expands back into its content — or, failing that, the input is not submitted with silent data loss.
Actual Behavior
Typed text is truncated mid-sentence and replaced by a placeholder that never expands. No warning, no error, no temp file, no recovery path. The loss is only discovered when the model replies to a prompt it received in pieces.
Environment
- OS: Linux
- Claude Code version: 2.1.222 (confirmed via
claude --version) $EDITOR: Vim/Neovim
Additional Context
This is distinct from the existing requests to make placeholder contents visible or editable (#3412, #23134) — though those are adjacent, since an unexpanded placeholder is exactly what ate this text. Here the content was typed natively in the external editor and was still treated as clipboard input, suggesting the editor round-trip re-runs paste detection over the buffer, or that a placeholder created in one round-trip fails to expand on re-entry.
The severity is not "a placeholder rendered wrong." It is silent, unrecoverable data loss in the primary input path, on a workflow (Ctrl+G → external editor) that exists specifically to make long-form prompting viable. Long prompts are precisely the ones users cannot cheaply reconstruct, and the failure mode gives no signal at all until the work is already gone.
Input-buffer data loss also isn't new: #6275 (input text lost on up-arrow) has been open since August 2025 with sustained upvotes and reports of lost prompts.
This is worth weighting heavily, because Claude Code is effectively the only client available for a Claude subscription. Anthropic's terms permit programmatic access only via an API key; subscription access runs through Anthropic's own clients. A Pro/Max user whose input path destroys their work has no substitute client to fall back on — "use a different tool" isn't an available workaround. That places a correspondingly higher obligation on this one not to lose data.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗