AskUserQuestion returns empty answer when PreToolUse hook + skill allowed-tools are both present
Resolved 💬 8 comments Opened Mar 4, 2026 by littlebig1 Closed Apr 2, 2026
Bug Description
AskUserQuestion auto-approves and returns empty answers (just ".") when both conditions are true:
- A
PreToolUsehook is configured in settings.json - AskUserQuestion is listed in a skill/command's
allowed-toolsfrontmatter
Neither condition alone triggers the bug.
Reproduction
Environment: Claude Code v2.1.63, macOS
settings.json (PreToolUse hook):
"PreToolUse": [{
"hooks": [{
"type": "command",
"command": "bash ~/.claude/hooks/log-tool-use.sh",
"async": true
}]
}]
Command frontmatter (allowed-tools):
allowed-tools:
- AskUserQuestion
Test matrix:
| PreToolUse hook | AskUserQuestion in allowed-tools | Result |
|---|---|---|
| Yes | No (bare call) | Works |
| No | Yes (inside skill) | Works |
| Yes | Yes (inside skill) | Empty answer "." |
Expected Behavior
AskUserQuestion should render the question UI and wait for user input regardless of PreToolUse hooks.
Notes
- Related to #13439 (PreToolUse fix in v2.0.76) and #29547 (allowed-tools injection fix)
- The v2.0.76 fix appears to not cover the combined code path where
alwaysAllowRules(from allowed-tools injection) interacts with PreToolUse hook processing
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗