DEV Community

Cover image for How to tell when Claude Code is waiting on your answer
Odi Paneth
Odi Paneth

Posted on Originally published at claudictive.com AI-assisted

How to tell when Claude Code is waiting on your answer

Originally published on claudictive.com.

To know when Claude Code is waiting on your answer, add a PreToolUse hook with the matcher AskUserQuestion: it fires the moment Claude asks, before the picker appears. Add PermissionRequest for approvals and Stop for a finished turn. The harder part is an alert you notice and can act on while you are somewhere else.

I build Claudictive, an in-game overlay for Claude Code, with Claude Code itself. The first half of this post is the hook setup anyone can use. The second half is what went wrong for us, and what Claude and I changed.

How do I get an alert when Claude Code asks a question?

AskUserQuestion is the tool Claude calls when it wants you to pick from options. The hooks reference describes it as asking "the user one to four multiple-choice questions", and it reaches PreToolUse like any other tool call.

People asked for this signal in several issues. Issue 13024 and issue 10168 both asked for a hook that fires when Claude is waiting on you; 13024 is titled "Add hook for when Claude is waiting for user input". On 2026-08-17 a Claude Code maintainer closed both as completed, with this answer:

  • a PreToolUse hook with matcher AskUserQuestion "fires the moment Claude calls it, before the picker appears";
  • the PermissionRequest hook fires immediately when Claude asks for a permission, unlike Notification with permission_prompt, which waits about six seconds;
  • the Stop hook covers a finished turn.

A minimal setup in settings.json, built from the shape in the docs:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "AskUserQuestion|ExitPlanMode",
        "hooks": [{ "type": "command", "command": "your-question-alert" }]
      }
    ],
    "PermissionRequest": [
      { "hooks": [{ "type": "command", "command": "your-approval-alert" }] }
    ],
    "Stop": [
      { "hooks": [{ "type": "command", "command": "your-done-alert" }] }
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

Two details from the docs that matter here:

  • A matcher made only of letters, digits and | is a list of exact tool names, so AskUserQuestion|ExitPlanMode also catches plan approvals. The docs list both tools as ones that "require user interaction".
  • A group with no matcher runs for every event of that type.

Why doesn't the Notification hook tell you about questions?

Because no Notification type is documented for a foreground AskUserQuestion. The hooks reference lists more than a dozen types. Among them:

  • permission_prompt: Claude needs an approval "and the prompt has waited about six seconds".
  • idle_prompt: "Claude finished responding about 60 seconds ago and you haven't typed since".
  • agent_needs_input: a background session starts waiting on your input while agent view is open in a terminal, plus a few other waits such as an agent team teammate's terminal setup question.
  • elicitation_dialog and elicitation_url_dialog: an MCP server waiting on your input.

None of these is described as firing for a foreground AskUserQuestion. Stop does not settle it either: its input carries stop_hook_active, last_assistant_message, background_tasks and session_crons, and nothing says whether the turn ended on a question. Issue 93872, "No hook signal distinguishes 'turn complete' from 'turn ended awaiting a user answer/selection'", asks for exactly that field. It was open with no maintainer reply when I checked on 2026-11-14.

User reports about Notification and questions also disagree with each other. Issue 74052 reported questions firing Notification as permission_prompt. Issue 51882 and issue 59908 reported no Notification at all, and issue 66704 reported no Stop while a question waits. All four were closed for inactivity, not fixed. With reports going both ways, I would not build a question alert on Notification or Stop. PreToolUse is the documented signal, and it is immediate.

How do I tell "Claude asked me something" from "Claude is done"?

Treat them as two different events, and only make noise for the first.

Claudictive already reads each session's transcript to show the session in the overlay, so its poller looks for the question there, as our choice: when the last assistant turn holds an AskUserQuestion tool call, the session is waiting on you. The check in the shipped code is short:

const hasAskUser = blocks.some(
  (b) =>
    b.type === 'tool_use' &&
    (b.name === 'AskUserQuestion' || b.name === 'ask_user' || b.name === 'AskUser'),
);
if (hasAskUser) return 'needs-input';
Enter fullscreen mode Exit fullscreen mode

Subagent turns land in the same transcript, marked isSidechain: true, so the poller skips them when it looks for the last line. Otherwise a subagent finishing would make the session look idle.

Each wait then carries a reason: question when the transcript shows an AskUserQuestion, notification when it is Claude Code's idle "waiting for your input" prompt. Only question raises the in-game chip and the chime. A finished turn is not urgent; a question blocks the whole run.

There is one more gate: the alert only plays while the game is running and focused and the overlay is shown, so the overlay hotkey silences it. That version was verified in game before it was committed.

If you build on hooks instead, the same split works: set your alert in PreToolUse for AskUserQuestion, and clear it in PostToolUse with the same matcher, which the docs say runs after the tool succeeds, so after the question is answered. A declined or escaped question never reaches PostToolUse, so give the alert a fallback too, such as clearing it on your next prompt (UserPromptSubmit) or after a timeout.

Why does a missed question cost so much?

This is where Claudictive started. I wanted to play, specifically Total War: Shogun 2, and I had no second screen. Clicking off the game made it lose focus and minimize. At the time I was building a small feedback tool for vibe coders, and the Claude Code sessions took a long time. I wanted to step away and play while they ran, but they kept needing me.

I tried long-running setups first, including the get-shit-done (GSD) workflow, even in YOLO mode. It did not work: permissions, asks and questions were a constant issue, several every session. That is where the idea came up, last year. I was sure I would find a generic solution, and there was none I could find.

Once, before Claudictive existed, I came back from a League of Legends match and found Claude had barely started. It had asked something basic and waited, and I had missed it completely. Mostly I got angry: I wanted things to work for me, and "now I need to keep babysitting my agent".

Why question alerts matter to me, in one line: "I just want to dev asap as a vibe coder, I want to make sure everything is going smoothly."

What went wrong: a 22-minute wait nobody saw

Later, with Claudictive already running, one of my sessions sat on a question for 22 minutes.

The poller had detected the question. Nothing showed it:

  • the session pill's only cue was a 1 px border, because the pill's !important box-shadow overrode the pulse animation;
  • the status line said "CLI busy", which reads as "leave it alone";
  • no chip or chime listened for the waiting state at all.

The fix Claude and I shipped routes a waiting question into the same alert as a permission request: a "Claude has a question" chip that names the project, the same chime schedule, and no Allow or Deny hint. It clears when the question is answered, when the session exits, or after an hour. The status line now says "Waiting for you", and the pulse moved to a pseudo-element so the pill's own shadow cannot hide it.

The lesson: detection was fine. The display was not. If you build your own alert, check that it is visible from where you actually are, not just that it fires.

Can you answer a Claude Code question without the terminal?

Yes, and the docs now say how. A PreToolUse hook can answer an AskUserQuestion itself: it returns permissionDecision: "allow" together with an updatedInput that echoes the original questions array and adds an answers object mapping each question's text to the chosen label. The docs are explicit that "Returning "allow" alone is not sufficient for these tools." PermissionRequest hooks need the same updatedInput.

{
  "hookSpecificOutput": {
    "hookEventName": "PreToolUse",
    "permissionDecision": "allow",
    "updatedInput": {
      "questions": [{ "question": "Which framework?", "header": "Framework", "options": [{ "label": "React" }, { "label": "Vue" }], "multiSelect": false }],
      "answers": { "Which framework?": "React" }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

We hit the "allow is not enough" wall in an early Claudictive build: an allow from our approval path could not dismiss the question dialog, so the question sat unanswerable in the terminal. Claudictive now takes a different route. With your consent, it uses a small Claude Code mod, and when the overlay is driving a session, the mod hooks the AskUserQuestion tool call itself. It races the terminal dialog against the overlay's answer and returns the pick as the tool's result. Whichever side you answer first wins. The mod never denies a question, and if anything on its side fails, you get the normal terminal dialog.

In the overlay the question shows as a card with its options. You click one, type its number, or type your own words in the chat box. The chip also tells you where to answer: "answer here" when the session is driven from the overlay, "answer in your terminal" when it is not. The same flow covers permissions; the details are on the page for approving Claude Code permissions in game.

The overlay is not tied to one game: it runs in games Overwolf supports, like World of Warcraft, Valorant or Fortnite, not only the two I play.

A Claude Code question card in the Claudictive overlay: "Claude is waiting for you", the question and three numbered options, over a Total War: Shogun 2 campaign map

Real capture from a development build: Claudictive over my Total War: Shogun 2 campaign, on a demo project. A file path is blurred.

With several Claude Code sessions, which one is asking?

Once every terminal had its own tab in the game, a new gap showed up. I found it in an in-game test in Total War: Shogun 2, and my note from that test was: "tab A1 has a permission/question request, but I am in tab B, have a UI component that should grab my attention as well as the chime".

There were two candidates: a line above the tabs, or the waiting tab itself. I judged the line poor UX and picked the tab. Now, when a tab with a question or an approval is not the one you are looking at, it turns amber and pulses (it stays static if your system asks for reduced motion). Its chime keeps going until you open that tab, answer it, or it expires.

The same change fixed two chime bugs:

  • typing in tab B counted as activity and silenced the request from tab A, though typing elsewhere is no answer;
  • a question counted as "on screen" whenever the chat was expanded on any tab, so it never chimed. Now it only counts on its own tab.

Claude is a co-author on the commits behind the question chip, the question card, answering from the overlay and the amber tab. The in-game tests were mine, and so was the call on the amber tab. More on the alert types is on the Claude Code notifications page.

Checklist: building your own question alert

  • Hook PreToolUse with matcher AskUserQuestion, and add ExitPlanMode if you want plan approvals too. Use PermissionRequest for approvals and Stop for a finished turn.
  • Do not rely on Notification for questions. No documented type covers them, and user reports disagree.
  • Keep "Claude asked me something" separate from "Claude is done". Alert loudly on the first, quietly or not at all on the second.
  • Make the alert visible where you are. Ours was detected and drawn as a 1 px border.
  • To answer from somewhere else, return "allow" with updatedInput that echoes questions and adds answers. "allow" alone leaves the dialog open.
  • Clear the alert in PostToolUse when the question is answered, and add a fallback (your next prompt, or a timeout) for a question you decline or escape, since PostToolUse only runs after a successful tool call. Claudictive's chip also clears when the session exits or after an hour.

Top comments (0)