When Claude Code needs you to choose between options, it calls a tool named AskUserQuestion and waits for your pick. A PreToolUse hook that matches AskUserQuestion can answer instead of you, by returning the question with an answers field filled in. That is how you answer Claude Code's questions from your phone: a hook sends the question and its options to the phone, waits for your choice and hands it back. Claude Code Notifier does this on Mac, Windows and Linux with its ccn tool and phone app.
01What AskUserQuestion is
Sometimes Claude reaches a fork it should not decide alone. Which framework? Keep the old API or remove it? Fix the test or the code? Rather than guess, it asks a short multiple-choice question. In the terminal you see the question, a few labelled options with descriptions, and you pick one with the keyboard.
Like any tool call, AskUserQuestion passes through Claude Code's hooks first. That is the opening a remote answer needs.
Questions differ from permission prompts. A permission prompt asks yes or no about one action, and the PermissionRequest hook answers it (see Approve Claude Code permission requests from your phone). A question asks you to choose, and the answer is a label, not a yes.
02How a hook supplies the answer
A PreToolUse hook receives the tool's input as JSON on standard input. For AskUserQuestion, the input holds a questions array. Each question has question (the text), header (a short label), options (each with a label and description) and multiSelect.
Returning "allow" alone is not enough for this tool, because the answer has to come from somewhere. Anthropic's hooks reference says the hook must echo the questions back in updatedInput and add an answers object that maps each question's text to the chosen label:
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "allow",
"updatedInput": {
"questions": [
{
"question": "Which framework?",
"header": "Framework",
"options": [
{ "label": "React", "description": "Component library" },
{ "label": "Vue", "description": "Progressive framework" }
],
"multiSelect": false
}
],
"answers": { "Which framework?": "React" }
}
}
}
For a multi-select question, join the chosen labels with commas. If the hook prints nothing, the question appears in the terminal as normal.
Registering it
{
"hooks": {
"PreToolUse": [
{
"matcher": "AskUserQuestion",
"hooks": [
{ "type": "command", "command": "/path/to/your-answer-script" }
]
}
]
}
}
Put this in ~/.claude/settings.json to cover every project. For every hook event and where each one fits, see Claude Code hooks explained.
A note on non-interactive runs
In claude -p runs, Anthropic's docs say AskUserQuestion is offered only when the run has a permission host to receive the prompt, such as an Agent SDK canUseTool callback. In a plain scripted run, Claude may simply not ask. This guide is about interactive sessions.
03What makes a good phone answer
The JSON is the easy part. The design questions are the same ones that come up with permission prompts:
- Show the whole question. The header, the question and each option's description all matter. A label alone ("Option B") is no help on a lock screen.
- Keep the terminal usable. If you are at the computer, you should be able to answer there, not wait for a hook that is waiting for your phone.
- Give up cleanly. If no answer comes, the hook should return nothing before its timeout so the terminal prompt appears.
- Match the text exactly. The
answerskeys must be the question text as Claude wrote it, and the values must be the option labels.
04Using Claude Code Notifier
Claude Code Notifier is an independent tool by TouchTap Ltd, not made by Anthropic. Its command line tool, ccn, installs a PreToolUse hook on AskUserQuestion along with its other hooks. When Claude asks a question and you are away, your phone shows the question and its options. Tap one and the hook supplies the answer, and Claude carries on.
Install it on Mac or Linux:
curl -fsSL https://claudecodenotifier.com/install.sh | sh
or on Windows in PowerShell (beta):
irm https://claudecodenotifier.com/install.ps1 | iex
Then pair your phone by scanning the QR code or typing the app's 6-digit code. Connect your phone to Claude Code walks through it on each operating system.
Presence decides where you answer
ccn uses the same presence rule for questions as for permissions. If you typed in the last 30 seconds, the terminal asks as usual and the phone gets at most a note. If you are away, the terminal waits for the phone, up to a ceiling you choose (hold_ceiling_seconds, 30 to 3600, default 600), and stops waiting the moment you touch the keyboard.
Choosing what reaches your phone
Questions have their own setting, notify_on_question, separate from notify_on_permission and notify_on_done, so you can keep one kind and turn another off. ccn config show lists what is in effect, and most settings can also be changed per computer from the phone app.
Quiet hours apply too, for example ccn config set quiet_hours 22:00-08:00. See Quiet hours and Do Not Disturb.
Without a paired phone, ccn still shows a free desktop notification on the computer when Claude asks a question, so you know to come back. Answering from the phone needs the app, which is free to download and needs a subscription or lifetime purchase to use. See pricing.
05Questions, follow-ups and finishing
Questions are one of three moments where Claude waits for you. The other two are permission prompts and the end of a turn. Right after Claude finishes, Claude Code Notifier also lets you send the next instruction from the phone, which the Stop hook returns to Claude as its next instruction. Together they cover most of what keeps a long task waiting. Leave Claude Code running and walk away puts them into one routine.
06FAQ
Can I type a free-text answer instead of picking an option?
The documented hook route answers with option labels through the answers field. In Claude Code Notifier, you choose from the options on the phone. If none fits, leave the question for the terminal, or steer Claude with a follow-up once it finishes.
Why does my PreToolUse hook's "allow" not answer the question?
Because AskUserQuestion needs an answer, not just permission. Return updatedInput with the original questions and an answers object, as shown above.
What if Claude asks several questions at once?
The questions array can hold more than one. The answers object needs an entry for each question, keyed by its exact text.
Does it work in VS Code, Cursor or JetBrains?
The hook belongs to Claude Code, not to the terminal, so it fires in an IDE's built-in terminal too. See Claude Code notifications in VS Code, Cursor and JetBrains terminals.