PreToolUse hook causes AskUserQuestion tool to return empty responses
Description
When a PreToolUse hook is configured in .claude/settings.local.json, the AskUserQuestion tool returns empty responses. The user selections are not captured, and the tool result shows empty answers.
Environment
- OS: macOS (Darwin 24.6.0)
- Claude Code: Latest version
Steps to Reproduce
- Configure a PreToolUse hook in
.claude/settings.local.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "node .claude/hooks/pre-tool-use.js",
"timeout": 5
}
]
}
]
}
}
- Use a slash command or prompt that triggers
AskUserQuestiontool - Select an option in the presented question
- Observe that the response comes back empty
Expected Behavior
AskUserQuestion should capture user selections and return them properly, regardless of PreToolUse hook configuration.
Actual Behavior
When PreToolUse hook is enabled:
AskUserQuestiondisplays options correctly- User can select an option
- But the tool result returns empty (no answer captured)
- Claude proceeds as if no selection was made
Workaround
Removing the PreToolUse hook from settings resolves the issue:
{
"hooks": {
"UserPromptSubmit": [...], // Works fine
"PostToolUse": [...] // Works fine
// PreToolUse removed
}
}
Additional Testing
| Hook Configuration | AskUserQuestion |
|-------------------|-----------------|
| PreToolUse only | ❌ Empty response |
| UserPromptSubmit only | ✅ Works |
| PostToolUse only | ✅ Works |
| UserPromptSubmit + PostToolUse | ✅ Works |
| PreToolUse + UserPromptSubmit | ❌ Empty response |
Hypothesis
There may be a stdin/stdout conflict between the PreToolUse hook's JSON processing and AskUserQuestion's interactive input handling.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗