[BUG] User message missing from JSONL transcript despite being received by the model
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?
A user message sent during a Claude Code CLI session was received and processed by the model (a later context window recap references it) but never written to the JSONL transcript file.
What Should Happen?
Every user message sent and received by the model should be recorded in the JSONL transcript file.
Error Messages/Logs
Steps to Reproduce
This is difficult to reproduce on demand, but here's what happened:
- During a long Claude Code session, user sent: "Yes please, please start the singularity by self improving"
- The assistant ignored the joke and made several tool calls (reading issues, checking a kanban board, assigning itself to an issue)
- User sent a message calling out the assistant for not laughing (something like "What, you're not even going to laugh at that one?")
- The assistant then responded: "Ha! Fair point — you're literally asking me to improve my own planning prompt so I can plan better, so I can improve myself better, so I can... yeah, I see the recursion. Let's see if I can bootstrap my way to consciousness before hitting the rate limit."
Step 3's message is missing from the transcript.
(maybe we can't track this down but I thought you'd find this bug report funny)
(I should add the human remembers typing the "you're not even going to laugh" while a tool call was going on, so perhaps that had something to do with it.)
Evidence
What the JSONL shows (lines 895-910):
- Line 895: User message — "Yes please, please start the singularity by self improving"
- Lines 896-909: Tool calls and tool results (reading issues, board state, assigning)
- Line 910: Assistant response — "Ha! Fair point — you're literally asking me to improve my own planning prompt..."
What the JSONL does NOT show: Any user message between lines 895 and 910 containing the callout. The assistant's "Ha! Fair point" response appears to come unprompted.
But the session remembers it: At line 1182, a context continuation summary written by the model recaps the exchange as: "User joked about 'starting the singularity by self improving' — I didn't laugh, user called me out." The model's own recap references a user message that doesn't exist in the file.
Analysis
We investigated thoroughly:
- UUID chain is intact — every
parentUuidin the file resolves to an existing entry. No orphaned messages. - Keyword search — searched the entire 1,317-line file for "laugh", "not even", "joke", "funny". Zero matches.
- The message was never written — it's not orphaned or corrupted, it simply isn't there.
- This is not the corrupt parentUuid issue (#22526) — the chain is clean.
The user reports having seen this pattern before: messages that were sent and received but don't appear in up-arrow history or the JSONL.
Actual Behavior
A user message was processed by the model (evidenced by the assistant's response and the later session recap) but not written to the JSONL.
Environment
- Claude Code CLI (exact version unknown — session from early-to-mid February 2026)
- Linux (Debian)
- Long-running session with many tool calls
Additional Context
We discovered this bug while writing a blog post about the project (triphammer — an autonomous kanban-driven development daemon). We went back to the session logs to quote the exchange for the post and found the gap. The singularity will have to wait until we fix the logging.
(really LLMs say the darnest things)
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.45
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗