[BUG] ESC key corrupts input state — submitted prompt disappears, requires chaser prompt, chaser then hangs for 3+ minutes burning ~1K tokens
Status Fixed / completed
Reported on v2.1.59
Maintainer reply None cached
Activity 4 comments · opened Feb 27, 2026 · closed Feb 28, 2026
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 at any point during a session corrupts the input buffer state, causing a repeating cycle:
- Press ESC (to interrupt or for any reason)
- Type next prompt and submit — prompt disappears from the UI with no response
- Send a throwaway "chaser" prompt (e.g. "hi") — the original prompt now appears and Claude answers it correctly
- The chaser prompt then fires, consuming ~1,000 tokens
- Claude hangs for 3+ minutes with no visible activity
- User presses ESC to break out — and the cycle repeats from step 1
What Should Happen?
ESC interrupts cleanly. The next submitted prompt is processed normally with no input state corruption.
Error Messages/Logs
Steps to Reproduce
- Start a Claude Code session
- Press ESC at any point (during input, during a response, etc.)
- Type a prompt and hit Enter
- Observe prompt disappears with no response
- Send any follow-up message
- Observe original prompt processes correctly, then chaser hangs
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.59 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Resolved — root cause identified: orphaned caffeinate process
The bug was caused by a caffeinate process outlasting the shell hook that spawned it. The orphaned process was interfering with terminal input state, producing the disappear/chaser pattern. Killing the caffeinate process resolved the issue immediately. Not a Claude Code bug.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.