[BUG] AskUserQuestion tool misinterprets numeric input
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Per Claude's instructions:
- Tool: AskUserQuestion
- Issue: When "Other" option is selected to provide custom text input, the first character typed is interpreted as a numeric option selection instead of being captured as text input
- Expected behavior: After selecting "Other", all subsequent keystrokes should be captured as the custom text input
- Actual behavior: First keystroke after "Other" is treated as option number selection
Specifically, I was being asked to specify a port number for something to run on, and offered me 5 choices. Choices #1 through #4 were reasonable port numbers, but not the one I wanted, so I chose choice #5, the "something else input it here" option. As usual, the cursor points at the entry field after the option to enter the number, and I started to enter the port number I wanted, 4444, but it interpreted the first "4" keystroke as selection choice #4, which happened to be port 9000, and proceeded as if port 9000 had been my choice.
What Should Happen?
Once I was in "enter something different here" mode, a digit keystroke should be interpreted as the first character of the string being entered, not as a menu selection.
Error Messages/Logs
Steps to Reproduce
What I said above
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
v2.1.1
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗