The short answer
Claude Code saves each conversation as a JSONL file at ~/.claude/projects/<project>/<session-id>.jsonl. The <project> folder is your working directory's path with every character that isn't a letter or digit replaced by -. So a session started in /Users/me/app lands in ~/.claude/projects/-Users-me-app/. (Anthropic: sessions)
Sessions from the CLI and from the official VS Code extension are stored the same way, in the same place.
How long Claude Code keeps them
Thirty days, by default. A background sweep deletes transcripts older than cleanupPeriodDays, without a message, so an old session simply stops appearing in /resume. To keep them longer, set a larger number in ~/.claude/settings.json; 0 isn't allowed. (Anthropic: settings reference)
{
"cleanupPeriodDays": 365
}
If a session is already gone, it can't be recovered from Claude Code — only from a backup of your home folder.
Resume a session from the command line
| Command | What it does |
|---|---|
claude --continue | Reopens the most recent session in the current folder. |
claude --resume | Opens a picker of past sessions. |
/resume | Switches to another session from inside Claude Code. |
--fork-session | With --resume or --continue: starts a new session ID from the old conversation instead of reusing it. |
The picker shows sessions for the folder you're in. If you can't find one, you may be in the wrong directory — the session belongs to the folder it was started in.
Find a session when you don't remember where it was
- Search the files directly:
grep -l "the thing you remember" ~/.claude/projects/*/*.jsonlprints the matching transcripts. The folder name tells you the project. - Or check your prompts:
~/.claude/history.jsonlhas one line per prompt with its project. - Or use a viewer. Claude Code Manager's Sessions tab searches every transcript across all projects and resumes the one you pick in the right folder; its Prompts tab searches your prompt history.
Move a session to another machine
Copy the .jsonl file into the matching project folder on the other machine — the folder name has to match that machine's path to the project. Claude Code Manager's Export and Import do this for you: Import works out the right folder.
Should you edit or parse these files?
Read them if you like, but Anthropic notes the entry format is internal to Claude Code and changes between versions, so scripts that parse them can break on any release. For a readable copy, run /export inside the session.