[BUG] Conversation data loss: `/export` truncates transcript and `/resume` delivers incomplete context when parallel Agent tool results arrive out-of-order

Resolved 💬 6 comments Opened Apr 1, 2026 by nicolasgarcia214 Closed May 12, 2026

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?

Bug Description

Two related bugs stem from the same root cause — conversation state becomes inconsistent when parallel Agent tool calls have their results delivered across a turn boundary (i.e., one result arrives after the user's next message). This causes:

  1. /export to produce a truncated transcript containing only the first conversation turn, silently dropping all subsequent exchanges.
  2. /resume to load the conversation in a broken state where the model receives an incomplete view of prior context, causing it to respond with "No response requested" instead of continuing the unfinished work.

Root Cause Analysis

The conversation JSONL file (~/.claude/projects/<project>/<session-id>.jsonl) reveals the exact sequence.

3 parallel Agent calls were issued. Only 2 of 3 results were delivered before the user sent their next message. The 3rd result (toolu_01Am...) arrived after the user message at line 27, splitting the tool_use/tool_result correspondence across a turn boundary.

Impact on /resume

When resuming this conversation, the model sees:

  • 3 tool_use calls (lines 18-20)
  • Only 2 tool_results (lines 21-22)
  • Then a user message (line 25) breaking the expected tool_use→tool_result pairing
  • Then an orphaned tool_result (line 27) that appears AFTER the user message

This violates the expected message structure (every tool_use should have a corresponding tool_result before the next user message). The model cannot properly reconstruct the conversation state, so it produces a nonsensical "No response requested" reply and then continues in a confused state.

Impact on /export

The /export serializer appears to stop rendering the conversation at the point where this structural inconsistency occurs. In our case, the exported .txt file contains only Turn 1 (the initial question about the audit process) and nothing else — not the grade report, not the comparison analysis, not the follow-up Q&A. All subsequent turns (4 total) are silently dropped.

Full Conversation That Was Lost

The JSONL file proves these exchanges happened and completed successfully:

| Turn | User Message | Assistant Response | Status |
|------|-------------|-------------------|--------|
| 1 | "Explain audit process" | Detailed 8-phase pipeline explanation | ✅ Exported |
| 2 | /grade (skill invocation) | 7.4/10 grade with 6-dimension scoring, 220K ms, 43 messages | ❌ Lost |
| 3 | "Compare token consumption with Argus" | Detailed comparison tables showing 10-40x cost difference | ❌ Lost |
| 4 | "Does Plamen preserve raw output?" | Analysis showing no raw output preservation | ❌ Lost |

Total data in JSONL: 153 lines, 653KB. Exported: only first ~188 lines of rendered text.

Environment

  • Model: Opus 4.6 (1M context)
  • Platform: Linux (Arch Linux 6.19.9-arch1-1)
  • Shell: zsh
  • Session ID: 328d2075-085a-4fc2-8a29-95be5e59f00e

Workaround

Parse the JSONL file directly to recover the full conversation. The raw data at ~/.claude/projects/<project-path>/<session-id>.jsonl contains all messages intact — only the /export serializer and /resume context loader fail to handle the out-of-order tool results.

What Should Happen?

Expected Behavior

  • /export should serialize the full conversation regardless of tool_result ordering
  • /resume should properly reconstruct conversation state even when a tool_result arrives after a user message
  • Alternatively: the system should block user input until all pending tool_results are received, preventing the split

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

  1. Start a conversation with Claude Code
  2. Perform an action that launches 3+ parallel Agent subagents (e.g., invoke a skill that dispatches multiple Explore agents)
  3. While agents are running, type a message before all agents complete (or agents finish in a way where one result is recorded after the user's next prompt)
  4. Continue the conversation for several more turns
  5. Run /export → observe truncated output
  6. Exit and /resume → observe the model lacks context of the completed work

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

v2.1.89

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗