~/.claude/projects/<project>/<id>.jsonl

Where Claude Code stores your sessions

Every Claude Code conversation is a file on your disk. Here is where it lives, how long Claude Code keeps it, and how to get back to an old one.

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

CommandWhat it does
claude --continueReopens the most recent session in the current folder.
claude --resumeOpens a picker of past sessions.
/resumeSwitches to another session from inside Claude Code.
--fork-sessionWith --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

  1. Search the files directly: grep -l "the thing you remember" ~/.claude/projects/*/*.jsonl prints the matching transcripts. The folder name tells you the project.
  2. Or check your prompts: ~/.claude/history.jsonl has one line per prompt with its project.
  3. 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.

FAQ

Questions, answered

Why did my old Claude Code sessions disappear?

Most likely the cleanup sweep. Claude Code deletes transcripts older than cleanupPeriodDays — 30 days by default — without a message. Raise it in ~/.claude/settings.json (it can't be 0) to keep them longer.

Can I read the JSONL files directly?

You can, but Anthropic's docs warn the format is internal and changes between versions. Use /export, or a tool that reads them for you.

Free, open source, and it stays on your machine.

Apache-2.0. No telemetry, no account, no network client. Works with the Claude Code CLI and the official extension.

code --install-extension vishalguptax.claude-manager