Aident AI

Claude Code Session History Missing? Recover It Safely
If Claude Code says No conversation found to continue, do not reinstall or edit its session files yet. First open claude --resume from the original project directory and widen the picker with Ctrl+W for all worktrees or Ctrl+A for all projects. If the session is still missing, check whether its local JSONL transcript exists under the active Claude configuration directory. A transcript that still exists may be resumable by session ID; a transcript that has already been deleted needs a backup.
Claude Code stores CLI sessions per project, and its desktop app, web app, and VS Code extension maintain separate histories. The official documentation also says local CLI transcripts are kept for 30 days by default. That makes a blank picker ambiguous: you may be looking in the wrong project or surface, using a different configuration directory, seeing an indexing failure, or dealing with a transcript that has actually been removed.
Use this read-only triage before trying a repair.
Prerequisites
You need:
the project directory where the missing session started;
a terminal or PowerShell window under the same operating-system account;
the current Claude Code version from
claude --version;enough disk space to copy any transcript you find before further troubleshooting.
Session transcripts are local plaintext and can contain prompts, file contents, command output, and tool results. Store any backup with the same care as the repository it describes.
Step 1: Check the Right Session Picker
Change to the original project directory, then run:
In the picker:
Press
Ctrl+Wto include sessions from every worktree in the repository.Press
Ctrl+Ato include every project on this machine.Search for a distinctive phrase from the first prompt.
Preview a candidate with
Spacebefore resuming it.
For the most recent session in the current directory, also try:
Expected result: the picker shows the missing session, or --continue reopens it with its conversation and tool history.
If the session exists in Claude Desktop or the VS Code extension but not the CLI, stay in that surface. Anthropic documents these as separate session histories. A desktop sidebar problem is not proof that a CLI transcript exists, and an intact CLI transcript does not automatically rebuild a desktop index.
Step 2: Find the Active Claude Configuration Directory
On macOS, Linux, or WSL, print the configured root without changing it:
On native Windows PowerShell:
Expected result: an absolute directory that belongs to the account that ran the missing session.
Check for two common mismatches:
A shell profile, alias, or launcher may set
CLAUDE_CONFIG_DIRto another profile directory.A literal value such as
~/.claudemay not be expanded by the process that launched Claude Code. Use an absolute path or$HOME/.claudein a shell that expands$HOME.
Do not search only ~/.claude if the environment variable points somewhere else.
Step 3: Check Whether the Transcript Still Exists
Claude Code stores CLI transcripts as JSONL files below <config-root>/projects/.
On macOS, Linux, or WSL:
To search for a rare phrase from the conversation without modifying any file:
On Windows PowerShell:
Search for a rare phrase:
Expected result: a matching file named <session-id>.jsonl. Copy that file to a protected backup before continuing.
If no matching file appears, repeat the check for any alternate configuration roots you deliberately use. Also confirm that the session was interactive. Anthropic says sessions created with claude -p or the Agent SDK do not appear in the picker, while --no-session-persistence and CLAUDE_CODE_SKIP_PROMPT_HISTORY can suppress transcript writes.
Step 4: Resume an Intact Transcript by ID
The filename, without .jsonl, is the session ID. On macOS, Linux, or WSL:
On Windows PowerShell:
Expected result: Claude Code replays the saved transcript and reopens the conversation.
Run the command from the original project or a worktree of the same repository. Anthropic documents session-ID lookup as scoped to the current project and its worktrees. If the command still fails, preserve the original file and report the Claude Code version, operating system, project path behavior, and exact error. Do not hand-edit the JSONL: Anthropic treats its record format as internal and subject to change between releases.
Step 5: Distinguish a Missing Index From Missing Data
Use the result of the file check to choose the next action:
What you find | Likely condition | Safe next step |
|---|---|---|
Session appears after | Picker scope hid it | Resume it and give it a stable name with |
Matching JSONL exists but the picker omits it | Scope, project mapping, or indexing problem | Back up the file and try |
Transcript exists under another config root | Different profile or launcher environment | Resume with the same configuration root that created it |
Only Desktop or VS Code history is missing | Surface-specific storage or index problem | Preserve that surface's data and report the app version; do not assume the CLI can rebuild it |
No transcript exists anywhere expected | Cleanup, suppressed persistence, reinstall, or deletion may have removed it | Check Time Machine, File History, snapshots, or another verified backup |
Git can recover committed code, but it cannot recreate the conversation, rejected approaches, or tool output that existed only in the transcript. If the file is gone and no backup exists, there is no supported command that can reconstruct the full session.
Step 6: Prevent the Next Silent Cleanup
Anthropic documents a 30-day default for local transcript retention. Merge a positive retention period into the active settings.json; do not replace the rest of the file:
Use a positive value such as 365 instead of 0. A public Claude Code issue reported that 0 suppressed transcript writes in an affected version even though it was intended to disable cleanup. A positive value is easier to verify and avoids relying on that edge case.
Then confirm the session is actually writing:
Start an interactive session in a test project.
Send one harmless prompt.
Confirm a recent JSONL file appears below the active
projectsdirectory.Exit and run
claude --resumefrom the same project.Resume the test session and verify the prompt is present.
Also check that CLAUDE_CODE_SKIP_PROMPT_HISTORY is not set for sessions you expect to resume, and do not add --no-session-persistence to those runs.
For important work, add a second layer of continuity:
name active sessions with
/rename;export important conversations with
/export;keep decisions, current state, blockers, and next steps in a reviewed handoff file inside the repository;
back up the Claude configuration directory with encrypted, access-controlled storage.
This separates durable project state from one local picker. If you are changing agent clients too, use the Claude Code to Codex migration checklist to keep configuration and conversation history as separate migration problems.
Why This Recovery Flow Works
Claude Code has three distinct layers that can look like one feature:
The surface and picker decide which sessions are visible.
The project and configuration directory decide where the CLI looks.
The JSONL transcript contains the local conversation data that can actually be resumed.
Checking them in that order prevents a blank sidebar from being mistaken for permanent deletion. It also avoids reinstalling, rewriting an internal file, or changing retention settings before you have preserved the evidence that still exists.
The pattern matches what made the Ollama network troubleshooting guide useful: start with the exact symptom, run one reproducible probe, state the expected result, and branch only on evidence.
Keep Tool Access Separate From One Transcript
A recovered conversation is useful, but credentials and integration setup should not depend on it. In a fresh Claude Code session, paste:
Then ask:
Expected result: one connected Action returns a verified read-only result in the fresh session, with no provider credential pasted into the conversation. Use Aident Loadout and measure success as one schema inspection, one successful result, and zero shared secrets.
Sources
Manage sessions, Claude Code documentation, accessed July 27, 2026
Data usage and local transcript retention, Claude Code documentation, accessed July 27, 2026
Session stopped persisting to JSONL for 10 days, GitHub issue, opened July 20, 2026
Claude Desktop conversation history lost on restart, GitHub issue, opened June 27, 2026
Desktop session history list frozen, GitHub issue, opened July 4, 2026
Reinstalling Claude Desktop wipes Code history, GitHub issue, opened July 17, 2026
cleanupPeriodDays: 0transcript persistence report, GitHub issue, opened February 17, 2026Claude Code silently deletes sessions older than 30 days, Reddit, July 25, 2026
Deleted Session History?, Reddit, July 6, 2026
Claude Code Wiped His Sessions. He Lost Nothing., YouTube, July 26, 2026
CLAUDE_CONFIG_DIRliteral-tilde session path report, X, July 23, 2026


