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

Resolved 💬 4 comments Opened Jan 11, 2026 by Jason-Mendes Closed Mar 12, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

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

Start a conversation with Claude Code that involves complex processing (e.g., file analysis, code generation, or
multi-step operations)
While Claude Code is actively responding (showing "thinking" or executing tool calls)
Accidentally press ESC key once
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

Proposed Solution

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)

Alternative Solutions

_No response_

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

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

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)

View original on GitHub ↗

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