What to Actually Do When Your Claude Code Session Crashes Mid-Task (2026)
ⓘ Stack Picks is operated by TechAthletes. Some tools we review — including Agent Tile, WordsAdmin and 診断士RoadMap — are built by us; these are clearly marked. We also link to two of our other paid products, IT-QA and PaperLens, at the end of each post. We include competing products and give our honest take.
Claude Code crashes happen: OOM, terminal freeze, laptop battery, forced reboot. Here is a recovery protocol worth having in your head.
Step 1: Snapshot what you know (2 min)
Before touching anything:
- Which files was the session editing?
- What was the task in your own words?
- Roughly where in the task were you (10%? 80%?)
Write these 3 down. If you don't, they blur within 15 minutes.
Step 2: Check git (1 min)
git status. Any staged changes? Uncommitted? A well-configured Claude Code session will have staged partial work. If yes, you have 30-50% of the state back.
Step 3: Check the session log (2 min)
Claude Code stores per-session history. ~/.claude/history/<session-id>.jsonl. If you know the session-id, tail -50 it. You'll see the last few prompts and responses.
If you don't know the session-id, list by mtime:
ls -lt ~/.claude/history/ | head
Step 4: Decide restart or resume
- Restart: If you were <30% into the task and lost mental state, redoing is often faster.
- Resume with new session + summarize: If you were 50%+ in, start a new session and paste the last few messages of context as the first prompt.
Step 5: Prevent next time
The three most common causes of "lost work":
- Terminal tab identity: 6 identical tabs, you kill the wrong one → use a tile manager that names each tab
- Crash without restore: OS quits, terminal reopens empty → use
tmux-resurrector a tile manager with restore - Missing session-id: You know a session existed but can't find it → name your sessions
Tools worth knowing
- tmux + tmux-resurrect: Free, powerful, arcane
- Warp: Modern GUI terminal with block-based history
- Agent Desk: macOS tile manager purpose-built for named+colored+crash-restore Claude Code sessions ($10 once, source included)
Pick whichever survives your last real crash. That's the meaningful test.
Also from TechAthletes
- IT-QA — Technical Q&A with AI-assisted answers and point bounties, for developers.
- PaperLens — AI/semiconductor paper explainers, subscription reading.
- Agent Tile — Run a fleet of AI coding agents on macOS without losing track of them — $10 once, full source.