
Claude Code Archive: Where Chats Go And How To Find Them
There is no archive button in Claude Code. Here is the folder it writes to, how to list and search it in one second, and how to back it up safely.
Claude Code does not have an archive button and the docs do not mention one, which sends a lot of people looking for a hidden menu. There is no menu. There is a folder. Claude Code writes every session to disk the moment you start it, so the archive you are looking for is already sitting on your machine. This post shows exactly where those files live, how to list them fast, and how to make them searchable without paying anyone or installing a plugin.
The short answer: on macOS and Linux, your Claude Code archive is ~/.claude/projects/. On Windows it is %USERPROFILE%\.claude\projects\. Every session is one JSONL file inside a per-project subfolder, and the file never gets deleted unless you delete it. If that is all you needed, you can stop reading and ls it. If you want to read what is in there properly, the next four sections are the useful part.
What Counts As The Claude Code Archive
There is no archive feature inside the CLI, so the word here means the full set of session transcripts persisted to disk. Each session becomes one .jsonl file under ~/.claude/projects/<encoded-project-path>/<session-id>.jsonl. The encoded project path is your working directory with slashes turned into dashes, so a project at /Users/you/code/api shows up as -Users-you-code-api. One folder per project, one file per session, in strict chronological order by filename timestamp.
Nothing else counts as the archive. The scrollback in your terminal is not it, because closing the tab wipes it. The clipboard is not it either. Tools like Warp or iTerm will show you the last few thousand lines, which is useful in the moment and useless three days later. If you want a durable record, the JSONL files are the only source of truth, and they are the thing to back up, index, and read from. Our full Claude Code chat history walkthrough covers the file schema line by line if you want to script against it.
Find Any Past Session In Under A Second
Once you accept that the archive is a folder, finding anything in it becomes a shell problem. The two commands below are enough for 90 percent of real lookups and run instantly even on a year of daily use. The second one wants ripgrep installed, which is a one line brew or apt step and worth it for everything else on your machine too. Memorize these, alias them, and the question of where you landed on that migration becomes a five second answer instead of a scrolling exercise.
- List the ten most recent sessions across all projects:
ls -lt ~/.claude/projects/*/*.jsonl | head -10 - Search every past session for a phrase:
rg -l "schema migration" ~/.claude/projects/
The ls -lt call sorts newest first and ignores empty directories, so the top of the list is almost always the session you want. The rg -l call prints only the file names that contain a match, which keeps the output readable when a phrase appears in dozens of sessions. Drop the -l to see the matching lines in context, with timestamps included for free. If you want surrounding turns, pipe through rg -B 5 -A 20 and you get a mini reader inside the terminal. The shape of this workflow is the same one covered in our Codex CLI find-export-search guide, because the ergonomics generalize across every coding agent that writes JSONL.
Read A Session Without Squinting
Finding a session is step one. Reading it is harder, because JSONL is not a human format. Every line is a JSON object with escaped newlines, inline tool calls, and fenced code blocks that render as literal backslash characters in a plain editor. You can get usable output with jq -r '.message.content', but that flattens the turn structure and loses the boundary between your prompt and the reply. For anything over a thousand words, the right move is to render the file to clean markdown once and reread the markdown.
Render with /export if the session is still open in Claude Code, or with a small jq or Python script if the session has already ended. Keep the tool call blocks in the output. Real reasoning often lives inside a Bash or Read invocation, and stripping tool calls leaves you with a conversation that reads like it had a stroke. Once you have a markdown file, open it in a reader that respects long AI output, keeps code monospaced, and generates an outline from your H2s. If you also need to rescue specific snippets from a session, our post on extracting code blocks from AI conversations has a short parser you can adapt.
Back Up The Archive Before It Hurts
The archive is a folder of files, so backing it up is the same as backing up any folder. Point Time Machine, Arq, or restic at ~/.claude/, exclude nothing, and you are done. If you work across two laptops, syncing ~/.claude/projects/ through iCloud, Dropbox, or Syncthing is enough to make yesterday's session on the desktop show up on the travel machine without surprise. Be slightly careful here, because a running Claude Code session can hold a file open, and some sync tools dislike that. In practice the collisions are rare and the files recover cleanly after the next sync pass.
Secrets are the real failure mode. If Claude Code read a .env or printed an API key during a session, that string is sitting in plain text inside a JSONL file forever. Before you push a backup to a shared drive, grep the folder for AWS_, SECRET, TOKEN, and your known key prefixes, and either redact or exclude the offending files. The same logic applies before you share an exported markdown transcript with a teammate. Treat the archive like a notes folder that occasionally contains your database password, and act accordingly.
FAQ
Is archive a real feature inside Claude Code? No. There is no archive command, no hidden menu, and no setting that turns one on. The folder at ~/.claude/projects/ is the only place sessions are stored, and it is written to automatically the moment you start a session. If you want archive-style ergonomics, build them around that folder with ls, rg, and your backup tool of choice.
Can I move old sessions to a separate archive folder? Yes. Claude Code does not reread old session files after they close, so you can move .jsonl files anywhere on disk without breaking the CLI or future sessions. A common pattern is ~/.claude/archive/YYYY-QN/ for quarterly rollover, which keeps the active folder small and keeps the archive discoverable. Avoid moving the file that belongs to a session you are currently resuming.
How large does the archive get over a year? Light users land near 100 MB after a full year of regular use. Heavy daily users with large tool outputs can reach 2 to 4 GB, which is still nothing for a modern disk. If size becomes a concern, prune sessions with zero assistant output or sessions older than your retention preference with a one line find -mtime command. The folder structure makes selective cleanup trivial and fast.
Where should I keep exported markdown versions? Somewhere separate from the raw JSONL archive, so you can regenerate them cleanly after a schema change in the session format. A ~/Documents/claude-exports/ folder synced to your preferred cloud is the pattern most people land on. It pairs well with any markdown reader and keeps your raw archive untouched for future re-exports. Keep the naming scheme consistent so old exports sort next to new ones.
Reread your Claude Code archive like documents, not logs.
Free to start — no credit card.
Related reading

Claude Code Archive 2026: Browse, Restore & Export Archived Chats
6 min read · claude-code · archive

Claude Code Archive: How to Find and Read Old Sessions (2026)
7 min read · claude-code · archive

How to Find and Read Your Augment Code Chat History: A Step-by-Step Guide
6 min read · augment-code · chat-history
Ready to read your own AI documents?
Open ChatGPT, Claude, Gemini, or any markdown file in the reader built for the way models write.
- ✓Renders code, math & Mermaid out of the box
- ✓Works offline once you've opened a doc
- ✓Free forever for personal reading