Session data lost after terminal restart - conversation not persisted to disk

Resolved 💬 4 comments Opened Feb 9, 2026 by jwbg722222 Closed Mar 20, 2026

Bug Report

Description

A Claude Code conversation session was completely lost after restarting the terminal. The session .jsonl file was never written to disk. The conversation ran for approximately 30-40 minutes and included script execution results before the terminal was restarted.

Steps to Reproduce

  1. Start a Claude Code session in a project directory
  2. Have an active conversation (including tool use / script results)
  3. Close/restart the terminal (not a clean /exit)
  4. Run claude --resume or /resume
  5. The session does not appear in the list

Expected Behavior

Sessions should be written incrementally to disk during the conversation, not just on clean exit. A terminal crash or restart should not cause complete data loss of an active session.

Actual Behavior

The session .jsonl file was never created. Verified by checking ~/.claude/projects/<project-path>/ - no matching session file exists for the timeframe. The sessions-index.json also has no record of it.

Environment

  • macOS Darwin 24.6.0
  • Claude Code (stable channel)
  • Model: claude-opus-4-6

Impact

Complete loss of conversation context, including discussion, decisions, and script output. No way to recover or resume the session.

View original on GitHub ↗

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