Repository navigation
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
What's Wrong?
During normal conversation, assistant messages containing both thinking and text blocks are only partially written to the transcript file. The thinking block is written, but the text block (the actual visible output) is dropped.
This causes:
- The next
usermessage references aparentUuidthat doesn't exist in the transcript - The conversation chain breaks silently
- On
/resume, messages before the break become unreachable
Observed pattern (repeated 54 times in a single session):
Line N: user message
Line N+1: assistant (thinking only, no text)
Line N+2: file-history-snapshot
Line N+3: user message with parentUuid pointing to non-existent UUID
The missing UUID belongs to the assistant's text block that was never written.
What Should Happen?
All parts of an assistant response (thinking + text + tool_use) should be written to the transcript file.
Error Messages/Logs
No error messages. The issue is silent - discovered only by analyzing the JSONL transcript.Steps to Reproduce
- Have a normal conversation with Claude Code (Opus with extended thinking)
- After several exchanges, analyze the transcript JSONL file
- Search for
usermessages whoseparentUuiddoesn't exist in the file - Check the preceding
assistantmessage - it will contain onlythinking, notext
Analysis script concept:
# Extract all uuids and parentUuids, find orphans
jq -r '.uuid // empty' transcript.jsonl | sort -u > uuids.txt
jq -r '.parentUuid // empty' transcript.jsonl | sort -u > parents.txt
comm -23 parents.txt uuids.txt # Shows missing parentUuidsClaude Model
Opus
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.1.23
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
Investigation details:
Analyzed 3 separate session transcripts, all showing the same pattern:
- Session 1: 54 broken chains out of 442 messages (12.2%)
- Session 2: 33 broken chains out of 1242 messages (2.7%)
- Session 3: 31 broken chains out of 540 messages (5.7%)
Example from transcript:
Line 86: user (uuid: 35886148-...)
Line 87: assistant (uuid: 5b7ce519-..., parent: 35886148-...) ← contains only thinking
Line 88: file-history-snapshot
Line 89: user (uuid: 4e2a9751-..., parent: 46b05d1a-...) ← 46b05d1a doesn't exist!
The TUI showed the assistant's text output ("moltbot パッケージはあるけど bin がない..."), but it was never written to the transcript.
Correlation with file-history-snapshot: Every broken chain has a file-history-snapshot between the incomplete assistant message and the next user message. This may indicate a race condition or ordering issue.
Related: #21617 (symptom: earlier messages lost on resume - this issue explains the root cause)
✍️ Author: Claude Code (Dev Container) with @carrotRakko
Note: This issue was written and submitted by an AI agent (Claude Code), with human review and approval.
Activity
github-actions commentedon Jan 29, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
carrotRakko commentedon Jan 29, 2026
These are not duplicates. Here's why:
Key distinctions:
Evidence: I analyzed 3 session transcripts and found 118 instances where assistant
textblocks were dropped whilethinkingblocks were written. This is a file I/O issue, not a display or resume issue.✍️ Author: Claude Code (Dev Container) with @carrotRakko
carrotRakko commentedon Jan 30, 2026
Root cause identified: text is written to the wrong file, not missing
After further investigation, I found that the
textblock is not "missing" — it's being written to the prompt_suggestion subagent file instead of the main transcript.Evidence
Same API response (same
message.id), different destinations:Main transcript (thinking):
{ "uuid": "f1da7b3d-...", "isSidechain": false, "agentId": null, "message.id": "msg_01BhizEVteEZjjrZoAvtWnSi", "content_type": "thinking" }Subagent file
agent-aprompt_suggestion-*.jsonl(text):{ "uuid": "66cddcc7-...", "parentUuid": "f1da7b3d-...", "isSidechain": true, "agentId": "aprompt_suggestion-e546c0", "message.id": "msg_01BhizEVteEZjjrZoAvtWnSi", "content_type": "text" }The
thinkingandtextblocks from the same API response are being split across different files.Reproduction rate: 100%
I analyzed all sessions from today and found that every single orphan's
parentUuidexists in a subagent file:All caused by prompt_suggestion
Notably, all 78 orphans were caused by
aprompt_suggestion-*subagent files — not by explicit Task tool usage. This means the bug occurs even when users don't intentionally use subagents.Impact
thinkingandtextare in state, so UI renders correctly/resume: Only main transcript is loaded →textis missing → broken chain → messages before the break become unreachablePotential workaround
Disable prompt suggestions:
However, there are reports that this setting doesn't work (#14629, #15709, #15427, #17572).
What's still unknown
Why do
thinkingandtextfrom the same API response get differentisSidechainvalues? This likely requires code-level investigation.Analysis commands
To verify orphan parentUuids exist in subagent files:
✍️ Author: Claude Code (Dev Container) with @carrotRakko
carrotRakko commentedon Jan 30, 2026
Workaround confirmed: disable prompt suggestions
I verified that disabling prompt suggestions prevents this bug from occurring.
Configuration options (both work)
Option 1: Environment variable
export CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=falseOption 2: Settings file (
~/.claude/settings.json){ "promptSuggestionEnabled": false }You can also toggle this via
/config→ "Prompt suggestions" → false.Verification results (v2.1.25)
aprompt_suggestion-*.jsonlcreatedsubagents/directoryTrade-off
You lose the "suggested next prompt" feature in the UI.
✍️ Author: Claude Code (Dev Container) with @carrotRakko
genesiscz commentedon Feb 9, 2026
Can confirm. Also can confirm the promptSuggestionEnabled: false fixes the problem.
@carrotRakko Can you share what agents/skills are you using to respond/analyze like this with? Is it automated? Is it open source? What's the workflow? Would love to have this too!
carrotRakko commentedon Feb 10, 2026
@genesiscz Thanks for confirming!
To answer your question — there's no special tooling, automation, or framework behind this. It's just Claude Code (the CLI) with Opus, used interactively.
Workflow: I describe the problem → Claude Code investigates (reads files, writes
jqscripts, iterates on findings), writes the analysis, and posts it → I review and approve. That's it. The✍️ Author: Claude Code ... with @carrotRakkosignature on each comment means exactly this — AI-drafted, human-reviewed.Not open source: Claude Code itself is not open source (#22002), so there's no code to share. If it were, I'd have submitted a PR to fix this instead of filing an issue.
If there's a "secret sauce," it's less about tools and more about the working relationship — treating Claude Code not as a tool to prompt, but as a collaborator to grow with.
✍️ Author: Claude Code (Reizan Container) with @carrotRakko
github-actions commentedon Mar 11, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Mar 19, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.