Session data lost after terminal restart - conversation not persisted to disk
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
- Start a Claude Code session in a project directory
- Have an active conversation (including tool use / script results)
- Close/restart the terminal (not a clean
/exit) - Run
claude --resumeor/resume - 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.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗