When Codex needs you to choose between options, it calls a tool named request_user_input and waits for your answer, most often in plan mode. Codex runs a PreToolUse hook before that tool, so a hook can send the question to your phone, wait for your pick, then block the tool call with your answer as the reason. The model reads the reason and carries on as if you had answered in the terminal. Notifier for Codex does this on Mac, Windows and Linux with its codex-notifier tool and phone app.
01When Codex asks questions
Codex asks structured questions through request_user_input: a question, a short header, and a few options, sometimes with room for your own answer. You see them most in plan mode (/plan), where Codex works out an approach with you before changing anything, for example "Which database should the migration run against?" with "staging" and "local" as options.
In the default mode, Codex usually just asks in its reply and ends the turn instead. That case is a finished turn, not a question tool, so you answer it with a follow-up message. Both are covered below.
02Why a hook can answer
PreToolUse runs before most local tools, and request_user_input is one of them. The hook gets the questions in tool_input, and it can deny the tool call with a reason:
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "deny",
"permissionDecisionReason": "The user has already answered on their phone. Their answers:\n- Which database should the migration run against?: staging\nContinue with these answers."
}
}
Codex's question tool reads its answers from the terminal, not from its input, so a hook can't fill the answer in directly. Blocking the call with the answer as the reason works because the model reads the reason as the tool's result. The wording matters: say plainly that the user has answered and the model should not ask again.
If the hook prints nothing, the question appears in the terminal as normal.
03The quick way: Notifier for Codex
Notifier for Codex is an independent app (not made by or affiliated with OpenAI). Its free codex-notifier tool adds the hooks for you on Mac, Windows and Linux, and its iPhone and Android app shows the question.
- Install the app and add a computer. The app shows a 6-digit code and the line to run.
- Run the line on your computer, for example on Mac or Linux:
curl -fsSL https://notifierforcodex.com/install.sh | sh -s 482913
- Use
codexas usual. When Codex asks a question and you're away, it appears on your phone.
On the phone you can tap one of Codex's options or type your own answer. Several questions at once are answered together. The answer goes back through the hook, and Codex continues.
Questions Codex marks as secret never leave your computer. They are always answered in the terminal.
04The other kind of question: a finished turn
Often Codex ends a turn with a question in plain text: "Shall I also update the docs?" That is a Stop event, not a tool call. Notifier for Codex's "Codex has finished" push includes a reply box. Type "yes, update the docs" and the Stop hook returns it as Codex's next instruction, so the session carries on without you going back to the keyboard. You have two minutes after the turn ends by default (stop_hold_seconds; 0 turns it off).
05When the phone is asked
Questions follow the same presence rule as approvals:
- If you typed in the last 30 seconds, nothing waits and the question appears in the terminal.
- If you're away, Codex waits for your answer, up to
hold_ceiling_seconds(10 minutes by default). - Touch the keyboard and the wait ends; answer in the terminal.
- If nobody answers in time, the question appears in the terminal as normal. Nothing is chosen for you.
To stop questions going to the phone but keep everything else, run codex-notifier config set notify_on_question off.
06Doing it yourself
A hand-built version needs the same pieces as remote approval: a PreToolUse hook with "matcher": "request_user_input", a way to show the options on your phone and collect a reply, a wait with a timeout, and the deny-with-reason output above. Set the handler's timeout longer than your wait. If you only want to know that Codex is asking, a PreToolUse hook that posts to ntfy and prints nothing is enough.
07FAQ
Why does the hook "deny" the question? Isn't that an error?
It's the documented way for a PreToolUse hook to stop a tool call and hand the model a message. The tool call doesn't run, and the model reads your answer from the reason and carries on.
Will Codex ask the same question again in the terminal?
Not if the reason says clearly that you've already answered. Models follow that well, but it is model behaviour, not a guarantee.
Do I get questions in the default mode?
Rarely as a question tool. In the default mode Codex usually asks in its reply and stops, which you answer with a follow-up. In plan mode it uses request_user_input.
Can I answer from an Apple Watch or a widget?
No. Answers come from the iPhone or Android app.
Does answering from the phone work over SSH or in tmux?
Yes. Answers go back through Codex's own hooks, so they work in any terminal, including SSH sessions and tmux.