Where Does Claude Code Store Chat History?
Claude Code is Anthropic’s terminal tool, and unlike a browser chat it leaves its conversations on your own disk. That is genuinely useful once you know where to look: you can resume yesterday’s session, grep an old run for the command that worked, or confirm what a transcript is holding before you hand your laptop to someone else. This guide covers the exact paths, what each one contains, how long files survive, and the supported ways to reopen a past session.
Different tool, different history. This page is about Claude Code, the CLI you run in a terminal. If you are looking for the conversations you have with Claude in a browser tab, those live in your claude.ai account, not in a folder on your machine — see how to see all your Claude chats instead.
The short answer: ~/.claude/projects/
Anthropic documents the layout of the .claude directory, and session history
sits in one place:
~/.claude/projects/<project>/<session>.jsonl
Each of those files is, in Anthropic’s words, the “full conversation transcript: every message, tool call, and tool result.” One file per session, named by the session ID. Two sibling folders may appear alongside a transcript:
-
<session>/subagents/— subagent conversation transcripts, removed together with the parent session transcript when it ages out. -
<session>/tool-results/— large tool outputs spilled to separate files instead of being inlined.
On Windows the same path resolves to %USERPROFILE%\.claude. The full reference
is Anthropic’s
application data
documentation.
Decoding the project folder name
The folder under projects/ is keyed by the working directory the session ran
in, with the path separators flattened into dashes. A session started in
/home/user/work/my-repo lands in:
~/.claude/projects/-home-user-work-my-repo/
That mapping is visible in the deletion plan Anthropic prints for
claude project purge, and it is what lets you match a folder to a repository
at a glance. If a session moved directories with /cd, Anthropic notes that
“the session is relocated to the new directory’s project storage,” so
look under the destination path, not the original one.
The other files worth knowing about
-
~/.claude/history.jsonl— “every prompt you’ve typed, with timestamp and project path,” used for up-arrow recall. It is not project-scoped and is not covered by the automatic cleanup below. -
~/.claude/file-history/<session>/— pre-edit snapshots of files Claude changed, which is what makes checkpoint restore possible. -
~/.claude/projects/<project>/memory/— a different feature entirely: auto memory, Claude’s own curated notes about the project, kept as plain markdown.
How long history sticks around
Not forever. Anthropic documents that Claude Code “deletes session files and other
application data older than this period at startup,” governed by the
cleanupPeriodDays
setting,
whose default is 30 days with a minimum of 1. Set it higher to keep more
history, lower to shed transcripts faster.
So if a session you remember from two months ago is missing, it has most likely already been swept — that is expected behavior, not a bug.
How to find and reopen an old session
You rarely need to open the raw files. Claude Code ships with flags and commands for exactly this, documented in the CLI reference:
-
claude --continue(-c) — “load the most recent conversation in the current directory.” The fastest way back into what you were just doing. -
claude --resume(-r) — “resume a specific session by ID or name, or show an interactive picker to choose a session.” Run it with no argument to browse. -
/resumefrom inside a running session — same picker, without leaving the terminal. Its alias is/continue. -
claude --resume abc123 --fork-session— resume but “create a new session ID instead of reusing the original,” so the original transcript stays as it was.
Name sessions so the picker is usable
A picker full of timestamps is not much of an index. claude -n "my-feature-work"
sets a display name that shows up in /resume and the terminal title, and you
can then resume it with claude --resume my-feature-work. /rename
changes it mid-session. If you are about to start something unrelated, /clear
takes an optional name too — it labels the conversation you are leaving behind so you can
find it again later.
Reading a transcript by hand
The files are JSONL: one JSON object per line, so ordinary tools work on them. To get a
human-readable copy of the session you are currently in, /export writes
“the current conversation as plain text,” either straight to a filename or via
a dialog to copy or save.
These files are plaintext. Anthropic is explicit: transcripts and history
are not encrypted at rest, and OS file permissions are the only protection. Anything that
passes through a tool lands in the transcript — file contents, command output, pasted
text. If a command printed an API key, that key is in a .jsonl file on your
disk right now.
Cleaning up, and the claude.ai side of things
If your reason for hunting down these paths was to get rid of them rather than read them, there is a supported command for that and a set of files you should leave alone — covered in how to delete Claude Code session history.
And if you actually landed here about the other Claude — the chat list in your browser — that history is not on your disk at all. It is managed inside claude.ai, which has a built-in multi-select for deleting conversations but no select-all and no filter to select by. That gap is what our Chrome extension fills.
Folders, pins, search, and single delete are free. Bulk delete is part of Pro ($19/year or $12 lifetime — launch price, regularly $39). Works on claude.ai in the browser, not on the Claude Code CLI. Unofficial; not affiliated with Anthropic.
FAQ
Where are Claude Code conversations stored on disk?
Anthropic documents the path as ~/.claude/projects/<project>/<session>.jsonl
— one JSONL file per session, holding the full conversation transcript: every message,
tool call, and tool result. On Windows, ~/.claude resolves to
%USERPROFILE%\.claude. Separately, ~/.claude/history.jsonl
records every prompt you have typed, with a timestamp and the project path, and powers
up-arrow recall.
Why is my project folder named with dashes instead of slashes?
The folder under ~/.claude/projects/ is keyed by the working directory the
session ran in, with the path separators flattened into dashes. A session started in
/home/user/work/my-repo lands in
~/.claude/projects/-home-user-work-my-repo. Anthropic’s own purge
example shows exactly this mapping, and it is what makes it easy to spot which folder
belongs to which repository.
How long does Claude Code keep old sessions?
Thirty days by default. Claude Code deletes session files and other application data older
than the cleanupPeriodDays setting at startup, and Anthropic documents the
default as 30 days with a minimum of 1. Raise the value if you want longer history, lower
it if you want transcripts off your disk sooner.
Does Claude Code history include my claude.ai chats?
No. Claude Code is the terminal tool, and its transcripts are files on your own machine.
Conversations you have with Claude in a browser on claude.ai live in your claude.ai
account and are managed from that interface — they never appear in
~/.claude/projects/. The two histories are separate and are cleared in
completely different ways.
Can I read a Claude Code transcript file directly?
Yes. Transcripts are JSONL — one JSON object per line — and Anthropic states plainly that
they are not encrypted at rest, with OS file permissions as the only protection. That also
means anything a tool touched is on disk in plaintext, so if a command printed a
credential, the value is sitting in the transcript. For a readable copy of the session you
are in, /export writes the conversation out as plain text.
Related guides
- How to delete Claude Code session history — the purge command, and the files to leave alone.
- How to see all your Claude chats — the browser side: why the sidebar shows only the recent ones.
- Does Claude really delete your chats? — what Anthropic actually commits to after you hit Delete on claude.ai.
- How to delete all Claude chats — clearing a long chat history in the browser.