--resume should offer recently-modified sessions after unexpected shutdown
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?
1 ## Problem
2
3 After an unexpected laptop shutdown (battery death), claude --r reports "no resumes available" even though the session JS
esume
ONL file exists, was recently modified, and contains a complete
conversation history.
4
5 The session file (~/.claude/projects/<project>/<session-id>.jso) survived intact — 78MB, 5,621 entries, actively written to
nl
minutes before the shutdown. The file-history snapshots, memory
files, and all associated data are present and valid. But the re
sume picker doesn't list it.
6
7 ## Expected Behavior
8
9 If a session JSONL exists and was recently modified, it should a
ppear in the resume list regardless of how the session ended. Cr
ash/power-loss recovery is arguably the primary use case for — it's when you most need it.
--resume
10
11 ## Current Workaround
12
13 You can force resume with the explicit session ID:
14 ```
15 claude --resume <session-id>
16 ~/
17 But this requires the user to know the ID exists, find it in
.claude/projects/, and identify which one is current — defeatin--resume` robust to crashes, OOM kills, power l
g the purpose of the resume picker.
18
19 ## Environment
20
21 - Claude Code (CLI)
22 - Pop!_OS (Ubuntu-based) Linux
23 - Session ended via unexpected power loss (no clean exit signal)
24
25 ## Suggestion
26
27 The resume index should be rebuilt from the JSONL files on disk
if the index is stale or missing. A session should be considered
resumable if:
28 1. The JSONL file exists
29 2. It was modified within a reasonable window (e.g., last 7 days
)
30 3. It contains at least one user/assistant message pair
31
32 This would make
oss, and any other ungraceful termination.
What Should Happen?
--resume should offer recently-modified sessions after unexpected shutdown
Error Messages/Logs
Steps to Reproduce
- Start a Claude Code session in a project directory: `cd ~/my
+project && claude ~/.claude/projects/<project>/<sess
4 +2. Have a conversation with multiple turns (enough to generate
+a substantial JSONL file in
+ion-id>.jsonl) kill -9
5 +3. Kill the session ungracefully — power loss, , OOM kclaude --resume
+ill, or laptop battery death (anything that doesn't trigger a c
+lean exit)
6 +4. Restart the machine
7 +5. Run from the same project directory ~/.claude/projects/<project>/<session-id>.js
8 +6. Observe: "no resumes available" — even though the session JS
+ONL file exists and was recently modified
9
5 -The session file (
-onl`) survived intact — 78MB, 5,621 entries, actively written t
-o minutes before the shutdown. The file-history snapshots, memo
-ry files, and all associated data are present and valid. But th
-e resume picker doesn't list it.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
claude code
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗