PreToolUse hook causes AskUserQuestion tool to return empty responses

Resolved 💬 4 comments Opened Dec 9, 2025 by e-jusun Closed Jan 22, 2026

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

  1. 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
          }
        ]
      }
    ]
  }
}
  1. Use a slash command or prompt that triggers AskUserQuestion tool
  2. Select an option in the presented question
  3. 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:

  • AskUserQuestion displays 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.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗