[BUG] Pressing Esc to exit /btw mode rejects the pending tool-use prompt instead of just exiting the mode
Summary
When in /btw mode with a tool-use / permission prompt pending from the assistant, pressing Esc — which is the way to exit /btw mode — gets routed to the pending prompt and declines/rejects the tool use, instead of simply exiting /btw mode. The user only intended to leave /btw mode, but the assistant receives a "user rejected the tool use" signal and changes course.
Steps to reproduce
- Enter
/btwmode. - While in
/btwmode, have the assistant issue a tool call that triggers a permission/confirmation prompt (e.g. anAskUserQuestion, or any tool requiring approval). - Press Esc to exit
/btwmode (the documented/only way out of the mode).
Expected
Esc exits /btw mode and leaves the pending tool-use prompt untouched (still pending, or otherwise unaffected). Exiting a mode and rejecting a tool call should not be conflated.
Actual
Esc is consumed by the pending tool-use prompt and declines it. The assistant is told the user rejected the tool use (even though the user did not intend to decline anything), and there is no separate way to exit /btw mode without hitting the prompt.
Impact
- The assistant misinterprets the Esc as a deliberate rejection and abandons / redirects whatever it was doing.
- The user is effectively unable to exit
/btwmode while a tool prompt is pending without side effects.
Environment
- Claude Code: 2.1.150
- OS: macOS (Darwin 25.5.0)
Notes
Key conflict: /btw mode's only exit is Esc, but Esc is also the reject/cancel key for a pending tool-use permission prompt. When both are active, the prompt swallows the Esc. A possible fix would be to have Esc exit the mode first (without rejecting the pending tool call), or to provide a distinct keybinding for exiting /btw mode.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗