[BUG] ESC interrupt removes the user's submitted prompt from chat history
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?
Pressing ESC to interrupt a streaming response now removes the user's submitted message entirely from the chat transcript — both the prompt and Claude's partial response disappear, as if the turn never happened.
Previously, ESC stopped generation but left the user prompt in the transcript. This enabled a common workflow:
- Submit a prompt.
- Watch Claude start working and realize I want to add context, redirect, or refine.
- Press ESC.
- Type a follow-up like "actually, also include Y" — Claude still has the original prompt in context and can continue from there.
With the new behavior, the original prompt is gone from history, so any follow-up has nothing to attach to. I have to retype the full original prompt plus the augmentation from scratch, every time. The augmentation pattern is what makes ESC useful in the first place; without it, ESC is just "abort and start over." This is a serious hit to productivity.
NOTES
- I am not using Vim mode (no editorMode: "vim" in any settings.json file).
- The v2.1.119 changelog mentions "Vim mode: Esc in INSERT no longer pulls queued messages back into input", which suggested a Vim-only scope — but the transcript-clearing behavior I'm seeing affects non-Vim users.
- Ctrl+S (chat:stash) doesn't help because it only stashes drafts before submission. The decision to interrupt is made after I see Claude's first sentences.
REQUEST
Restore the prior behavior in non-Vim-mode (keep the user's prompt in the transcript on ESC interrupt), or add a setting like preserveInterruptedTurnInHistory:true to opt back in.
Affected version: 2.1.119+
Platform: macOS (zsh, Darwin 24.6.0)
What Should Happen?
When ESC is pressed to interrupt a streaming response, my submitted prompt should remain in the chat transcript (along with whatever partial response Claude produced before the interrupt). This preserves the conversation context so I can send a follow-up message that augments or redirects the original ask without retyping it.
Old behavior (pre-2.1.119): prompt + partial response stayed in history; follow-ups could reference them.
New behavior: the entire turn is wiped on ESC — both my prompt and Claude's partial output disappear from the transcript.
Error Messages/Logs
N/A — no error output. This is a behavioral regression, not a crash or error.
Steps to Reproduce
- Open Claude Code in any project (Vim mode off; confirmed via editorMode not set in any settings.json).
- Submit a non-trivial prompt, e.g., "Explain in detail how the Linux scheduler works."
- Wait for Claude to begin streaming the response.
- Press ESC to interrupt mid-stream.
- Observed: the submitted prompt and the partial response are both removed from the chat transcript. The conversation looks as if the turn never happened.
- Expected: the submitted prompt remains in the transcript; partial response is preserved (or at least cleanly truncated and visible); a subsequent message like "also include kernel preemption" has full context to attach to.
Reproduces consistently in VS Code integrated terminal on macOS. Not tested in other terminals.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.120
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗