claude-code - 💡(How to fix) Fix [BUG] --continue resumes from wrong point after parallel Agent execution [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46263Fetched 2026-04-11 06:24:55
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
1
Author
Participants
Timeline (top)
labeled ×5

When using --continue to resume a session that had multiple Agents launched in parallel, the session rolls back to the point where the Agents were launched, ignoring all subsequent conversation.

Root Cause

Root Cause (from JSONL analysis)

RAW_BUFFERClick to expand / collapse

Description

When using --continue to resume a session that had multiple Agents launched in parallel, the session rolls back to the point where the Agents were launched, ignoring all subsequent conversation.

Steps to Reproduce

  1. Use a session over multiple days with --continue
  2. Launch 8+ Agents in parallel (e.g., reading files from multiple projects)
  3. Continue working after Agents complete
  4. End session, then resume with --continue
  5. Session resumes from step 2, not step 3

Root Cause (from JSONL analysis)

  • file-history-snapshot entries written by parallel Agents all carry the timestamp of the Agent launch moment
  • These snapshots accumulate at the tail of the JSONL file
  • On --continue, the tail snapshots point to the Agent launch time, causing the session to resume from that point
  • The final snapshot had an orphaned messageId (not matching any UUID in the JSONL), so it was likely skipped

Environment

  • Claude Code v2.1.100
  • Platform: WSL2 Ubuntu on Windows
  • Session duration: 8 days (with regular /compact)
  • Session JSONL size: 15MB (5101 lines)
  • file-history-snapshot entries: 981 (26% of file)
  • 48 total Agent invocations, including 8 launched within 10 seconds

Key Data

  • Tail snapshots (lines 5078-5099): all timestamped 2026-04-09T20:56~21:24
  • Last user message: line 5074, 2026-04-10T12:38
  • Last snapshot (line 5101): orphaned messageId with no matching UUID
  • parentUuid chain: intact (0 breaks)
  • Compact executed 6 times (not zero) — compaction does not clear snapshots

Expected Behavior

--continue should resume from the last user/assistant message, regardless of parallel Agent snapshot timestamps.

Actual Behavior

--continue resumes from the Agent parallel launch point (April 9), skipping all work done on April 10. This creates an infinite rollback loop — every --continue returns to the same point.

extent analysis

TL;DR

Modify the session resumption logic to ignore file-history-snapshot entries with timestamps earlier than the last user message when using --continue.

Guidance

  • Investigate the --continue logic to understand how it handles file-history-snapshot entries and modify it to prioritize the last user message timestamp.
  • Consider adding a check to filter out snapshot entries with orphaned message IDs to prevent them from affecting the session resumption point.
  • Review the compaction process to determine if it can be modified to clear or update snapshot entries to prevent accumulation and incorrect resumption points.
  • Verify that the parentUuid chain is intact and used correctly in the session resumption logic to ensure correct message ordering.

Example

No code snippet is provided as the issue does not include specific code references.

Notes

The provided analysis suggests that the issue is related to the handling of file-history-snapshot entries and their timestamps. However, without access to the codebase, it is difficult to provide a precise solution. The guidance provided is based on the information given in the issue.

Recommendation

Apply a workaround by modifying the session resumption logic to correctly handle file-history-snapshot entries and prioritize the last user message timestamp. This is recommended because upgrading to a fixed version is not mentioned as an option in the issue, and the workaround can potentially resolve the issue without requiring a version change.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING