Allow PreToolUse hooks to inject tool responses for AskUserQuestion
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:
- Intercept
AskUserQuestionviaPreToolUsehook - Send the question + options to ntfy (phone notification)
- User selects an option or types a response on their phone
- Hook returns the answer back to Claude Code as the tool result
Current Limitation
PreToolUse hooks only support:
permissionDecision: allow/deny/askupdatedInput: modify tool parametersadditionalContext: 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.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗