PreToolUse hook causes AskUserQuestion tool to return empty responses

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Dec 9, 2025 · 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 ↗

4 Comments

e-jusun · 10 months ago

it reacts like this below.
User answered Claude's questions:
⎿
And then It seemed it choose one of the choices without my permission.

kitaekatt · 9 months ago

This appears to be the same issue as #12031.

I can confirm this bug is resolved in Claude Code version 2.0.76.

Validated on January 3-4, 2026 with 17 active PreToolUse hooks - all test cases (single select, multi-select, custom "Other" input) now return answer data correctly.

If you're still experiencing empty responses, please verify you're on version 2.0.76 or later (claude --version).

e-jusun · 8 months ago

Thanks @kitaekatt
It's fixed, I tested with the same condition that caused the bug.

github-actions[bot] · 8 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.