Where Claude Code stores session logs

Updated November 5, 2026

Claude Code stores each session as a JSONL file at ~/.claude/projects/<project>/<session-id>.jsonl, where the project folder name comes from the working directory path. For example, sessions from /home/me/app go in a folder named -home-me-app. By default, local transcripts are kept for 30 days.

To read one, open it in the agent log viewer, which shows the session as a conversation and runs in your browser.

Find your logs

# List projects
ls ~/.claude/projects/

# Most recently changed sessions across all projects
find ~/.claude/projects -name '*.jsonl' -printf '%T+ %p\n' | sort -r | head

The find example uses GNU options. On macOS, use ls -t ~/.claude/projects/*/*.jsonl | head.

Retention

The cleanupPeriodDays setting controls how long transcripts are kept. It defaults to 30 and must be at least 1, so use a large value such as 3650 for long retention. Deletion happens in a background sweep after a session starts, so old sessions can disappear without notice. Subagent transcripts are removed with their parent session.

To keep a session, copy its file somewhere else.

What is inside

Each line is a JSON record with a type field. In the session file we examined, these were the most useful types:

type Contains
user User messages, and tool results sent back to the model
assistant Model output, as a list of content blocks
system System events, such as hook activity

Assistant and user records hold a message object, and its content list uses block types including text, thinking, tool_use and tool_result. A tool_result links to its call through tool_use_id, which matches the id on the tool_use block.

Records also carry fields such as uuid, parentUuid, sessionId, timestamp, cwd and gitBranch. Turns from subagents have isSidechain set to true.

This format is an internal detail and changes between versions, and our sample session contained more than a dozen record types. Treat any parser as best-effort, and keep unknown types rather than dropping them.

Handle logs with care

Session logs can contain source code, file contents, command output and any secrets that appeared in them. Avoid pasting them into online tools that upload files. The agent log viewer processes them locally.