Guide · November 2026

Overnight Claude Code stuck on a question

Even if you tell it “don't ask, just keep going” before bed, one multiple-choice question (AskUserQuestion) from Claude Code makes it wait there until morning. Here's how to block the question dialog with a hook so Claude takes its recommended option, and review those choices in the morning.

Lidnight keeps your Mac awake only while Claude Code or Codex is working, even with the lid closed, and lets it sleep when they finish.

Download freePro trial included · no card · Apple Silicon, macOS 13+

Why it happens

AskUserQuestion is the tool Claude uses to show you options and collect an answer, so once its dialog opens, that turn stops until someone answers. Telling it “don't ask” in the prompt doesn't stop the model from calling the tool, and one call is enough to halt the whole overnight run.

Reports kept coming over the last two weeks: an overnight session stopped on a question dialog late in the evening and did nothing for about eight hours while part of a weekly allowance went unused (#111322); five nights in a row the work wasn't done by morning (#110898); and a request noting that questions scroll away or stop the turn until answered (#111205). There's no official “unattended mode” yet (as of 2026-11-25).

Fix it yourself: refuse questions only while you’re away

A PreToolUse hook runs before a tool does. Returning permissionDecision: "deny" blocks the call, and the text in permissionDecisionReason is passed to Claude as the result (official ‘Hooks’ docs). So you can block the question and tell Claude to take its recommendation and write it down. You still want questions during the day, so block them only while a marker file exists.

1. Save this as ~/.claude/hooks/no-questions.sh.

#!/bin/sh
[ -f "$HOME/.claude/away" ] || exit 0
cat <<'J'
{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"Nobody is at the keyboard until morning. Do not ask. Choose the option you would recommend, append the question and your choice to OPEN_QUESTIONS.md in the project, and keep working."}}
J

2. Add it under hooks in ~/.claude/settings.json (if you already have hooks, add just this one entry to the PreToolUse array). Restart sessions that were already open to be sure it applies.

{
  "hooks": {
    "PreToolUse": [
      { "matcher": "AskUserQuestion",
        "hooks": [{ "type": "command", "command": "sh ~/.claude/hooks/no-questions.sh" }] }
    ]
  }
}

3. Before bed, touch ~/.claude/away; when you're back, rm ~/.claude/away. The marker is checked on every question, so it takes effect in sessions that are already running. In the morning, read each project's OPEN_QUESTIONS.md to see what Claude chose for you and undo anything you disagree with.

If you run claude -p: per the official docs, non-interactive (-p) runs don't offer AskUserQuestion at all unless something can receive the prompt (such as an Agent SDK canUseTool callback). Handing overnight work to -p from the start is another option.

Limits: this hook only blocks the multiple-choice question tool. It doesn't stop Claude from writing a question as plain text and ending its turn, permission prompts for running commands, or wait loops that never end (the other nights in #110898). Permission prompts need allow rules set in advance or an answer from somewhere else. Claude's recommended option can also be wrong, so keep hard-to-undo work (deploys, deletions, merges) off the overnight list. If you forget to remove the marker, it keeps going without asking during the day too.

With Lidnight

If you'd rather answer than block: Lidnight gets each session's state through Claude Code hooks and shows it in the menu bar window. When a multiple-choice question arrives, that session is marked “Needs reply” and you can pick an answer right in the menu bar window (answering in the terminal works too). With Pro, approvals and questions reach your phone and you can answer there. When you're back, a report shows what you asked for, how it went and any errors. Free works with the lid open; running with the lid closed is Pro. Used together with the hook above, questions are blocked while the marker exists, so they won't reach Lidnight either. It doesn't answer for you or fix why Claude stopped. Approve Claude Code requests from your phone

Checked 2026-11-25 against Claude Code's official ‘Hooks’ docs (code.claude.com/docs/en/hooks), the issues above and Claude Code 2.1.330. The hook script's output was checked by running it. Things change; check the docs.

Try Lidnight free

Apple Silicon Macs · macOS 13 or later. Every download includes a free trial of everything in Pro (5 lid-closed runs or 14 days), no payment details needed. Pro is a one-time payment (1 Mac $9.99 · 3 Macs $14.99, 50% off through Dec 1) with a 14-day refund.

Download freeBuy Pro ›More about Lidnight ›

Homebrew: brew install whereisdw/tap/lidnight