[BUG] AskUserQuestion dialog steals focus and captures keystrokes while user is typing in VS Code
Description
When using Claude Code in the VS Code extension, the AskUserQuestion dialog appears while the user is actively typing in the input box (composing a new message or answering a previous question). The dialog immediately steals keyboard focus, causing keystrokes to be interpreted as option selections rather than text input. This results in unintended answers being submitted without the user's knowledge.
Steps to Reproduce
- Open Claude Code in VS Code extension
- Send a request that triggers Claude to work for a while
- Begin typing your next message or follow-up in the input box
- Claude invokes
AskUserQuestionmid-typing - Keystrokes intended for the input box are captured by the dialog and inadvertently select an option
Expected Behavior
The dialog should not accept keyboard input until the user explicitly focuses it (e.g., by clicking). Alternatively, the dialog should be queued and not appear while the input box has focus and contains text.
Actual Behavior
The dialog appears immediately, steals focus from the input box, and the next keystroke selects an option — often without the user realizing the dialog appeared.
Environment
- Claude Code VS Code extension
- macOS
Prior Issues
This has been reported multiple times but all prior issues are now closed:
- #28722 — AskUserQuestion Steals Focus and Triggers Unintended Selection
- #33988 — Permission prompt captures keystrokes while user is typing
- #10971 — Feature request: Prevent prompts and dialogs from appearing while user is actively typing
- #22300 — Number keys auto-select options instead of typing in "Other" text input
- #20591 — Number hotkeys in AskUserQuestion interfere with numerical input
The problem persists as of April 2026.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗