Claude Code writes every session to a JSONL transcript on your machine, under ~/.claude/projects/ in a folder named after the working directory. Use /export inside a live session to copy the transcript out, or read the JSONL file directly for sessions you already closed. Convert the JSONL to Markdown or PDF to get a readable record.
Short answer
Claude Code writes every session to a JSONL transcript on your machine, under ~/.claude/projects/ in a folder named after the working directory. Use /export inside a live session to copy the transcript out, or read the JSONL file directly for sessions you already closed. Convert the JSONL to Markdown or PDF to get a readable record.
Step by step
Export from inside the session: While the session is still open, run the /export command. Claude Code writes the current conversation out as a single file, which is the cleanest capture because it includes the rendered tool calls and their results in order.
Find the transcript on disk: For sessions you already closed, look under ~/.claude/projects/. Each project directory is named after the working directory path with slashes replaced by dashes, and each session inside it is one .jsonl file named with the session UUID.
Identify the right session: The JSONL files are named by UUID rather than by topic, so sort the directory by modification time to find recent work. The first few lines of each file contain the opening prompt, which is usually enough to recognise the session.
Resume rather than reconstruct: If the session is recent and you want to continue it rather than archive it, claude --resume lists recent sessions and reopens one with its full context intact. This is the right move before the context is compacted away.
Convert the transcript to a readable file: JSONL is one JSON object per line, mixing user turns, assistant turns, tool invocations, and tool results. Convert it to Markdown for a notes app, or PDF if the session needs to become a fixed record of what was changed and why.
Claude Code sessions are the most expensive conversations most developers have with an AI, and the easiest to lose. A long session contains the reasoning behind a refactor, the failed approaches you ruled out, and the exact commands that fixed a production problem. None of that is in your git history. When the terminal closes or the context gets compacted, the reasoning is gone even though the code remains.
Where the transcripts actually live
Claude Code persists sessions locally without being asked. The location is:
The directory name is your project path with the separators flattened, so /Users/you/code/api becomes something like -Users-you-code-api. Inside, every session is a separate JSONL file.
This is genuinely useful and almost undocumented. It means a session you thought you lost when you closed the terminal is very likely still sitting on your disk right now.
| What you want | Where to get it |
|---|---|
| The session you are in | /export |
| A session from earlier today | claude --resume |
| A session from last month | The .jsonl file on disk |
| Every session for a project | The whole project directory |
Why the raw JSONL is not a record
Open one of these files and you will find one JSON object per line, interleaving several different kinds of entry: your prompts, Claude's text responses, tool invocations with their full arguments, and the results those tools returned. A single file edit can produce several hundred lines of tool traffic around two lines of actual conversation.
That structure is exactly right for a program and exactly wrong for a person. You cannot read it, you cannot search it usefully, and you cannot hand it to a colleague or attach it to a pull request.
Turning sessions into something you can keep
ChatExports reads Claude transcript files and rebuilds them into ordinary linear conversations, then writes each one out as Markdown, PDF, Word, CSV, or plain text.
For Claude Code specifically, the useful outputs are:
Markdown, so the session drops into Obsidian, a repo's docs/ directory, or a project wiki alongside the code it produced
PDF, when the session is the audit trail for a change and needs to be a fixed artefact
Bulk conversion, when you want the whole ~/.claude/projects/ tree turned into a searchable folder of transcripts in one pass
Conversion runs locally in your browser. That matters more here than for ordinary chat exports: a Claude Code transcript routinely contains source code, file paths, environment details, and sometimes credentials that were on screen. It should not be uploaded to a conversion service, and with local processing it is not.
Save before compaction, not after
Long sessions get compacted. Claude Code summarises earlier turns to stay inside the context window, and the detail in those turns does not come back. The transcript on disk keeps the full record, but only up to whatever the session actually contained.
The practical habit: when a session solves something hard, export it then. Not at the end of the week, and not when you next need it.
If you also use Claude in the browser
Browser Claude and Claude Code are separate histories. The web app has its own export under Settings, then Account, delivered as JSON by email. Our Claude exporter page covers that side. If you work across both, you want both archived into the same place, which is where converting everything to one format pays off.
Frequently asked questions
Where does Claude Code store conversation history?
In ~/.claude/projects/, with one subdirectory per working directory and one .jsonl file per session, named with the session UUID. The files persist after you close the terminal, so closed sessions are usually recoverable.
Can I recover a Claude Code session I already closed?
Usually yes. Run claude --resume to list recent sessions and reopen one, or read the .jsonl file for that session directly from ~/.claude/projects/. Sorting the directory by modification time is the quickest way to find it.
Does /export include tool calls and file edits?
Yes. The transcript captures tool invocations and their results alongside the conversation, which is what makes these sessions worth keeping. It also makes the raw file dense, which is why converting to Markdown or PDF is worth the extra step.
Is it safe to convert a Claude Code transcript?
With ChatExports, yes, because parsing happens locally in your browser and the file is never transmitted. Be careful with server-side converters: these transcripts often contain source code, internal file paths, and occasionally secrets that appeared on screen.
How do I archive every Claude Code session at once?
Point the converter at the transcript files from ~/.claude/projects/ and bulk-convert. You get one readable file per session, which you can then drop into a notes system or a repo and search normally.