[BUG]
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?
Title: Transcript not durably flushed on host crash + resume/--continue reattaches to wrong (older) session
Environment: Claude Code CLI, Windows 11, Windows Terminal + PowerShell host, launched with --remote-control and --continue.
Two related issues observed after the terminal/host process crashed hard:
1) Lost transcript tail (no durable flush)
- A session ran ~50 min and produced real work (git commits), then the PowerShell host crashed.
- After the crash, NO .jsonl under ~/.claude/projects/<project>/ contained any entries from that session's time window. The entire tail appears to have lived only in the process buffer and was never written to disk.
- Expected: each appended message is durably flushed (append + fsync) so a crash loses seconds, not the whole session.
2) Resume / --continue reattaches to the wrong (older) session
claude --continueand the picker's top entry both resolve to the most-recently-written transcript in the project dir. Because the session was repeatedly --continue'd, ONE transcript grew across 3 days (~12 MB) and every relaunch reattached to it instead of starting fresh.- After a crash, choosing "continue" / the top picker entry drops you into this old long-lived session, not the one you were actually in — the crashed session is effectively unrecoverable.
- The --remote-control NAME attached to that single file changed across resumes, so in the picker the same physical transcript shows under several different names, making sessions impossible to tell apart.
Suggested fixes:
- Durable per-message flush of the transcript JSONL.
- Show session metadata in the picker (last-activity time, size, message count, cwd) so sessions are distinguishable.
- Stable session identity across resumes; consider auto-rotating/splitting very large or multi-day transcripts so one file doesn't grow unbounded.
What Should Happen?
find the right session
Error Messages/Logs
Steps to Reproduce
Title: Transcript not durably flushed on host crash + resume/--continue reattaches to wrong (older) session
Environment: Claude Code CLI, Windows 11, Windows Terminal + PowerShell host, launched with --remote-control and --continue.
Two related issues observed after the terminal/host process crashed hard:
1) Lost transcript tail (no durable flush)
- A session ran ~50 min and produced real work (git commits), then the PowerShell host crashed.
- After the crash, NO .jsonl under ~/.claude/projects/<project>/ contained any entries from that session's time window. The entire tail appears to have lived only in the process buffer and was never written to disk.
- Expected: each appended message is durably flushed (append + fsync) so a crash loses seconds, not the whole session.
2) Resume / --continue reattaches to the wrong (older) session
claude --continueand the picker's top entry both resolve to the most-recently-written transcript in the project dir. Because the session was repeatedly --continue'd, ONE transcript grew across 3 days (~12 MB) and every relaunch reattached to it instead of starting fresh.- After a crash, choosing "continue" / the top picker entry drops you into this old long-lived session, not the one you were actually in — the crashed session is effectively unrecoverable.
- The --remote-control NAME attached to that single file changed across resumes, so in the picker the same physical transcript shows under several different names, making sessions impossible to tell apart.
Suggested fixes:
- Durable per-message flush of the transcript JSONL.
- Show session metadata in the picker (last-activity time, size, message count, cwd) so sessions are distinguishable.
- Stable session identity across resumes; consider auto-rotating/splitting very large or multi-day transcripts so one file doesn't grow unbounded.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
v1.12603.1
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗