[BUG] AskUserQuestion preview: 'n'+Enter drops highlighted option, ships only the note
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
When AskUserQuestion is invoked with at least one option whose preview field is set, the UI switches to side-by-side layout (option list on the left, preview pane on the right) and exposes an "add note" affordance on every option (the n keybinding). Pressing n on a highlighted option opens note-editing mode. Typing a note and pressing Enter once submits the entire response as (no option selected) notes: <text>.
The typed note text is preserved, but the highlighted option — and with it the binding indicating which option the note belongs to — is dropped.
Plain AskUserQuestion invocations (where no option has a preview field) are not affected.
What Should Happen?
The flow should be a clean two-step interaction:
- Arrow to highlight an option.
- Press
n→ note-editing mode opens. - Type the note.
- Press Enter → exits note mode; the note is saved bound to the highlighted option; the user is returned to option-navigation mode and can still arrow to change selection or revise notes on other options.
- Press Enter again (option highlighted, not in note mode) → submits the response:
<highlighted option>+ note.
Current behavior collapses steps 4 and 5 into a single Enter that submits with the option dropped.
Error Messages/Logs
(no option selected) notes: Press `n`, typed these, then hitting `Enter` once..
Steps to Reproduce
- Trigger an
AskUserQuestionwith 2–4 single-select options, at least one of which has apreviewfield set (the side-by-side layout kicks in for the whole question as soon as any one option has a preview). - Arrow to highlight any option.
- Press
n→ type any text → Enter. - Observe the response payload:
(no option selected) notes: <text>— the highlighted option is dropped and only the note survives.
Originally reproduced 4× on 2.1.121 in both default and fullscreen TUI renderers (/tui default and /tui fullscreen). Re-confirmed live on 2.1.156 and again on 2.1.167.
Claude Model
Opus — Claude Opus 4.8 (claude-opus-4-8, 1M context)
Is this a regression?
Yes, this worked in a previous version.
Last Working Version
Around 2.1.119 or earlier (exact build uncertain).
Claude Code Version
2.1.167 (Claude Code)
Platform
Anthropic API
Operating System
macOS 26.3.1 (Darwin 25.3.0, arm64)
Terminal/Shell
VS Code integrated terminal (1.122.1), zsh
Additional Information
Cross-reference anthropics/claude-code#57005 (the feature request for the proper Tab/Space-to-comment-on-selected-option flow). This bug is about the existing n affordance becoming incoherent on preview-enabled questions, not the missing feature.
Showing cached comments. Read the full discussion on GitHub ↗
3 Comments
I have the exact same problem. This is very annoying. Here is another Claude report
Title:
AskUserQuestionnotes are delivered to the model detached from the option they were attached toEnvironment:
Summary:
When answering an
AskUserQuestionprompt that has option previews (the aside/code-excerpt UI), notes added via "press n to add notes" are delivered to the model as free-standing text with no association to the option they were entered under. In the two note cases I tested, the answer was also reported as(no option selected)even though the note was visually entered inside a specific option's card.Steps to reproduce:
AskUserQuestionwhere each option includes apreview(this triggers the side-by-side UI with previews and the "press n to add notes" affordance).n, and type a note without toggling/selecting that option.Expected:
The model receives both the selected option (or at minimum the option the note is attached to) and the note, so it knows which choice the note refers to.
Actual:
The model receives only the raw note text plus an explicit
(no option selected)marker. The option under which the note was typed is not communicated. From the model side there is no way to tell which option a note belongs to — the only reason it "knew" in my test was because I happened to type the option name into the note text myself.Example of what the model received:
Additional observation:
It appears you cannot both add a note to an option and select that option — entering a note does not select the option, and there was no obvious way to toggle the selection while adding the note. So the two pieces of information (choice + note) can't currently be sent together for a single option.
Contrast — the working case:
Selecting an option without a note works correctly. The model receives the option label plus its preview text, unambiguously:
Impact:
Notes attached to an option are effectively orphaned. The model loses the option↔note association and, in the note-only case, gets
(no option selected), so it cannot act on the user's intent reliably.Still reproduces on v2.1.199 (WSL2 Ubuntu 24.04, Windows Terminal).
An AskUserQuestion call with two questions, both using
previewfields on their options: the user highlighted an option and attached a note on each question, and the tool result came back asfor both questions — the highlighted selections were dropped and only the notes survived. Matches the originally reported symptom string exactly.
Still reproduces on v2.1.228 (WSL2, Linux 6.18, zsh).
One correction to the original report: this is not limited to questions with
previewset. The bug is in the shared submit path and is preview-independent. From the 2.1.228 bundle, the question component's submit callback is:and the key handler:
Only
j()writesselectedValue:Arrow keys and the number keys
1-9route toq(), which only moves the highlight index — it never callsj(). So highlighting an option and pressingnleavesselectedValueunset, and the submit falls through to the(notes only)branch. Nothing in that path readspreview; preview only changes layout. I hit this on preview-less questions routinely.Workaround for anyone blocked: after typing the note press Escape instead of Enter. That closes the editor without submitting (the note text stays in
textInputValue), and a subsequent Enter on the highlighted option callsj(), so both the label and the note ship.