Background job sessions: assistant text written before AskUserQuestion is not shown to the user
Environment
- Claude Code 2.1.175 (CLI), Linux (WSL2)
- Session running as a background job, with the user interacting live in it
What happened
A skill instructs the model to present content (a design section, ~200 words of markdown) and then call AskUserQuestion about that content in the same turn ("Here's section 2 — look right so far?").
In the background-job session, the user received the AskUserQuestion prompt and could answer it, but the prose written before the tool call was never displayed. The user answered several questions about content they had never seen before reporting "the plan isn't showing up for me."
The background-session system reminder injected into the model's context acknowledges this: "Text you write between tool calls may not be shown to the user. Everything the user needs from this turn … must be in the final text message of your turn, with no tool calls after it." But AskUserQuestion is inherently a mid-turn interactive prompt, and present-then-ask is its natural usage pattern — the two guarantees collide, and the question renders while its context silently doesn't.
Expected
Either:
- Mid-turn assistant text renders in the background-jobs view (at minimum, text from the same turn as a pending
AskUserQuestion), or - The behavior is publicly documented so skill/prompt authors can design for it. Today the docs don't mention differential rendering for background sessions, and the
AskUserQuestionentry in the tools reference doesn't document thepreview/option-description fields that serve as the escape hatch (putting the content inside the question).
Workarounds we adopted
- End the turn with the content and collect the answer as a plain chat reply (loses the structured option picker).
- Embed the content in the
AskUserQuestionitself via optionpreviewfields.
Happy to provide more detail if useful.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗