Skip to main content
Every Claude Code conversation is a session: a UUID-identified transcript saved as a JSONL file on disk. Sessions persist across terminal restarts, letting you pick up any conversation exactly where you left off.

What sessions are

When you start Claude Code, it creates a new session with a random UUID. Every message you send, every assistant response, and every tool call is appended to a JSONL transcript file in real time. Sessions are stored under:
~/.claude/projects/<sanitized-project-path>/<session-id>.jsonl
The project path is derived from the working directory you launched Claude Code in. Each project directory gets its own subfolder, so sessions from different projects are kept separate.
The root of all session storage is ~/.claude/projects/. This directory is created automatically on first use.

Continuing the most recent session

Use -c / --continue to re-open the most recent session for the current directory without picking from a list:
claude -c
This is the fastest way to resume if you just closed the terminal and want to continue where you left off.

Resuming a specific session

Use -r / --resume to resume any saved session.
Run --resume with no argument to open an interactive picker showing recent sessions for the current project:
claude --resume
You can also pass a search term to filter the list:
claude --resume "auth refactor"

Session titles

Each session is shown in the resume picker with a title. Titles are generated automatically from the first meaningful message you sent in that session (the first prompt that is not a tool notification or system message). You can set a custom display name for a session at startup with --name:
claude --name "payment service refactor"
Named sessions appear with your chosen title in /resume and in the terminal tab title.

Clearing session history

Run /clear (aliases: /reset, /new) inside the REPL to discard the current conversation history and start fresh within the same terminal session. This is equivalent to beginning a new session without exiting Claude Code.
/clear
/clear frees up context and starts a new conversation, but does not delete the previous session transcript from disk. You can still resume it later with /resume.

Exporting a session transcript

Use /export to save the current conversation to a file or copy it to the clipboard:
/export
/export my-session.md
If no filename is given, Claude Code will prompt you for a destination or offer to copy to the clipboard.

Disabling session persistence

To run a session without saving it to disk at all, pass --no-session-persistence together with --print:
claude -p "one-off query" --no-session-persistence
Sessions run with this flag are not written to ~/.claude/ and cannot be resumed.

Multiple concurrent sessions

You can run multiple Claude Code instances at the same time in different terminals. Each instance creates and manages its own session independently. Sessions from different working directories are stored in separate project subdirectories, so there is no conflict. When running multiple instances in the same directory, each gets a unique UUID and its own JSONL file.

Session storage layout

~/.claude/
└── projects/
    └── <sanitized-project-path>/
        ├── <session-id>.jsonl          # main session transcript
        └── <session-id>/
            └── subagents/
                └── agent-<agent-id>.jsonl   # subagent transcripts
Each .jsonl file contains one JSON object per line. Each line is a message — user turn, assistant turn, tool call, or system event — appended as the session progresses.
Session files can grow large for long agentic runs. Use /compact periodically to summarize the conversation and keep the context window manageable. Compacted sessions still resume correctly.

Build docs developers (and LLMs) love