Claude Code --resume not working
Guide · August 2026 · ~4 min read
claude --resume picks a session and dies immediately, or the session is missing from the picker entirely.
The transcript lives at ~/.claude/projects/<project-dir>/<session-id>.jsonl — one JSON object per line,
and the resume loader is strict about it. Three failure modes cover almost every case:
"No conversation found with session ID"
This is the most common resume error. It means Claude Code found your session file but could not replay it — almost always one of the three problems below: an invalid line, an orphaned tool result, or a broken parent chain. It does not mean your session is gone. The transcript is still on disk; fix the record that breaks the replay and the session resumes. Work through sections 1–3 in order.
1. A line that isn't valid JSON
A crash or power loss mid-write can leave a truncated final line. The resume parser stops there. Check for it:
python -c "
import json
p = r'C:\Users\Lenovo\.claude\projects\YOUR-PROJECT\SESSION.jsonl'
for i, line in enumerate(open(p, encoding='utf-8')):
if line.strip():
try: json.loads(line)
except Exception as e: print(f'line {i+1}: {e}')"
2. An orphaned tool result
If the agent crashed between issuing a tool call and receiving its result, the file can contain a
tool_result block whose matching tool_use was never written (or vice versa). The API rejects
the whole conversation when replaying it, so resume fails with an error that doesn't mention the real cause.
Every tool result carries a tool_use_id. If no earlier record contains a tool call with that same id,
it's orphaned. Deleting the orphaned result — or the call/result pair together — restores a replayable chain.
3. A broken parent chain
Records link through uuid → parentUuid. If a record points at a parent that was deleted
(or never written), the reconstructed conversation has a hole and resume either errors or drops everything after the gap.
Repointing the orphan at the nearest surviving ancestor heals it.
The manual fix, and why it's painful by hand
All three are fixable in a text editor if the session is small: delete the bad line, or rewire the id. On a real session — tens of megabytes, one JSON blob per line, ids repeated across records — hand-editing risks making it worse.
SessionPatch does exactly these three checks: it parses every line, pairs every tool call with its
result, walks every parent chain, and lists what's broken with click-to-jump. Edits are recorded as patches and exported
as a new <name>.patched.jsonl; your original file is never modified. Replace the original with the
patched copy and run claude --resume again.
Prevention
Resume failures usually start with an unclean exit (terminal closed mid-run, laptop battery dying). Closing long sessions cleanly and keeping backups of important transcripts costs nothing — see also how to repair a corrupted session file, how to edit or delete messages safely, and why old transcripts get deleted automatically after 30 days.