Skip to content

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

Description

@Jason-Mendes

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)
  2. While Claude Code is actively responding (showing "thinking" or executing tool calls)
  3. Accidentally press ESC key once
  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    autocloseIssue will be closed automaticallybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions