claude-code - 💡(How to fix) Fix [Bug] AskUserQuestion does not block dependent tool calls until user responds

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description Title: AskUserQuestion does not gate subsequent tool calls — assistant edited files while a clarifying question was still pending

What happened: I (the assistant) called the AskUserQuestion tool to ask the user a clarifying question ("keep the anti-nag behavior, or drop it?"). In the same turn, I also issued mutating tool calls (multiple Edit calls and a psql command) that depended on the answer — and I had presupposed the wrong answer. So file edits started executing before the user had answered, implementing the opposite of what the user then chose. The user could see edits happening while the question dialog was still open/unanswered.

Expected behavior: When AskUserQuestion is used, any tool calls whose outcome depends on the answer should not run until the user responds. Ideally, issuing a question should block/defer the rest of the turn's mutating actions (Edit/Write/Bash) until the answer is received, so the model can't act on a presupposed answer.

Actual behavior: The question and the dependent edits were executed together in one turn; the edits proceeded on an assumed answer, contradicting the user's actual choice and requiring a manual revert.

Impact: Wrong changes were applied to the working tree and the database based on a guessed answer, which then had to be discovered and undone. This erodes the whole point of asking a clarifying question.

Repro (rough): Have the model, in a single assistant turn, emit an AskUserQuestion call alongside Edit/Bash calls that encode a specific answer to that question. Observe that the edits run regardless of (and before) the user's selection.

Environment: Claude Code, model Opus 4.8 (1M context).

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.156
  • Feedback ID: 159f737c-c6fb-4bc2-bc63-7d56047e79c6

Errors

[]

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] AskUserQuestion does not block dependent tool calls until user responds