Where are Claude Code session histories stored?
Short answer: everything is stored locally under ~/.claude/projects/ as JSONL files — no cloud sync, no account-based session history.
Directory layout
~/.claude/
├── projects/ # ← all session history lives here
│ ├── -Users-you-Documents-app/ # one directory per project (path-mangled)
│ │ ├── 9a1b2c3d-….jsonl # one file per session
│ │ └── 7c2d3e4f-….jsonl
│ └── -home-you-shop-api/
│ └── …
├── claude.json # global config (MCP, theme, project state)
└── … (cache, logs, stats and other auxiliary files)
Naming rule for project directories: every /, _ or other non-alphanumeric character in the project path becomes a -. All sessions of one project therefore cluster in one directory — which is also how viewers "group by project".
What’s inside a JSONL file
JSONL = one independent JSON object per line. A session file records the full conversation in chronological order. Main entry types:
| type | Content |
|---|---|
user | Your input (text / images) and tool results sent back |
assistant | Model replies: text, thinking blocks, tool_use calls and token usage |
system | System events (hooks, etc.) |
summary / ai-title | Session summary and auto-generated title |
cost-state | Cost & usage snapshot (total cost, lines +/- , API duration) |
Each entry also carries metadata: timestamp, cwd (project path), gitBranch, version, sessionId, and more. In other words, the history file is more complete than what the terminal shows — reasoning, raw tool parameters and results, and token consumption are all in there.
What this means for you
- Privacy is in your hands: the files never leave your machine. Conversely, back up
~/.claude/projects/before switching machines or reinstalling, or the history is gone; - Files can be sensitive: sessions contain source code snippets, file paths, command output, even secrets — don’t share .jsonl files casually or post them publicly;
- Size grows: after a few months of heavy use, a single session can reach several (or tens of) MB and the whole directory hundreds of MB — that’s normal.
How to read this history comfortably
Reading raw JSONL is a slog. Open the directory with CCViewer (whole-folder drag & drop supported): sessions group by project, and Markdown, thinking blocks, tool calls and cost stats are all rendered graphically — with parsing happening only in your browser, preserving the "data never leaves this machine" property.
Open the page and drop in a
.jsonl file — or the whole ~/.claude/projects/ folder. Markdown rendering, thinking blocks, tool calls, token & cost stats, all processed locally in your browser. Nothing is ever uploaded.