AskUserQuestion auto-completes with empty answers when listed in command allowed-tools
Bug Description
When AskUserQuestion is included in a command's YAML frontmatter allowed-tools list, the question UI does not render. Instead, the tool auto-completes with empty answers and proceeds silently.
Steps to Reproduce
- Create a command file with
allowed-toolsincludingAskUserQuestion:
---
name: test-command
allowed-tools:
- AskUserQuestion
---
# /test-command
## Turn 1
Use AskUserQuestion to ask the user:
**Question 1**: "What kind of app do you want to build?"
- **Todo app** — Productivity app
- **Budget app** — Finance tracking
## Turn 2
Print the answer.
- Run
/test-command - Expected: AskUserQuestion UI renders with selectable options
- Actual: "User answered Claude's questions:" appears with empty answers, no UI shown
Working Case
The same command without AskUserQuestion in allowed-tools (or without the frontmatter entirely) renders the question UI correctly:
---
name: test-command
allowed-tools:
- Read
- Write
---
This works as expected — the question picker UI appears and the user can select options.
Root Cause Hypothesis
allowed-tools auto-approves tool calls, which for most tools (Read, Write, Bash, etc.) is correct behavior. However, AskUserQuestion is a user interaction tool that requires UI rendering. Auto-approving it skips the UI and submits empty answers.
Environment
- Claude Code CLI (latest)
- macOS Darwin 25.2.0
- Tested across multiple fresh sessions — consistently reproducible
Workaround
Remove AskUserQuestion from the allowed-tools list. The tool still works correctly when not explicitly listed — it just requires normal user permission approval (which triggers the UI to render).
Note
This is a re-filing of #29955 which was closed. The bug is confirmed and reproducible. We tested with controlled pairs:
test-meta-yes.md(withAskUserQuestioninallowed-tools) → Bug: UI doesn't rendertest-meta-no.md(withoutAskUserQuestioninallowed-tools) → Works correctly
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗