{"slug": "how-to-recover-a-lost-claude-code-session-when-continue-fails", "title": "How to Recover a Lost Claude Code Session When --continue Fails", "summary": "A developer documented how to recover a lost Claude Code session when the `claude --continue` flag fails to find the previous conversation. Because Claude Code stores sessions per project folder under `~/.claude/projects/`, `--continue` only opens the most recent session in the current directory; the developer recommends grepping the `.jsonl` transcript files for a distinctive term, then using the resulting file path to extract the folder and session ID and resume with `claude --resume <id>`.", "body_md": "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.\n\nClaude 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.\n\n`--continue` only opens the **most recent** session in your current folder. So it picks the wrong one if:\n\n```\nls ~/.claude/projects/\n```\n\nLook for folders that match your project path. In my case there were two candidates: one for the parent `claude_skills` folder and one for the `anki-skill` subfolder.\n\nEach session is a `.jsonl` file, so you can grep for something distinctive you know came up in the conversation, like a config key, filename, or error message:\n\n```\nls -lt $(grep -l \"webCorsOriginList\" ~/.claude/projects/-Users-yourname-path-to-project*/*.jsonl)\n```\n\n`grep -l` lists the files that contain the word, and `ls -lt` sorts them newest first. My top result was:\n\n```\n~/.claude/projects/-Users-yourname-...-anki-skill/aaa6d99e-356e-4148-982e-e6e7a3133939.jsonl\n```\n\nThe folder name tells you where the session was started, and the filename (minus `.jsonl`) is the session ID.\n\n```\ncd /path/to/anki-skill\nclaude --resume aaa6d99e-356e-4148-982e-e6e7a3133939\n```\n\nRun this from the folder the session belongs to, or Claude Code won't find it.\n\nIt's fine to resume a session while a *different* session is open in another terminal tab. Just don't resume the *same* session in two tabs at once, since both would write to the same transcript. Also avoid having two sessions edit the same files at the same time.\n\nSkip the guesswork and go straight to Step 2: grep for a word unique to the conversation you want. The file path gives you the folder and the session ID, and `claude --resume <id>` brings it back.", "url": "https://wpnews.pro/news/how-to-recover-a-lost-claude-code-session-when-continue-fails", "canonical_source": "https://dev.to/stanley_f57ec6c939e0e82db/how-to-recover-a-lost-claude-code-session-when-continue-fails-35h5", "published_at": "2026-09-23 05:45:20+00:00", "updated_at": "2026-09-23 05:52:35.807691+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents"], "entities": ["Claude Code", "Anthropic"], "alternates": {"html": "https://wpnews.pro/news/how-to-recover-a-lost-claude-code-session-when-continue-fails", "markdown": "https://wpnews.pro/news/how-to-recover-a-lost-claude-code-session-when-continue-fails.md", "text": "https://wpnews.pro/news/how-to-recover-a-lost-claude-code-session-when-continue-fails.txt", "jsonld": "https://wpnews.pro/news/how-to-recover-a-lost-claude-code-session-when-continue-fails.jsonld"}}