Skip to main content
← All posts
A 30s East Asian woman software engineer in a deep charcoal merino turtleneck at a dark walnut desk at dusk, browsing an archived Claude Code terminal session on a 16 inch matte black laptop, split screen showing claude --resume --include-archived output in warm coral accents beside a clean markdown reader rendering a restored conversation, single brass desk lamp rim light, Monocle magazine editorial composition.
·6 min read

Claude Code Archive 2026: Browse, Restore & Export Archived Chats

How the Claude Code /archive command works, how to show archived chats, restore them with /unarchive, and export the sessions to clean markdown you can reread.

Claude Code has a /archive command, but it is quiet about what it does and where it puts things. The result is a lot of users who archive a chat, feel a small sense of accomplishment, and then cannot find the conversation again when they need it. The archive is not a trash can. It is not a cloud bucket. It is a local state flag on the session file, which means the chat still exists, still searchable, and still exportable, as long as you know how to look. This post walks the whole loop: browse what you have archived, restore it to the active list, and export the archived sessions to markdown you can reread.

What /archive Does In Claude Code

When you run /archive inside an active Claude Code session, the CLI marks the current conversation as archived and removes it from the default resume picker. The session file itself stays on disk. Nothing is deleted. Nothing is uploaded. The flag lives in a small sidecar record that Claude Code checks when it builds the list of recent sessions for claude --resume. That is why an archived chat seems to vanish from the picker even though a find ~/.claude/projects -name "*.jsonl" still lists it. Our earlier guide on the storage layout covers the folder structure in depth at where Claude Code chats live on disk.

The useful mental model is that archiving is the Claude Code equivalent of a Gmail archive. The message is still in your account, it simply is not in the inbox. You can bring it back, you can search across it, and you can export it the same way you export any other session. What you cannot do, at least not through the CLI, is undo an archive by clicking a button, because there is no button. Every archive and restore flows through either the /archive slash command or a direct edit of the sidecar state. Both are safe once you see them in action.

How To Show Archived Chats

The first thing most people want is a list. claude --resume hides archived sessions by default, which is the correct behavior most days and the wrong behavior on the day you need one back. The flag to flip is --include-archived. Running claude --resume --include-archived reopens the picker with every session visible, archived ones marked with a small tag next to the timestamp. Arrow through, hit enter, and you are back inside the conversation with full tool call history intact. If you prefer the raw list, ls -lt ~/.claude/projects/*/*.jsonl still shows everything, since the archive flag does not move files.

For a cleaner view, the Anthropic engineering docs describe the session metadata format, and the CLI is open source at anthropics/claude-code if you want to confirm the exact sidecar path for your version. A one liner that filters to archived chats only is jq 'select(.archived == true) | .sessionId' ~/.claude/projects/*/metadata.json 2>/dev/null. The exact key name has shifted between releases, so if that command returns nothing, open one metadata file in bat and match the field name. Once you can list archived sessions on demand, the rest of the workflow is unblocked.

Restoring An Archived Chat

Restoring is a single command. Inside the archived session, type /unarchive and Claude Code flips the flag back and returns the chat to the default picker. If the session is closed and you do not want to resume it to flip a flag, open the project metadata file in ~/.claude/projects/<encoded-path>/ and set the archived field for that session ID to false. Save the file and the next claude --resume run will show the chat in the normal list. The operation is cheap and reversible, which is the main reason to prefer archiving over deleting.

One small warning before you restore anything blindly. If you restore a session that references files you have since deleted, the first resumed turn may feel odd because the model expects context that no longer exists on disk. The workaround is to export the session to markdown first, reread it in a proper reader, and then decide whether a resume or a fresh session is the right next move. Rereading before resuming also catches the common case where the old plan has been overtaken by events, and you are better off starting clean. Our guide on resuming any past Claude Code session covers the resume flow in detail and pairs well with this one.

Export Archived Sessions To Markdown

The point of keeping an archive is to reread it later. The CLI buffer is not reading, and neither is scrolling a 30,000 word JSONL file in less. The clean path is to export each archived session you care about into markdown, then open it in a reader built for long AI output. From inside an archived session resumed with --include-archived, type /export and Claude Code writes a markdown file to your working directory with turn headers, fenced code blocks, and tool call blocks preserved. For bulk work, point a 20 line script at ~/.claude/projects/ that filters on the archived flag and emits one .md per session.

  • Export in the active archived session with /export for a quick one off.
  • Script a bulk export with jq plus a tiny Python or Node wrapper that walks the archive flag.
  • Keep tool call blocks in the output, since they often hold the reasoning you will want later.
  • Redact secrets before syncing the folder anywhere, because .env values can sit in plaintext.
  • Name files by project and date so the archive stays browsable a year later.

Once you have the markdown, open it in Prism MD. The reader respects proper typography, keeps code blocks copyable, and builds an outline from your H2 headings so a long archived chat reads like a design doc instead of a log. For the longer argument on why a dedicated reader beats a general purpose editor for this workflow, our take sits at the best markdown reader for AI content. The result is an archive you will revisit instead of hoard, which is the whole point of archiving a chat in the first place.

FAQ

Where does Claude Code show the archive? There is no separate archive view in the CLI. Run claude --resume --include-archived to see every session with archived chats marked, or list files directly in ~/.claude/projects/ since the archive flag does not move anything on disk. Any session you see in that folder is still fully recoverable. If the picker still looks empty after you pass the flag, double check that you are inside the same project directory where the session was created, since the picker scopes by project.

Can I archive a session I already closed? Yes. Reopen it with claude --resume, pick the chat, and type /archive. If you do not want to reopen it, edit the sidecar metadata file for that project and set the archived field to true for the session ID. Both paths produce the same result, and neither one touches the underlying .jsonl content.

Does archiving free up disk space? No. The session file stays exactly where it was, and the sidecar flag is a handful of bytes. If disk space is the concern, export the session to markdown, confirm the export is complete, and then delete the .jsonl file. Treat the delete as permanent because there is no CLI trash can, and consider moving files into a ~/.claude/attic/ folder as a safety net instead.

Is there a way to see chat history in the Claude Code terminal without archiving? Yes. Use claude --resume for the picker, or less on a specific .jsonl file for a raw view. For readable output, run /export inside the session and open the resulting markdown in a proper reader. Our full walkthrough of the history layout is at find and read Claude Code chat history, and it pairs cleanly with the archive flow described above.

Give Your Claude Code Archive A Reader

Reread your archived Claude Code sessions as clean, searchable markdown.

Free to start — no credit card.

Open Prism MD free →

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