claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] AskUserQuestion tool limited to 4 options is too restrictive

Open alexeyv opened this issue 2 months ago • 1 comments

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?

The AskUserQuestion tool has a hard limit of 4 options per question, which makes it impractical for just about every use case I have for it in the prompt I'm working on:

  • Menu selections (typically 5-15 items)
  • File selection from search results
  • Branch/tag selection
  • Any dynamic list from the codebase

Current behavior: falls back to text input when there are more than 4 elements.

Expected behavior: Allows at least 10-15 options, use 2-column layout if necessary, maybe. Workaround: Fall back to plain text numbered lists, which defeats the purpose of having a structured input tool in the first place.

A second page / "show more" is not good, user needs to see all choices in one place.

What Should Happen?

Caps the number of choices at something reasonable, Somewhere in the 10-20 options ballpark. Uses abbreviated descriptions of options, 2-column layout and/or scrolling if need be

Error Messages/Logs

  InputValidationError: [
    {
      "code": "too_big",
      "maximum": 4,
      "type": "array",
      "inclusive": true,
      "exact": false,
      "message": "Array must contain at most 4 element(s)",
      "path": [
        "questions",
        0,
        "options"
      ]
    }
  ]

Translation: The options array in the first question (questions[0].options) can have at most 4 elements. I sent 10, it rejected it.

Steps to Reproduce

give LLM the following prompt:

use AskUserQuestion to make me choose exactly one out of 10 random numbers. If it fails, print
out exactly how it failed. What did it say?

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.53

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

You can reclassify this as a feature wish, but in my opinion it's a design defect.

alexeyv avatar Nov 26 '25 01:11 alexeyv