Sent message lost from history and display when response is cancelled (Ctrl+C)
Resolved 💬 1 comment Opened Apr 27, 2026 by hangingwithshu Closed Jun 11, 2026
Summary
When a message is sent and then the response is cancelled (Ctrl+C or Escape) before it completes, the sent message is unrecoverable:
- It is not added to the CLI's input history buffer, so pressing up arrow skips over it entirely.
- It is not echoed in the terminal output, so scrolling up does not reveal it.
The only option is to retype the message from scratch.
Steps to reproduce
- Send any message, e.g. "test"
- Send a second message, e.g. "test1"
- Press Ctrl+C before the response to "test1" completes
- Press up arrow (or Ctrl+P) at the prompt
Expected: input history shows "test1"
Actual: input history shows "test" (the message before the cancelled one); "test1" is gone entirely
Environment
- Claude Code CLI
- Tested on macOS (Ghostty terminal, zsh + Oh My Zsh)
- Likely reproducible on any terminal/shell since Claude Code manages its own input history
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗