[BUG] - Accidentally pressing ESC while Claude Code is actively processing a request

Resolved 💬 3 comments Opened Aug 27, 2025 by Jason-Mendes Closed Jan 4, 2026

Environment

  • Platform: Claude Code CLI
  • Claude Code version:
  • Operating System:
  • Terminal:

Bug Description

Accidentally pressing ESC while Claude Code is actively processing a request (during thinking, tool calls, or file
edits) immediately interrupts the operation without confirmation, leading to lost work and incomplete responses. The
current ESC interrupt functionality lacks user confirmation when interrupting active operations.

Steps to Reproduce

  1. Start a conversation with Claude Code that involves complex processing (e.g., file analysis, code generation, or

multi-step operations)

  1. While Claude Code is actively responding (showing "thinking" or executing tool calls)
  2. Accidentally press ESC key once
  3. Observe immediate interruption without confirmation prompt

Expected Behavior

When ESC is pressed during active Claude Code processing, the system should:

  • Display a confirmation prompt: "Claude Code is currently processing. Do you want to interrupt? (y/N)"
  • Allow user to confirm (y) to interrupt or cancel (N) to continue
  • Preserve the current operation state if user chooses not to interrupt
  • Only interrupt immediately if user confirms the action

Actual Behavior

  • ESC immediately interrupts Claude Code's active processing without any confirmation
  • All progress on the current request is lost
  • No option to resume or continue the interrupted operation
  • Forces user to restart their request from the beginning

Additional Context

Related to existing ESC functionality:

  • Double-tap ESC for checkpoint/history navigation should remain unchanged
  • This enhancement specifically targets single ESC press during active processing
  • Similar confirmation patterns exist in other CLI tools (e.g., git operations, npm installs)

Impact:

  • Accidental interruptions waste tokens and development time
  • Particularly problematic during long-running operations like codebase analysis
  • Creates friction in development workflow when ESC is pressed unintentionally

Suggested Implementation:

  • Add confirmation prompt only when Claude Code is in "active processing" state
  • Maintain current immediate ESC behavior when Claude Code is idle/waiting for input
  • Consider timeout for confirmation prompt (e.g., auto-cancel after 10 seconds)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗