[BUG] Resume/fork silently drops newer saved answers when a non-explicit leaf marker points to a parallel tool-result branch

Status Open
Reported on v2.1.280
Maintainer reply None cached
Activity 2 comments · opened Sep 24, 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?

Forking a running Claude Code session with:

claude --resume <session-id> --fork-session

restored an older conversation state, omitting recent completed answers. The session ID was correct, and the missing messages were present in the original saved transcript.

I reduced this to an anonymous synthetic transcript and reproduced the loader behavior against the real Claude Code 2.1.280 and 2.1.281 executables.

The transcript contains parallel tool-result branches followed by two complete answers. An ordinary last-prompt.leafUuid record points to the other tool-result branch. The newer answers remain in the file, but resume/fork excludes them from the message history submitted to the API.

Changing only the marker to the final answer, removing it, or pointing it to an ancestor of the newer answers restores the entire conversation. No explicit rewind occurs; the marker has neither explicit nor rewound set.

What Should Happen?

Resuming or forking this transcript should retain the newer completed conversational turns. An older, non-explicit metadata marker pointing to a parallel tool-result branch should not silently hide those turns.

All four fixture variants should include both saved answers and the intervening follow-up request in the outgoing conversation history.

Error Messages/Logs

The original fork showed no error; it silently restored an older conversation state.

Summary of captured request history, identical on Claude Code 2.1.280 and 2.1.281:

Variant     Initial request  First answer  Follow-up request  Latest answer
stale       present          MISSING       MISSING            MISSING
corrected   present          present       present            present
removed     present          present       present            present
ancestor    present          present       present            present

Probe verdict:
REPRODUCED: only the stale branch marker hides both later answers.

Steps to Reproduce

  1. Extract the attached claude-resume-repro.zip. Keep probe.py and session.jsonl in the same directory.
  1. With Python 3 and Claude Code installed, run:

python3 probe.py --claude claude

To test a specific installed version:

python3 probe.py --claude /path/to/claude-executable

  1. The script runs the real CLI with --resume <transcript-path> --fork-session in print/bare mode. It uses temporary configuration and working directories, dummy credentials, disabled tools/hooks/MCP, and a local mock API. No actual model generation or account is required.
  1. The mock captures the conversation Claude submits. The script compares four otherwise identical transcripts:
  • stale: marker points to the parallel tool-result branch
  • corrected: marker points to the latest answer
  • removed: marker is absent
  • ancestor: marker points to an ancestor of the latest answer
  1. Observe that only the stale variant omits both later answers and the follow-up request. All three controls retain them.

The script reports INCONCLUSIVE for missing captures, timeouts, or failed controls, rather than treating those as reproduction.

claude-resume-repro.zip

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.281 (also reproduced on 2.1.280)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

Original environment: Ubuntu 22.04.5 LTS, Claude Max subscription, Opus 5.5, running in herdr.

The standalone reproduction does not depend on herdr. It uses Python subprocesses and the unmodified Claude CLI with a local mock API. The probe specifies claude-sonnet-4-6, but no model executes; the failure occurs during conversation loading.

All attached transcript content, IDs, paths, and timestamps are synthetic.

The automated reproduction confirms the loader failure in print mode. It does not establish the writer-side timing that originally produced the stale marker, or test interactive TUI rendering.

Related reports with different triggers:
https://github.com/anthropics/claude-code/issues/89640
https://github.com/anthropics/claude-code/issues/33651
https://github.com/anthropics/claude-code/issues/87893

View original on GitHub ↗

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