Claude Code session history disappeared: four reasons
A session missing from claude --resume has usually not been deleted. The picker answers a narrower question than people think it does, and three of the four causes leave every byte still sitting on disk.
Check the cheap three first
Only the last of these removes data. Work through them in order, because the first three are a one-line check each.
1. You are in a different directory
The picker is scoped to the working directory you launched from. Sessions from a sibling repository, or from the same repository entered by a different path, are not in the list and never were. Go back to the directory the work happened in and run claude --resume there.
2. The directory was renamed or moved
Claude Code files sessions under the working directory with each slash turned into a dash:
/home/user/code/example -> ~/.claude/projects/-home-user-code-example/ /home/user/work/example -> ~/.claude/projects/-home-user-work-example/
Move or rename the repository and new sessions land in a new folder, while every old one stays filed under the old name. Nothing is lost. List ~/.claude/projects/ and the old folder is usually sitting right there.
3. A second profile has its own tree
CLAUDE_CONFIG_DIR does not add a setting; it relocates the entire config root. Work done with it set to ~/.claude-work writes to ~/.claude-work/projects/, and anything reading ~/.claude sees none of it. If you run more than one profile, you have more than one history, and each is invisible to the other.
4. The 30-day sweep took it
This is the one that actually deletes. Transcripts are kept for 30 days by default, set by cleanupPeriodDays, and the sweep runs against the transcripts rather than the auto-memory directory, which is excluded. If the session is older than your retention window and the folder is correct, the file is gone from disk.
Raising cleanupPeriodDays changes the window from now on. It does not bring back anything already swept.
Finding it without the picker
The picker is not the only way in. If the file still exists, grep will find it:
$ ls ~/.claude*/projects/ every project folder, including profiles you forgot about $ grep -rl "the thing you remember saying" ~/.claude*/projects/ filenames; the content is JSONL, so pipe a hit through jq
The only fix that works before the fact
Three of the four causes above are about where you are looking. The fourth is a clock, and a clock cannot be argued with after it has run. An index reads the transcripts while they still exist and keeps what it read, so the 30-day window stops being the limit on how far back you can ask. It also spans the profiles and directories that the picker splits your history across. How to view the history you do still have.
Index it before the sweep does Where every tool keeps its sessions
Questions
| Why did my Claude Code session history disappear? | Four causes. You are in a different directory from the one the work happened in, the directory was renamed or moved, a second profile under CLAUDE_CONFIG_DIR has its own separate tree, or the 30-day retention sweep deleted it. Only the last one removes data. |
| Are my old sessions deleted or just hidden? | Usually hidden. claude --resume only lists sessions for the current working directory, so anything from elsewhere is absent from the list while still sitting in ~/.claude/projects/. |
| I renamed my project folder and lost my history. Can I get it back? | Yes. Sessions are filed under the working directory with slashes turned into dashes, so the old sessions are still under the old folder name in ~/.claude/projects/. List that directory and the previous name is usually there. |
| Does Claude Code delete old sessions? | Yes, after 30 days by default, set by cleanupPeriodDays. The auto-memory directory is excluded from the sweep; the transcripts themselves are not. |
| Can I recover a session the 30-day sweep deleted? | Not from Claude Code. Raising cleanupPeriodDays widens the window from that point on and does not restore anything already removed. Recovery only works if something copied the transcript out before the sweep ran. |
| Why does claude --resume show nothing at all? | You are almost certainly in a directory that has no sessions filed against it. Check ls ~/.claude*/projects/ to see every project folder, including any created under a second CLAUDE_CONFIG_DIR profile. |
More notes
| Cursor chat history: where it lives and how to read it | Cursor keeps chat history in two different SQLite databases depending on whether you used the IDE or the CLI, and it has moved the IDE format three times. |
| The three kinds of MCP memory server | Knowledge-graph stores, note-takers and session indexes are three different products wearing one label. Which one you need depends on a single question. |
| Compacting conversation: what Claude Code keeps and drops | What auto-compact does to a long session, why the assistant starts contradicting itself afterwards, and how to get the lost detail back instead of retyping it. |