Make escape-during-task interrupt threshold configurable (or expose as a separate rebindable action)
Summary
The ESC key is overloaded in the Chat context: pressing ESC clears the input when typing, and pressing ESC (or double-ESC) while a task is running interrupts it. Users who routinely double-tap ESC to clear input frequently interrupt running tasks by accident — losing in-flight
work and burning tokens on the restart.
Why this is hard to fix today
Looking at the documented keybinding actions, the only ESC-bound action in Chat context is chat:cancel (single escape). There is no separate task:interrupt or equivalent action that's bound to ESC while a task is foregrounded — so users can't remap the "escape-while-running" behavior independently of the "escape-while-typing" behavior. app:interrupt (ctrl+c) is
explicitly hardcoded.
The only workaround via ~/.claude/keybindings.json is to unbind ESC from chat:cancel entirely, which also kills ESC-to-clear-input — a net loss for users who do legitimately use ESC to clear.
Requested change
Either of these would solve it:
- Configurable interrupt threshold. A setting like
keybindings.escapeInterruptPresses (default 2, accepts 1/2/3) so users can require triple-ESC to interrupt while still keeping single-ESC for clear-input.
- Separate rebindable action. Split the running-task interrupt into its own action (e.g.
task:interruptOnEscape) that lives in theTaskcontext and can be unbound or rebound to a chord likeescape escape escapeindependently ofchat:cancel.
Option 2 is more flexible and consistent with how other actions are exposed; option 1 is a simpler ship.
Real-world impact
Trained muscle memory from earlier versions of Claude Code (where work chunks were shorter and double-ESC-to-clear was safe) doesn't translate cleanly now that tasks routinely run for minutes at a time. The accidental-interrupt cost is high (lost context, restart cost, lost
tokens) and the UX recovery cost is awkward (the user knows they did it, but the muscle memory is sticky).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗