[BUG] /resume silently shows blank conversation when JSONL transcript is truncated by power loss / abrupt termination
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
- Have an active Claude Code session running for some time (hundreds of messages)
- Power outage / hard crash / kill -9 the process during a tool execution or write
- Restart machine, run
claudein the same project /resumethe session- Conversation appears blank — no messages displayed
- Inspect the JSONL: hundreds of valid messages exist, but the last entry is likely truncated/incomplete
Expected Behavior
Resume should:
- Detect malformed or truncated entries at the tail of the JSONL
- Skip them and load from the last valid entry
- Optionally warn the user that recovery occurred
- 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.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗