> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/jackdog668/claude-code/llms.txt
> Use this file to discover all available pages before exploring further.

# Session management

> Understand how Claude Code saves, resumes, and manages conversation sessions.

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.

<Note>
  The root of all session storage is `~/.claude/projects/`. This directory is created automatically on first use.
</Note>

## Continuing the most recent session

Use `-c` / `--continue` to re-open the most recent session for the current directory without picking from a list:

```bash theme={null}
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.

<Tabs>
  <Tab title="Interactive picker">
    Run `--resume` with no argument to open an interactive picker showing recent sessions for the current project:

    ```bash theme={null}
    claude --resume
    ```

    You can also pass a search term to filter the list:

    ```bash theme={null}
    claude --resume "auth refactor"
    ```
  </Tab>

  <Tab title="Session ID">
    Pass the UUID directly to jump straight into a session:

    ```bash theme={null}
    claude --resume 3a8f1c2d-4b5e-6f7a-8b9c-0d1e2f3a4b5c
    ```
  </Tab>

  <Tab title="Slash command">
    From inside an active session, run `/resume` to switch to a different conversation without leaving the REPL:

    ```
    /resume
    /resume auth refactor
    /resume 3a8f1c2d-4b5e-6f7a-8b9c-0d1e2f3a4b5c
    ```

    The alias `/continue` also works.
  </Tab>
</Tabs>

## 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`:

```bash theme={null}
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
```

<Note>
  `/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`.
</Note>

## 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`:

```bash theme={null}
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.

<Tip>
  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.
</Tip>
