[BUG] Assistant text completes (end_turn, 20k output tokens) but is never rendered; ESC reveals silent verbatim recitation of the system prompt
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?
An assistant turn can generate tens of thousands of characters that are never rendered to the terminal. The generation completes normally (stop_reason: "end_turn"), the tokens are billed, and the full text is written to the session transcript — but not a single character appears on screen. The user only sees "thinking" for several minutes.
If the user presses ESC, the entire buffered text is dumped to the screen at once. That is the only reason we found this at all.
The content being generated is itself the second half of the bug: mid-reply, the model stops answering and begins writing the conversation transcript itself — it fabricates the user's next turn, emits a literal system<system-reminder> marker, and then recites the injected system prompt / CLAUDE.md verbatim from the top until it runs out.
I'm calling it "silent recitation" for lack of an existing term.
What the transcript shows
Two events in a single session (2026-07-17, times JST):
| time | text length | stop_reason | output_tokens | rendered on screen? |
|---|---|---|---|---|
| 15:36 | 25,594 chars | end_turn | 20,622 | no — completed silently, unnoticed |
| 17:41 | 22,445 chars | (none) | 1 | only after the user pressed ESC |
Structure of the 15:36 event (a single text block — no thinking block):
- chars 0–385: a normal, correct answer to the user's question.
- char 386: abruptly emits a fabricated user turn —
user <a plausible sentence the user never typed> - then:
system<system-reminder>Contents of C:\...\CLAUDE.md ... - then: the entire system prompt / CLAUDE.md, recited from the top, ~25k chars
- ends cleanly with
</system-reminder>andstop_reason: end_turn
The user's actual next message arrived seconds later and was unrelated — the conversation continued normally, with no visible degradation whatsoever. Someone sitting at the terminal could not tell anything had happened.
Frequency
Scanning ~7 days of local transcripts (~72k lines) for this fingerprint:
- 21+ occurrences across 7 sessions (a second, independently written scanner finds a few more; the exact count depends on how loosely you match the fabricated role markers — the large silent ones are unambiguous)
- all
isSidechain: false, alltextblocks (neverthinking) - 20 of 21 completed with
end_turn— i.e. silently, unnoticed - only 1 was ever seen by the user, because they happened to press ESC
Sizes range from ~160 chars to 25,594. The small ones do render (you see a stray user or system token appear in the reply — easy to dismiss as noise). Only the large ones appear to go unrendered.
Why this matters
- It is invisible. 20 of 21 occurrences left no trace on screen. Without pressing ESC by chance, this is undetectable in normal use.
- It is billed. The 15:36 event alone consumed 20,622 output tokens. Over 7 days that is a meaningful, entirely wasted spend that no user could account for.
- It leaks the system prompt into the transcript — including any private instructions in CLAUDE.md.
- The fabricated user turn is a correctness hazard. Here the recitation was harmless because it went nowhere. A shorter fabrication that does render (several observed) puts words in the user's mouth in the visible conversation.
The core of this report
The generation is real and recorded. The display is not happening.
The generation is happening. Only the display is not.
Whatever causes the model to start reciting is one problem (possibly model-side). But a completed end_turn text block of 20k+ tokens producing zero terminal output looks like a client-side rendering/streaming issue, and it is the reason this went unnoticed for a week.
What Should Happen?
- An assistant turn that completes should never produce zero rendered output. Even if the model's recitation itself cannot be prevented, it should not be possible for a 20k-token
end_turnreply to finish without the user seeing anything. - Ideally: detect that the model has begun emitting
<system-reminder>/ role markers inside a reply and stop the turn, rather than letting it burn 20k output tokens reciting the system prompt into the void.
Error Messages/Logs
Steps to Reproduce
I do not have a reliable trigger, and I'd rather be honest about that than invent one. It appears spontaneously in ordinary long conversations. What I can offer instead is what I measured and ruled out, from 7 days of transcripts:
Ruled out:
- Not context size — occurred at 426k / 1,000k (43%) of the window.
- Not a preceding image/screenshot read — 0 of 21 occurrences had one.
- Not a long preceding pause — gaps before occurrences ranged from 10.4s to 188.5s (no pattern).
- Not subagents — all occurrences
isSidechain: false(main loop). - Not custom hooks — occurrences continued unchanged after all custom
UserPromptSubmithooks were disabled, and also predate the disabling. - Not
thinking— every occurrence was atextblock; nothinkingblock was present.
What is consistent:
- The recited content is always material that was injected into context (the system prompt / CLAUDE.md), reproduced from the top, verbatim, with its role markers intact (
user,system<system-reminder>,</system-reminder>). - The transition is abrupt and mid-sentence-boundary: a correct reply for a few hundred characters, then the fabricated
userturn, then the recitation. - It clusters: once it happens in a session it tends to recur (6 times in one session on one day, 7 times in another).
How to detect it in your own transcripts (this is how I found it — the fingerprint, applied to assistant text blocks in the session .jsonl):
- contains
<system-reminder>, or - contains a fabricated role marker at a line start (
user/system/assistant) plus system-prompt content, or - is >6,000 chars and contains verbatim system-prompt/CLAUDE.md text
Then check stop_reason and output_tokens. The end_turn ones are the invisible ones. Note: do not put a length floor on the fingerprint — the small ones (~160 chars) do render and are easy to miss as "noise", but they look like the same failure.
If it would help, I can supply transcript excerpts with all user content stripped.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.212 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Context at the time of the failure: 426k / 1,000k tokens (43%) — comfortably inside the 1M window, on a long-running interactive session (not CI, not headless).
How it was found: purely by accident. The user pressed ESC because the session appeared to be "thinking" for several minutes, and ~22k characters of recited system prompt dumped onto the screen at once. Nothing in the visible conversation before or after that point was degraded in any way — the assistant answered the next (unrelated) question normally. Without that ESC, this would still be undetected.
A note on the small variants: the user reports having noticed a stray user token appearing in replies "a few times over the past several days" and dismissing it as noise. That matches the small (~160–1,200 char) occurrences in the transcripts, which do render. So from the user's side, the visible symptom is a rare meaningless word in a reply; the invisible symptom is 20k tokens of recitation. They appear to be the same failure at different sizes.
Related but not the same: I found existing issues about the model confabulating user messages, but none describing generated output that is never rendered. The rendering half of this seems unreported.
Happy to provide the fingerprint scanner or sanitized transcript excerpts on request.