Skip to content

BasedGPT/claude-code-session-recovery

Repository files navigation

Claude Code Desktop Session Recovery & Repair Tools

Python 3.11+ License: MIT

Tested against Claude Code CLI v2.1.121 on Windows 11 — 2026-05-19. Claude Desktop version v1.8089.1

Something broke somewhere with your sessions in Claude Desktop. Because I'm a bit special I've broken my Desktop sessions in lots of different ways. I made this to help you diagnose and hopefully fix it if something has gone wrong for you too.

Fix it with Claude Code (or any AI)

This runs best from a Claude Code CLI session, not from Claude Desktop because the Desktop app needs to be closed to apply the fixes. If you run it from Desktop then, the tool will detect that and warn you and give you the instructions on what to do if you're still more comfortable running from Claude Desktop.

Step 1 — open a CLI session

Open Windows Terminal, PowerShell, or cmd, then run:

claude

That starts Claude Code in your terminal.

Step 2 — paste this prompt

My Claude Code sessions are broken on Windows. Please help me fix them using https://github.com/BasedGPT/claude-code-session-recovery

1. Clone the repo and cd into it: `git clone https://github.com/BasedGPT/claude-code-session-recovery` then `cd claude-code-session-recovery`
2. Read AGENTS.md — it's written for AI assistants and explains how to use this repo safely
3. Read docs/session-recovery.md to understand the symptoms and repair tools
4. Run `python tools/diagnose.py` — it auto-detects all file paths from the environment, no configuration needed
5. For each repair command: run the dry-run first, show me the full output, and wait for me to say "yes, apply" before adding --apply
6. Tell me what was found and what was fixed

Fix it yourself

git clone https://github.com/BasedGPT/claude-code-session-recovery
cd claude-code-session-recovery
python tools/diagnose.py

Read the output. It prints what it found, the matched problem, and the exact repair command. The diagnostic is read-only — safe to run at any time.

Where to start

Sessions in your Claude Desktop session list are broken or missingdocs/session-recovery.md

You use Claude Code worktrees and something brokedocs/worktree-lifecycle.md

You want to understand the bug before running anythingdocs/architecture.md

You want to know what the scripts touch before running themSECURITY.md

You want to see which sessions are in which group, or groups disappeared after a Desktop updatepython tools/groupings/list_groupings.py

You are an AI assistant helping a user with this repoAGENTS.md

Symptom table

Run python tools/diagnose.py first — it identifies your specific problem and prints the exact command to run.

Problem Run this Details
Session missing conversation history python tools/diagnose.py session-recovery.md#blank-pane-missing-cli
Conversation history missing from disk python tools/diagnose.py session-recovery.md#cli-points-missing-jsonl
Two sessions, same conversation history python tools/diagnose.py session-recovery.md#duplicate-synth-metadata
Sessions started from outside any project folder python tools/diagnose.py session-recovery.md#old-root-cwd-reference
One project, two sets of sessions python tools/diagnose.py session-recovery.md#junction-realpath-slug-mismatch
Sessions missing from Desktop session list python tools/diagnose.py session-recovery.md#orphan-jsonl-no-metadata
Group assignments wiped or missing after Desktop update python tools/groupings/list_groupings.py architecture.md#session-grouping-layer — read-only diagnostic; no automated fix

Requirements: Python 3.11+, Windows 11. No dependencies outside the standard library.

About

Diagnose and repair Claude Desktop session metadata bugs on Windows — missing conversation history, lost transcripts, duplicate sessions, junction-induced splits, lost groupings.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors