How-To

Where Does Claude Code Store Conversation History?

Claude Code stores each session as a .jsonl file under ~/.claude/projects, one file per conversation. Here is exactly where to find, read, and back them up.

Claude Code stores your conversation history locally, as plain files, under ~/.claude/projects. Every session you have ever run is there — grouped by the project you ran it in, one file per conversation. Nothing lives on a server, which is good for privacy but means finding and reading an old session is on you. Here is exactly how the storage is laid out.

LLMnesia⌘ ⇧ 9
mediterranean diet inflammation
30 indexed · for previous
Mediterranean diet effects on chronic inflammation markers
Multiple cohorts show a mediterranean diet lowers CRP and other inflammation markers.
Perplexity6 days ago
Build a mediterranean diet meal plan low in inflammation triggers
A mediterranean diet built on olive oil, fish, and greens limits inflammation triggers.
ChatGPT2 weeks ago
Summarise this paper on mediterranean diet and inflammation
The paper finds mediterranean diet adherence correlates with reduced systemic inflammation.
Claude3 weeks ago

The short answer

Your sessions are in your home directory:

~/.claude/projects/

On macOS and Linux that expands to /Users/you/.claude/projects or /home/you/.claude/projects. On Windows it lives under your user profile folder. It is a hidden folder (the leading dot), so you may need to enable "show hidden files" in your file manager to see it.

How the folder is organised

Open ~/.claude/projects and you will see one subfolder per project you have used Claude Code in. Each subfolder is named after the working directory you launched Claude Code from, with the path flattened into a single name. So a project you ran in ~/code/my-app becomes its own folder, and every session you started there lands inside it.

Inside each project folder are the sessions themselves:

This layout is why your history is organised per project: every session you started in a given directory lives in that directory's folder — and it's why claude --resume and claude --continue only ever operate on the current directory's sessions, even if you pass --resume a specific session ID from elsewhere. There is no single built-in view that searches across everything, because your conversations are split across one folder per project on disk.

What is actually inside a session file

Each line of a .jsonl file is one event, and they are not all conversation. A typical session file interleaves:

That last two categories are why the files get large fast and why they read poorly as transcripts: a session where Claude read a handful of source files can be mostly file contents by volume. It is also why a raw grep returns noisy matches — your search term may well be hitting a file Claude read rather than something either of you said.

How this compares to other AI tools

Claude Code is unusual in keeping everything on your disk. Most AI tools keep history server-side, which changes what you can do with it:

ToolWhere history livesCan you back it up yourself?
Claude Code~/.claude/projects on your machineYes — copy the folder
Claude (web/desktop)Anthropic's servers, shown in the sidebarOnly via an account data export
ChatGPTOpenAI's serversOnly via an account data export
GeminiGoogle's servers, tied to your accountVia Google Takeout
Microsoft CopilotMicrosoft's serversOne conversation at a time

The upside of the local approach is real: nothing depends on an account staying active, and a folder copy is a complete backup. The trade-off is that nothing indexes it for you — the server-side tools at least give you a sidebar. For Claude Code, searching your history is entirely on you.

Reading a session file

Because the files are plain text, you can open any .jsonl file in a text editor to inspect it. Each line is valid JSON, so a tool like jq helps pull out just the parts you care about. To read a session as flowing text rather than raw objects, you would extract the message content line by line — the raw file interleaves your prompts and Claude's replies with tool calls and file contents, so it is denser than a clean chat transcript.

To search across all of them for a phrase you remember, ripgrep reads the nested folders quickly:

rg -i "the phrase you remember" ~/.claude/projects

Backing it up

Since your history is just a folder of files, backup is simple: copy ~/.claude/projects somewhere safe, and restore it by copying it back. A few things worth knowing:

Making them searchable

Knowing where the files are is half the battle; reading them is the other half. Raw JSONL is fine for a one-off grep, but it is not how you want to browse your history day to day.

LLMnesia reads these session files and turns them into clean, searchable conversations — indexed locally, on your device, alongside your ChatGPT, Claude, and Gemini chats. Point it at your ~/.claude/projects folder once (or let its optional background helper keep it in sync), and you can search every session by keyword, then reopen the one you want in the Claude Desktop app or resume it from the terminal. It indexes only your prompts and Claude's replies, leaving file reads, commands, and tool output out — which is exactly the noise that makes a raw grep frustrating.

If you are trying to track down one particular session right now, the step-by-step guide to finding an old Claude Code conversation works through each method in order.

Where does Claude Code store conversation history?

Claude Code stores conversation history in ~/.claude/projects on your machine. Inside that folder is one subfolder per project you have used Claude Code in, and inside each of those is one .jsonl file per session. The files are local to your device and are not uploaded anywhere.

What format are Claude Code session files in?

Each session is a JSONL file — one JSON object per line — where each line records an event in the conversation, such as a user message, an assistant reply, or a tool call. You can open a file in any text editor, though the raw JSON is denser to read than a clean transcript.

How are Claude Code project folders named?

Each folder under ~/.claude/projects is named after the project directory you ran Claude Code in, with the path flattened into a single folder name. That is why sessions are grouped by project: every session started in a given directory lands in that directory's folder.

Can I back up my Claude Code history?

Yes. Because the sessions are plain files under ~/.claude/projects, copying that folder backs up your history, and restoring it puts the sessions back. Keep in mind the files hold the full conversation including tool output, so treat the backup as sensitive.

How do I search inside my Claude Code session files?

For a known phrase, run ripgrep across the folder: rg -i "your phrase" ~/.claude/projects. For ongoing search across every session by keyword, LLMnesia indexes these files locally and makes them searchable from one box, alongside your ChatGPT, Claude, and Gemini history.

Claude Code documentationLLMnesia — AI conversation search

Read next

How to Search Your Claude Code Conversation History

Search all your AI conversations in one place — LLMnesia indexes your ChatGPT, Claude, Gemini, Grok, and 10+ other AI chats locally on your device. No account, no cloud, completely private. Install LLMnesia free →