How to Recover a Lost Claude Code Session When --continue Fails
I ran claude --continue to pick up where I left off, and it didn't find my previous session. Here's why that happens and how I got it back. Why --continue misses sessions Claude Code saves sessions per folder, under ~/.claude/projects/ . Each project gets a subfolder named after the full path where you launched claude , with slashes and underscores turned into dashes. --continue only opens the…
Claude Code sessions are saved in separate folders under the ~/.claude/projects/ directory. Each session is a .jsonl file, and you can identify the correct one by searching for unique words from the conversation. The --continue command only opens the most recent session in the current folder, so it may not find the right session if you started a newer session in a different folder or the original session was launched from a different folder.
To recover a lost Claude Code session, list the session folders, search for a unique word in the .jsonl files, and then resume the session using its ID with the claude --resume command.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.