[BUG] Correct quiz answer leaks into the assistant's message (as "umN") — reproducible on Windows, never on macOS
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When Claude Code generates a Claude certification practice quiz (multiple-choice, 4 options), the correct answer leaks into the assistant's own message. Right after Claude prompts the user to answer, and before the user responds, the message ends with "um" followed by the correct option number (e.g. "um3" when option 3 is correct). This reveals the answer prematurely and makes the quiz unusable for self-testing. More broadly, it suggests internal assistant-side state can leak into visible output beyond quiz scenarios.
What Should Happen?
Only the question and its options should be shown. The correct answer should never appear until after the user submits their answer.
Error Messages/Logs
Steps to Reproduce
- Ask Claude Code to act as a quiz master and give Claude certification practice questions one at a time.
- Claude presents a multiple-choice (4 options) question.
- Claude prompts the user to answer (e.g. "回答をどうぞ!" / "Please answer!").
- Before the user responds, the correct answer appears at the end of the same assistant message as "um" + the option number (e.g. "um3").
Reproduces consistently on Windows. On macOS, the same steps never reproduced it across 100+ trials.
Note: Adding a prompt-level instruction ("do not reveal the answer first") did NOT prevent recurrence (reproduced again on 2026-07-28).
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.220 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
Screenshot
<img width="1152" height="648" alt="Image" src="https://github.com/user-attachments/assets/cc41685d-11ca-43a9-8dbf-1ae59e3e7785" />
Q9: right after "回答をどうぞ!" ("Please answer!"), the assistant's message ends with "um3" — and option 3 is in fact the correct answer, shown before the user responded.
Technical evidence
Verified by inspecting the local session JSONL transcript: the "umN" text is part of the same assistant text content block as the question — not a separate message. Cross-checked against the session's recorded submitted-prompt history (last-prompt entries): "umN" never appears there, confirming it was never sent by the user. The revealed digit matched the objectively correct answer in every observed case — including one case where the user's actual answer differed (and was wrong) — which rules out the extension merely echoing the user's predicted input.
Environment comparison
Both machines run Claude Code for VS Code v2.1.220 (identical extension version), so the issue is NOT tied to the extension version. The differing factors are the OS platform and the VS Code host version.
Windows (issue occurs):
- Claude Code for VS Code: v2.1.220
- VS Code: 1.128.1 (user setup), commit 5264f2156cbcd7aea5fd004d29eaa10209155d66, 2026-07-14
- Electron 42.5.0 / Chromium 148.0.7778.271 / Node.js 24.17.0
- OS: Windows_NT x64 10.0.26200
macOS (issue does NOT occur, 100+ trials):
- Claude Code for VS Code: v2.1.220
- VS Code: 1.117.0 (Universal), commit 10c8e557c8b9f9ed0a87f61f1c9a44bde731c409, 2026-04-21
- Electron 39.8.7 / Chromium 142.0.7444.265 / Node.js 22.22.1
- OS: Darwin arm64 25.2.0
Showing cached comments. Read the full discussion on GitHub ↗
3 Comments
Update (2026-08-04)
VS Code auto-updated unexpectedly on my machine. The Claude Code extension version is unchanged (v2.1.220).
New environment (Windows — issue has not reproduced so far):
I re-ran the same quiz-master reproduction steps 30 times after this update. The "umN" leak did not occur in any of the 30 trials — previously it reproduced consistently (essentially every question) under VS Code 1.128.1.
I haven't matched the macOS baseline of 100+ trials yet, but going from "reproduces on nearly every question" to 0/30 after this update is already a notable shift, so I wanted to report it now rather than wait. I'll keep testing and post again if it recurs.
Note that only the VS Code host version changed here — the extension itself did not update.
Update 2 (2026-08-04): Recurrence at trial 37 — leak pattern changed from "umN" to "userN"
Correcting my previous comment: the issue is not resolved by the VS Code update. It only became intermittent.
Environment (unchanged since previous comment):
After 30 clean trials, the leak recurred on trial 37 — no environment change between trial 1 and trial 37. This time the leaked fragment was "user2" instead of "umN". The correct answer was option 2, so the pattern of "the appended digit always matches the correct answer" still holds.
New evidence from the raw session JSONL (
~/.claude/projects/.../<session-id>.jsonl):Two things this confirms:
textcontent block as the question — not a separaterole:"user"entry, and not something injected after the fact by the extension's rendering layer. The turn ends normally withstop_reason:"end_turn", which suggests the string is already present in the content returned to the client, not added client-side during display.Ruling out a prompt-side cause: My quiz is driven by a project instruction document (not a Claude Code custom slash command) that, since 2026-07-28, explicitly forbids appending anything after "回答をどうぞ!" ("please answer!") — including this exact "umN" pattern. The leak still occurred despite this explicit prohibition, both on the same day it was added and again today. This rules out "the model is intentionally encoding a hint per my own instructions" as an explanation — the instruction is being violated, not followed.
Happy to share the full (redacted) JSONL line, or run further targeted trials, if that would help narrow this down.
Update 3 (2026-08-04): Full raw JSONL line for the trial-37 leak
For reference, here's the complete raw JSONL line for the assistant turn where "user2" appeared (from
~/.claude/projects/.../<session-id>.jsonl), lightly redacted:A few details worth calling out:
contentcontains exactly onetextblock, nothing else. Nothinking, notool_use, notool_result. This turn didn't involve any tool calls or subagents — the leak is present in a single, plain text generation.input_tokens: 2. The turn was triggered by a very short user message (just "次へ" / "next"), continuing a long-running quiz session, not a fresh instruction.iterationshas exactly one entry, type"message". No retries, no multi-step generation.stop_reason: "end_turn", notmax_tokens— generation ended normally, so this isn't a truncation artifact.This continues to point toward the leaked fragment being present in the assistant's generated text content itself, from a single, unremarkable turn with no tool use involved.