AskUserQuestion tool doesn't render interactive UI — returns empty response immediately

Open 💬 17 comments Opened Feb 28, 2026 by petter-b

Description

The AskUserQuestion tool does not render any interactive UI (question text, selectable options). Instead, it immediately returns with "User answered Claude's questions:" and an empty/blank answer, skipping the interactive selection entirely.

Steps to Reproduce

  1. Start a Claude Code session
  2. Ask Claude to use the AskUserQuestion tool (e.g., "Can you ask me something?")
  3. Claude calls AskUserQuestion with a question and multiple options
  4. Expected: An interactive UI appears showing the question and selectable options
  5. Actual: No UI is shown. The tool immediately returns with an empty response

Observed Behavior

The conversation flow looks like this:

> Can you ask me something, I want to check if the ask-user-question tool works

● Sure, let me test for you.

● User answered Claude's questions:
  (empty)

● The AskUserQuestion tool is working. It presented you with the question...

The question and options are never displayed. The tool returns as if the user answered, but with no content.

Environment

  • Claude Code version: 2.1.63
  • Platform: macOS (Darwin 25.3.0, Apple M4)
  • Shell: zsh

Additional Context

A screenshot is available showing the exact behavior — will be added as a follow-up comment.

View original on GitHub ↗

17 Comments

petter-b · 4 months ago

<img width="1030" height="194" alt="Image" src="https://github.com/user-attachments/assets/44db4baf-a84a-4379-afe6-57a5cf16f44c" />

MickaelV0 · 4 months ago

same issue here ! https://github.com/anthropics/claude-code/issues/29547

But only in a context of a /skill

monsterhxw · 4 months ago

I have the same issue.

terrylica · 4 months ago

Root Cause Found + Fix

I tracked this down to a PreToolUse hook with a wildcard matcher (*) returning updatedInput for ALL tools, which silently corrupts the AskUserQuestion input schema.

The Problem

When a PreToolUse hook returns updatedInput in its response, Claude Code replaces the tool's entire input with that object. If the hook injects extra properties (like env) into updatedInput for every tool call, it corrupts tools whose schema doesn't expect those properties.

For AskUserQuestion, the expected input is:

{"questions": [{"question": "...", "options": [...]}]}

But the hook was producing:

{"questions": [{"question": "...", "options": [...]}], "env": {"TERM": "dumb", "NO_PAGER": "1", ...}}

The extra env key causes the interactive UI to not render — the tool returns immediately with empty answers.

Minimal Reproduction

Any PreToolUse hook with:

  1. matcher: "" (empty string = matches all tools), and
  2. Returns updatedInput with injected properties (even if the properties are unrelated to the tool)

...will break AskUserQuestion, TaskCreate, and other UI tools.

The Fix (Hook Authors)

Never return updatedInput for tools that don't need input mutation. Use a passthrough allowlist:

const PASSTHROUGH_TOOLS = new Set([
  "AskUserQuestion", "EnterPlanMode", "ExitPlanMode",
  "TaskCreate", "TaskUpdate", "TaskList", "TaskGet",
  "Read", "Glob", "Grep", "WebSearch", "WebFetch",
  "Agent", "Skill",
]);

async function main() {
  const input = parseStdin();
  
  // UI/metadata tools: allow without mutation
  if (PASSTHROUGH_TOOLS.has(input.tool_name)) {
    console.log(JSON.stringify({
      hookSpecificOutput: {
        hookEventName: "PreToolUse",
        permissionDecision: "allow"
      }
    }));
    return;
  }

  // Only mutate tools that actually need it (e.g., Bash)
  // ...
}

Suggestion for Claude Code Team

Claude Code should strip unknown properties from updatedInput before applying it, using each tool's schema as a filter. This would make hooks forward-compatible and prevent this class of bugs entirely. Alternatively, validate that updatedInput only contains keys present in the tool's parameter schema, and warn/ignore extras.

Fix Applied

I've published the fix in terrylica/cc-skills v11.63.1 — the pretooluse-subprocess-stdin-inlet-guard.ts hook now uses a PASSTHROUGH_TOOLS set to skip UI tools entirely.

Related closed issues: #13439, #10400

petter-b · 4 months ago

Downgrading to 2.1.62 ia another "fix".

<img width="1026" height="454" alt="Image" src="https://github.com/user-attachments/assets/bd8f553a-5aec-4cfe-9b7d-383349af88ea" />

monsterhxw · 4 months ago

My Workaround: Remove AskUserQuestion from the skill's allowed-tools frontmatter. The tool then works normally under default permissions.

petter-b · 4 months ago
My Workaround: Remove AskUserQuestion from the skill's allowed-tools frontmatter. The tool then works normally under default permissions.

It's not just a problem with skills. AskUserQuestion does not work at all.

uppinote20 · 4 months ago

Additional case: No PreToolUse hooks, same behavior

Environment:

  • Claude Code v2.1.63
  • macOS (darwin)
  • No PreToolUse hooks configured (hooks: {} in all settings files)
  • Plugin skill with AskUserQuestion in allowed-tools

Same symptom: AskUserQuestion returns empty answers immediately without rendering UI.

This suggests the bug has another trigger path beyond the PreToolUse hook corruption described above.

Workaround (removing AskUserQuestion from allowed-tools) works for getting responses, but markdown preview rendering degrades — multi-line previews show as "N lines hidden".

Without AskUserQuestion in allowed-tools (degraded — "N lines hidden"):
<img width="1209" height="313" alt="Image" src="https://github.com/user-attachments/assets/cb042817-bb2b-4a16-8e14-17428000ee4c" />

With AskUserQuestion in allowed-tools (detailed markdown preview):
<img width="1229" height="348" alt="Image" src="https://github.com/user-attachments/assets/87c0dfed-9de0-4f21-8afc-18d0adc9a1b3" />

cpflow · 4 months ago

experiencing same issue. AskUserQuestion is broken

pandel · 4 months ago

+1, Claude Code 2.1.63, can be avoided in my case when I don't bypass permissions aka --dangerously-skip-permissions.

adit-dt · 4 months ago

So, the out-of-the-box solution for now will be to remove the AskUserQuestion tool from the list of allowed tools?

trolle4 · 4 months ago

Works again in v2.1.66

trolle4 · 4 months ago
Works again in v2.1.66

Not with /gsd though :(

guiracine · 4 months ago

v2.1.66 still has the issue for me. Removing AskUserQuestion from the allowed-tools is the fix I use.

Meme-Theory · 4 months ago

I had to troubleshoot through this. If you have the skill give a pause, and ensure there are AT LEAST TWO ANSWERS, it will work. I had a 5 question list in a skill, and the first one would get stepped on by the skill progression - the pause gate fixed that. Add a "Type Ok to continue" prompt to the skill before the questions. (You can type anything; just need the pause and user nudge to keep going).

I used this in the skill prompt:
Rules:

Each AskUserQuestion call: questions array length = 1.
Each question: 2-4 options with short labels (under 8 words) and short descriptions (under 20 words).
Wait for the user's answer before calling AskUserQuestion again.
When presenting complex information (menus, spec lists), print it as plain text output FIRST, then ask a simple approval/selection question separately.
If you need to collect 5 inputs, that's 5 separate AskUserQuestion calls in sequence — not 1 call with 5 questions.
NO QUESTIONS IN THE FIRST RESPONSE. After a skill loads, AskUserQuestion is broken for the entire first agent response turn — the UI silently drops every prompt. The SKILL.md injection poisons the rendering pipeline for that turn. The fix: in your first response after the skill loads, ONLY output plain text (pre-flight status, Phase 0 results, a "ready to begin" message). Do NOT call AskUserQuestion. End your first response with a prompt like "Ready — press Enter to start." The user's reply creates a turn boundary, and AskUserQuestion works normally from the second response onward.

pandel · 4 months ago
v2.1.66 still has the issue for me. Removing AskUserQuestion from the allowed-tools is the fix I use.

Not necessary, downgrade to 2.1.62 and everything is fine.

AdishAssain · 2 months ago

+1, seeing this on Claude Code 2.1.121, macOS (Darwin 25.4.0), zsh, inside Cursor's integrated terminal (TERM_PROGRAM=vscode, TERM=xterm-256color).

Behaviour is intermittent within the same terminal — some sessions the interactive card UI renders fine, others it silently falls back to plain-text numbered options. No pattern I can pin to a specific trigger (no piped input, stdin clean, hooks exit cleanly with stdin closed).

Two questions for the maintainers if there's any guidance:

  1. Is there a setting or env var to force-enable the interactive picker, so it errors loudly instead of silently falling through to text? Even a debug flag would help users self-diagnose.
  1. Is the text fallback intentional as a token/context optimisation (e.g. avoiding the extra tool-result roundtrip), or is it purely a rendering failure path? Asking because if interactive mode costs meaningfully more tokens or latency, that's a tradeoff worth documenting; if not, the silent fallback is just a bug.

Happy to provide more repro detail if useful.