Model asks AskUserQuestion about "the output above" when that output only exists in a collapsed tool_result — user decides blind

Open 💬 0 comments Opened Jul 14, 2026 by doriru89

Summary

The model runs a tool (e.g. Bash printing 20 sample records), the TUI collapses the result to "Ran 1 shell command", and the model then calls AskUserQuestion with a question like "Do the 20 samples above justify the migration?". The user never saw the samples: the collapsed block is the only place they exist, and expanding via Ctrl+O is unreliable (#26954). The user is forced to approve or reject blind.

This is distinct from the display bugs already filed:

  • #26954 covers the expand failure, but even a working Ctrl+O would require the user to know there is something worth expanding.
  • #66960 covers AskUserQuestion referencing unshown findings (model-side summary gap).
  • #72509 covers stderr/output visible to the model but not the user.

The compounding failure here is the model's world model: it treats "in my context" as "on the user's screen" and phrases decision questions with deixis ("above", "the samples") pointing at content the TUI hid. Each piece is a known issue; the combination turns a rendering annoyance into silent wrong decisions.

Repro (observed in real sessions)

  1. Ask Claude to spot-check a batch operation ("print 20 samples, then ask me whether to proceed").
  2. Claude runs Bash; TUI shows "Ran 1 shell command" (collapsed; 3,589 chars inside).
  3. Claude immediately calls AskUserQuestion: "Do the 20 samples above justify…" with zero assistant text in between.
  4. User sees the question but no samples; Ctrl+O expansion fails per #26954.

Frequency: scanning our 50 most recent sessions found 7 instances of this exact signature (AskUserQuestion containing a referential term + <500 visible assistant chars since the last user turn + tool_result bulk >2× visible text) out of 69 AskUserQuestion calls.

Suggested directions (any one would help)

  1. Model-side: system-prompt guidance that tool_results are collapsed on screen, so evidence a decision depends on must be restated in the visible reply before AskUserQuestion (we patched this locally in CLAUDE.md; production precedents: kimaki, miniclaw system prompts for remote channels).
  2. Client-side: when an AskUserQuestion arrives within N tokens of a tool_result and no assistant text in between, auto-expand that tool_result (or show a "evidence hidden above" affordance).
  3. API/tool-side: let AskUserQuestion carry an evidence payload that the TUI must render with the question (ACP already types tool-call content as {diff|terminal|content}).

Environment

  • claude-code (TUI), macOS, Ghostty — but the signature is renderer-independent; any client that collapses tool_results reproduces it.

View original on GitHub ↗