[FEATURE] Add option to disable number hotkeys for AskUserQuestion prompt selection

Resolved 💬 2 comments Opened Jan 24, 2026 by guanli9410-dot Closed Jan 24, 2026

Environment

  • Platform: Claude Code CLI
  • Claude CLI version: Current (2026-01)
  • Operating System: Windows
  • Terminal: Windows Terminal

Feature Request Description

Add a configuration option to disable single-digit number hotkeys for the AskUserQuestion prompt selection mechanism.

Current Behavior

When AskUserQuestion presents multiple options (e.g., 1, 2, 3, 4, 5), pressing a number key immediately triggers selection of that option. This creates usability issues when:

  1. A user intends to type a number as part of a custom response (e.g., selecting option 3 and typing "13" or "31")
  2. The system interprets the first digit typed (e.g., "1") as an immediate option selection
  3. The user must wait for the selection to complete before providing additional context

Example scenario:

Claude: [1] Option A
       [2] Option B
       [3] Option C
       [Other] Customize

User types: "3" → immediately selects Option C
User intended: "31" or "13" as additional context for Option C

Requested Behavior

Add a configuration setting such as disableNumberHotkeys that:

  • When set to true, requires users to press Enter after typing a number to confirm selection
  • Allows numbers to be typed as part of custom input without premature selection
  • Could be configured in .claude/settings.json:
{
  "ui": {
    "disableNumberHotkeys": true
  }
}

Alternatively, consider:

  • Using longer hotkey prefixes (e.g., option-1, opt-1)
  • Requiring arrow key navigation + Enter for selection
  • Making hotkeys opt-in rather than opt-out

Problem Statement

The immediate number hotkey selection:

  1. Reduces input flexibility: Users cannot seamlessly combine option selection with numbered content
  2. Creates workflow friction: Requires users to either select first then elaborate, or use "Other" unnecessarily
  3. Violates principle of least surprise: Standard CLI interfaces typically require Enter to confirm selections
  4. Impacts users who work with numerical data: Particularly problematic when options need to be followed by numbers, IDs, or measurements

Additional Context

  • This is distinct from issue #5064 which concerns Ctrl+Enter for newline submission
  • Related to overall keyboard shortcut customization requests
  • The AskUserQuestion tool is used extensively throughout Claude Code CLI for permission requests, option selection, and user guidance
  • Current workaround: always select "Other" and type full response, or select option first then add context in follow-up messages

Proposed Implementation

Minimal change approach:

  1. Add boolean flag to settings schema
  2. Modify AskUserQuestion input handler to check flag
  3. When disableNumberHotkeys: true, buffer number input until Enter is pressed
  4. Maintain backward compatibility (default behavior unchanged)

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗