Allow PreToolUse hooks to inject tool responses for AskUserQuestion

Resolved 💬 3 comments Opened Mar 15, 2026 by gicaking Closed Mar 19, 2026

Feature Request

Allow PreToolUse (or PostToolUse) hooks to provide tool results for interactive tools like AskUserQuestion, enabling external notification services to capture user responses remotely.

Use Case

I have a self-hosted ntfy server integrated with Claude Code via PermissionRequest hooks (Allow/Deny buttons on phone). This works great.

However, AskUserQuestion (multi-option questions Claude asks) cannot be answered remotely — the user must be at the terminal. I'd like to:

  1. Intercept AskUserQuestion via PreToolUse hook
  2. Send the question + options to ntfy (phone notification)
  3. User selects an option or types a response on their phone
  4. Hook returns the answer back to Claude Code as the tool result

Current Limitation

PreToolUse hooks only support:

  • permissionDecision: allow/deny/ask
  • updatedInput: modify tool parameters
  • additionalContext: extra context for Claude

There is no field to inject a tool response (e.g., selected answers).

Proposed Solution

Add a toolResult or interceptedResponse field to PreToolUse hook output:

{
  "hookSpecificOutput": {
    "hookEventName": "PreToolUse",
    "toolResult": {
      "answers": {
        "Which approach?": "Option A"
      }
    }
  }
}

When this field is present, Claude Code would skip the interactive prompt and use the hook-provided response as the tool result.

Why This Matters

This would enable fully remote operation of Claude Code — permission requests AND interactive questions answered from a phone, without requiring terminal access. Combined with PermissionRequest hooks and TTS/notification hooks, this completes the remote control story for Claude Code.

View original on GitHub ↗

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