
Claude Code Archive: How to Find and Read Old Sessions (2026)
Where Claude Code archives old sessions by OS, how to list them from the CLI, and the fastest way to export and reread any archived session in 2026.
Claude Code Archive: How to Find and Read Old Sessions (2026)
Claude Code does not have an archive button. That trips a lot of people up. You finish a long session, close the terminal, and a week later you want to pull it back up to copy the migration plan or quote the model to a teammate. There is no "Archive" tab in a sidebar, because Claude Code is not a chat app. It is a CLI, and the archive is already sitting on your disk whether you asked for it or not. The surprise is usually a good one: nothing is lost, you only have to know where to look.
Once you know where the files live and how to list them, "find my old Claude Code session" becomes a 10 second job. The rest of this post is the short archive-focused version. It covers the folder layout per OS, the two terminal commands worth memorizing, how to export a specific archived session into readable markdown, and a short FAQ for the edge cases. If you want the long walkthrough that covers message schema, tool call parsing, and the full workflow, read how to find and read Claude Code chat history for the full walkthrough. That piece and this one together are everything most people need.
Where Claude Code Archives Live by Operating System
Every Claude Code session is written to one JSONL file as it happens. There is no cloud sync, no server copy, and no deletion on exit. Your archive is literally the folder on your laptop, written one line at a time as the model and your tools go back and forth. The paths are stable across recent CLI versions:
- macOS and Linux:
~/.claude/projects/<encoded-project-path>/<session-id>.jsonl - Windows:
%USERPROFILE%\.claude\projects\<encoded-project-path>\<session-id>.jsonl - WSL: same as Linux, inside the WSL home, not the Windows one
The <encoded-project-path> is the directory you were in when you launched Claude Code, with slashes swapped for dashes. If you ran it inside /Users/you/code/payments-api, the folder will be named -Users-you-code-payments-api. Each .jsonl file is one full session, from the first prompt to the last tool call. The file format and storage layout are described in the public Claude Code docs, and the CLI itself is open at anthropics/claude-code on GitHub if you want to confirm anything by reading source.
How to List Your Archived Sessions From the Terminal
The fastest way to see what you have is to list the folder sorted by modification time. On macOS or Linux the one-liner below gives you the 20 most recent sessions across every project, with human-readable timestamps. If you only want one project, point ls at that subfolder directly instead of globbing across the whole tree. The command is harmless, so run it on any machine where you have used Claude Code and see what falls out.
ls -lt ~/.claude/projects/*/*.jsonl | head -20
To find a session by content, rg works on JSONL out of the box, because each line is valid JSON and the message text is a plain string field. The invocation below returns every session file that mentions "stripe webhook", one path per line. From there, you have the path, you have the timestamp, and you can open the file. For bulk work, pipe the output into xargs and your exporter of choice.
rg "stripe webhook" ~/.claude/projects/ -l
Opening a .jsonl in less is readable but ugly, because every line is one JSON record and the formatting is one long squished object per message. The two things worth doing before you read it in anger are to pretty-print the JSON for quick scanning, and to export the whole session to markdown for real reading. The pretty-print path is a one-liner with jq .. The export path takes a tiny bit more work and is covered in the next section.
How to Open and Read a Specific Archived Session
Inside an active Claude Code session, the built-in /export command dumps the current conversation to a markdown file in your working directory. That is the easy path. For an archive, that command is not available to you, because the session is already closed and the CLI is no longer attached to the transcript in memory. You have two realistic options, in rough order of effort:
- Script against the JSONL. A 20 line
jqor Python script walks the file, pullstype,role, andcontentfrom each line, and emits## Userand## Assistantheaders followed by the message text. Keep tool calls inline. The tool call log is usually where the real reasoning lives, and stripping it leaves you with half of a conversation. - Use a community exporter. Several small tools on GitHub walk
~/.claude/projects/and emit one markdown file per session. Pick one with recent commits and no telemetry, and skim the source before you point it at a folder full of your work.
Either way, the output is a single .md file per session, with turn headers, fenced code blocks, and tool blocks preserved. Save them in a dedicated ~/claude-archive/ folder, name files by project plus date, and resist the urge to flatten tool outputs into prose. Now you have the archive in a shape worth reading. If a given session has an enormous rg or cat dump bloating the file, trim those blocks to the first and last 50 lines on the way out, as covered in handle long code blocks in AI answers.
Reading the Export Without a Wall of Monospace
A busy Claude Code session is routinely 15,000 to 40,000 words of mixed prose, bash output, diffs, and code. Dropping that into Notion flattens the typography and buries the headings. Dropping it into VS Code gives you a wall of monospace with no outline, which is fine for grepping and bad for rereading. You want a reader that treats long AI output as a document, not as a chat log, and that keeps code and prose visually distinct without you having to configure anything.
That is what Prism MD is built for. It renders markdown with real serif typography, keeps code blocks monospaced and copyable, generates an outline from your H2 headings, and does not choke on 30,000 word files on a phone. The archive loop is boring and short: export the session, open the .md in Prism MD, skim the outline, jump to the three turns that mattered, bookmark two, close the tab. Fifty sessions in, you have an archive you will revisit instead of hoard, which is the whole point of keeping one.
FAQ
Does Claude Code have an archive command? Not as of 2026. There is no /archive flag and no cloud archive, and the roadmap does not advertise one. The archive is the folder ~/.claude/projects/ on your machine, and every session you have ever run is already in it unless you deleted the file manually. The CLI does not delete sessions on exit, so your worst case is a folder that keeps growing. Clean it up on your own schedule.
How do I show the archive inside Claude Code? You cannot list archived sessions from inside the CLI the way you would in ChatGPT or Claude.ai. The only way to show the archive is from your terminal, by listing ~/.claude/projects/ with ls or by searching across it with rg. If you want a UI, export the sessions to markdown and open them in a dedicated reader. There is no first-party viewer, and that is unlikely to change given how the tool is positioned.
Can Claude Code read my Claude.ai chat history? No. Claude.ai and Claude Code are separate products with separate storage. Claude.ai conversations live on Anthropic servers and are reachable only through the web app and the official export flow. Claude Code sessions live only on your disk. Nothing in the CLI reaches into your Claude.ai history, and nothing in Claude.ai reaches into your local archive. If you want both in one reader, export each and open them side by side.
Is it safe to delete old .jsonl files to clean up? Yes, with one caveat. Deleting the file removes the session from your archive and nothing else breaks, since Claude Code does not depend on prior sessions to run. The caveat is secrets: if a session included a .env dump or an API response with a token, those values are sitting in plaintext in the file. Redact or shred before syncing anywhere, and treat ~/.claude/projects/ like any other secrets-adjacent folder. The redact sensitive info from AI conversations guide covers the pattern.
Open Your Claude Code Archive in a Real Reader
Open Prism MD free and give your Claude Code archive a reader that respects it. Export your next session, drop the markdown in, and read it the way you would read a well-set document. Your archive is only as useful as the reading you give it, and a terminal buffer is not reading. Fifty sessions in you will wonder how you worked without one, and the terminal scrollback will stop being the system of record for the thinking you paid the model to produce. Build the loop once and the archive earns its keep for years.
Related reading
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


