Claude's Re-asking Code - AskUserQuestion Tool
Blog

Claude's Re-asking Code - AskUserQuestion Tool

https://www.facebook.com/hwidong.bae/
2026.01.18
·Web·by 네루
#LLM#Claude#Prompting#Tool Use#RAG

Key Points

  • 1The paper introduces Claude Code's new "AskUserQuestion" tool, enabling the AI to proactively ask users clarifying questions or gather preferences when faced with ambiguity or multiple valid options.
  • 2This interactive tool offers 2-4 predefined choices, allows for custom text input, and supports both single and multi-selection for various decisions like authentication methods or library choices.
  • 3Crucially, AskUserQuestion integrates with Claude's plan mode, allowing the AI to clarify fundamental ambiguities before planning or address implementation details during or after plan creation to ensure user alignment.

The paper discusses a critical prompting technique, "asking back" or iterative clarification, as the most effective method for interacting with large language models, primarily due to the inherent ambiguity of natural language. The author highlights their personal practice of incorporating "uncertainty maps" into research prompts, requesting the model to identify areas of low confidence, oversimplification, or missing information that could alter its perspective. Furthermore, they explicitly ask the model to pose clarifying questions if insufficient information prevents a useful response (e.g., about "Jobs to be Done").

A significant development is then introduced: the "Interactive Question Tool," officially named "AskUserQuestion," which was added to Claude Code 2.0.21. This tool empowers Claude Code to proactively seek user input when it encounters ambiguity in a query or identifies multiple valid response pathways.

The core methodology of the AskUserQuestion tool is detailed as follows:
The tool allows the model to ask the user between one and four questions during execution to gather preferences, clarify requirements, or obtain decisions on implementation choices.

Key Features:

  • Each question presents 2-4 predefined options for the user to select from.
  • An "Other" option is always available to allow users to provide custom text input.
  • Questions can be configured for single selection (default) or multiple selections using the multiSelect: true parameter.
  • Each option includes a label and a description to explain the choice.

Technical Structure of a Question (as provided by Claude):

{ "question": "The full question I'm asking", "header": "A short label (max 12 chars) displayed as a tag", "options": [ { "label": "Option 1 Label", "description": "Description of Option 1" }, { "label": "Option 2 Label", "description": "Description of Option 2" } // ... up to 4 options ], "multiSelect": false // or true }

Example Use Cases:
The tool is particularly useful for scenarios requiring user input on critical choices, such as:

  • Selecting an authentication method (e.g., OAuth, JWT, Session-based).
  • Choosing a specific library for a task (e.g., date-fns, dayjs, Luxon for date formatting).
  • Enabling multiple features via a multiSelect query.

The primary purpose is to prevent the model from making assumptions when facing multiple valid approaches or unclear requirements, especially for architectural decisions, library selections, or feature prioritization.

Integration with Plan Mode:
The paper emphasizes how AskUserQuestion integrates with Claude Code's plan mode, ensuring clarity throughout the planning and execution phases:

  1. Before Planning: If fundamental ambiguities exist that would significantly alter the overall plan, AskUserQuestion is invoked *before* the plan is generated. This ensures the resulting plan aligns precisely with the user's desired approach (e.g., clarifying the authentication method before planning an authentication system).
  2. During Planning: If initial requirements allow for plan creation but specific implementation details remain ambiguous, the model can create a plan noting these ambiguities. It then uses AskUserQuestion *before exiting plan mode* to clarify these details, updating the plan as necessary based on user feedback.
  3. After Plan Approval (During Execution): The tool can also be used for decision-making that arises during the actual implementation process, post-plan approval.

A key rule governing its use, derived from the ExitPlanMode tool instructions, states: "Before using this tool, ensure your plan is clear and unambiguous. If there are multiple valid approaches or unclear requirements, use the AskUserQuestion tool to clarify with the user first." This directive underscores the model's mandate to resolve fundamental ambiguities through user interaction prior to finalizing or acting upon a plan.