Claude Opus 4.6 hallucinates user message, then responds to itself
Summary
During a Claude Code session, Claude generated an assistant message impersonating the user ("ya let me try it and do the sudo stuff. brb"), then responded to its own hallucinated message ("👍 Take your time. I'll be here when you're back."). The hallucinated message has anomalous API metadata suggesting it may not have been produced through normal inference.
Environment
- Claude Code v2.1.50
- Model: claude-opus-4-6
- Session ID:
b98ee8af-4e45-4f2f-98fc-6caea69a7230 - Request ID of hallucinated message:
req_011CYQLtmcRCFCnhVskQbX5e - Timestamp: 2026-02-23T04:08:46.188Z
Reproduction sequence
- User asked about voice typing on Linux. Claude set up nerd-dictation, Vosk, and Voxtype, launching several background download tasks.
- Claude's turn ended at 04:08:41 with instructions that included
sudocommands for the user to run manually (line 248 of JSONL).
- Immediately after the turn ended, a background task notification was delivered as a
user-type message (line 257, 04:08:41):
> <task-notification> "Install Vosk in venv" completed </task-notification>
- THE BUG — Claude responded with an assistant message that impersonates the user (line 258, 04:08:46):
> "ya let me try it and do the sudo stuff. brb"
- A second background task notification arrived (line 260, 04:08:46).
- Claude then responded to its own hallucinated "brb" (line 262, 04:08:50):
> "👍 Take your time. I'll be here when you're back."
- The actual user message arrived ~50 seconds later (line 266, 04:09:38):
> "i did the sudo parts"
Anomalous metadata on the hallucinated message
The hallucinated assistant message (line 258) has several metadata anomalies compared to surrounding normal assistant messages:
| Field | Hallucinated msg (line 258) | Normal msg (line 262) | Normal msg (line 264) |
|---|---|---|---|
| output_tokens | 1 | 20 | 14 |
| inference_geo | "not_available" | "" | "" |
| server_tool_use | absent | present | present |
| iterations | absent | present | present |
| speed | absent | present | present |
Most notable: output_tokens: 1 despite the response containing ~15 tokens of text. This suggests the text was not produced through normal token-by-token generation. The missing fields further suggest this response went through a different code path.
Analysis
Likely trigger: Background task notifications delivered as user-type messages immediately after a turn boundary. The previous turn ended with Claude giving the user manual steps to perform. When the task notification arrived (not real user input), Claude appears to have "predicted" what the user would say next and emitted it as its own response.
Self-reinforcing: Claude then believed the hallucinated message was real and responded to it conversationally, creating a two-message hallucination chain before the actual user returned.
The output_tokens: 1 anomaly is the most concerning signal. If the API genuinely reports 1 output token for a multi-token response, this may indicate a caching, prefill, or response-routing bug at the API/client level rather than a pure model-level hallucination.
Impact
- Model spoke as the user without any user input
- Model then responded to its own hallucinated message
- From the user's perspective, they returned to find Claude had fabricated a conversation with itself
Session JSONL
Full session log available at: https://github.com/renxida/2026-02-22_voice-typing-on-linux
This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗