[BUG] /resume silently shows blank conversation when JSONL transcript is truncated by power loss / abrupt termination

Resolved 💬 3 comments Opened Apr 27, 2026 by dark942 Closed Apr 28, 2026

Description

When a Claude Code session is interrupted by a power outage, system crash, or other abrupt termination during a write to the session transcript JSONL, /resume silently displays a blank conversation. No error is shown, no fallback is attempted — it just appears empty even though the JSONL file contains hundreds of valid messages.

Steps to Reproduce

  1. Have an active Claude Code session running for some time (hundreds of messages)
  2. Power outage / hard crash / kill -9 the process during a tool execution or write
  3. Restart machine, run claude in the same project
  4. /resume the session
  5. Conversation appears blank — no messages displayed
  6. Inspect the JSONL: hundreds of valid messages exist, but the last entry is likely truncated/incomplete

Expected Behavior

Resume should:

  1. Detect malformed or truncated entries at the tail of the JSONL
  2. Skip them and load from the last valid entry
  3. Optionally warn the user that recovery occurred
  4. Display the conversation normally

Actual Behavior

Resume silently shows blank, with no indication of why. Users have no feedback that the file is recoverable or that anything went wrong.

Workaround

Manually trim the JSONL to a known-good point and re-link the parentUuid chain:

# Strip last few entries (likely the corrupted ones)
# and re-link UUID chain
prev_uuid = None
for line in kept_lines:
    obj = json.loads(line)
    if 'parentUuid' in obj and obj.get('uuid'):
        obj['parentUuid'] = prev_uuid
        prev_uuid = obj['uuid']

After this, resume works normally.

Environment

  • Platform: Linux (Arch Linux)
  • Version: 2.1.118 (also reproduced on 2.1.117, 2.1.116)
  • Cause: Power outage during a file copy operation while the session was active

Related Issues

  • #26729 (CLOSED) — Streaming resilience for network loss; doesn't cover JSONL transcript corruption
  • #24662 (CLOSED) — Session unrecoverable after empty content block; similar but specific to streaming
  • #43941 — Resume display issues on large sessions

The closed issues address related but distinct cases. This specific failure mode — silent blank resume on truncated JSONL from external interruption — is not covered by any current fix.

View original on GitHub ↗

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