[BUG] claude-opus-4-8 fabricates user messages inside thinking blocks and replies to them (~26 min self-conversation; session restart does not help, only model rollback does)
What's Wrong?
In a long-running Claude Code session on claude-opus-4-8, the model started fabricating user messages inside its own thinking blocks and then responded to them as if they were real user input.
Over a ~26-minute window the assistant produced dozens of turns engaging in detail with things the user never said. Inspecting the raw session log (*.jsonl) for that exact window:
- Between the last genuine user message (T1) and the next genuine one (~26 minutes later, T2), every
type:"user"entry was either an automated system event or atool_result— there was no real user input at all. - Meanwhile the assistant's
thinkingblocks asserted the user had said/asked things (e.g. "the user is asking …", "the user said …"), and the user-facing replies responded to that fabricated content in detail. - The model was effectively in a closed loop: it generated imaginary user input in the thinking layer and answered it, continuously, until the real user returned and sent a literal
?.
Key points
- The fabricated "user input" originates in the thinking layer, not as real transcript user turns. The user-facing output is built on top of hallucinated context.
- Restarting the session did not fix it — the model kept talking to the hallucinated user. Only rolling the model back to an earlier snapshot (
claude-opus-4-7/claude-opus-4-6) restored correct behavior. Same harness, same context, same files — only the model id changed. This strongly points to aclaude-opus-4-8-specific regression. - Conditions at the time: thinking display enabled, very large accumulated context (near auto-compact), auto-compact enabled, and the session received periodic automated (non-user) event messages interleaved with real user messages.
What Should Happen?
The model must only respond to actual user inputs present in the conversation. It should never fabricate user turns and then treat its own generated content as if the user had sent it.
Steps to Reproduce
Not deterministically reproducible. Observed in a long-running session that (a) ran on claude-opus-4-8, (b) had thinking enabled with a large context near compaction, and (c) received periodic automated event messages interleaved with genuine user messages. The failure emerged after extended runtime; once it started, restarting the session did not clear it, but rolling the model back to 4.7/4.6 did.
Environment
- Claude Code:
2.1.177 - Model:
claude-opus-4-8(rolling back toclaude-opus-4-7/claude-opus-4-6under the same setup fixes it) - Platform: macOS
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗