# Where Gemini CLI stores your session history

> Gemini CLI saves sessions as JSONL files in ~/.gemini/tmp/<project>/chats and deletes them after 30 days by default. How to find, resume, share and keep them.

Source: https://groundedby.com/agents/gemini-cli (updated 2026-10-29)

Gemini CLI saves every session automatically, per project, and cleans them up after 30 days unless you change it.

## Where the files are

```text
~/.gemini/
├── projects.json                  # project folder -> project id
└── tmp/
    └── my-app/                    # project id
        └── chats/
            ├── session-2026-10-29T09-14-ab12cd34.jsonl
            └── checkpoint-<tag>.json    # saved with /chat save
```

The project id is the project folder's name, lowercased and slugified, with `-1`, `-2` added when two projects share a name. Older versions used a hash of the path; those folders are migrated automatically. Some documentation still describes the hash.

On Windows the tree is under `C:\Users\<user>\.gemini`. `GEMINI_CLI_HOME` moves it.

## What is inside

Each file opens with session details (`sessionId`, `startTime`, `lastUpdated`, `summary`), followed by messages with `id`, `timestamp`, `type` and `content`. Model messages add `toolCalls`, `thoughts`, `model` and `tokens`.

## Keep sessions longer

In `~/.gemini/settings.json`:

```json
{
  "general": {
    "sessionRetention": { "enabled": true, "maxAge": "365d" }
  }
}
```

`maxCount` caps the number of sessions instead; `minRetention` (default one day) protects recent ones.

## Resume, share and delete

```bash
gemini --resume              # the latest session
gemini --resume 3            # by index or session id
gemini --list-sessions
gemini --delete-session <id>
```

Inside the CLI:

- `/resume` opens a session browser (`x` deletes the selected one).
- `/chat save <tag>`, `/chat list`, `/chat resume <tag>`, `/chat delete <tag>` manage named checkpoints.
- `/chat share file.md` or `file.json` exports the conversation.
- `/quit --delete` leaves and deletes the current session.

## Privacy notes

Sessions are stored only on your machine. Prompts are sent to Google's API under the terms shown by `/privacy`.

The groundedby [evaluator](/evaluate) does not read Gemini CLI sessions yet.

## Questions

**Where does Gemini CLI keep chat history?**

In ~/.gemini/tmp/<project-id>/chats, one session-<date>-<id>.jsonl file per session. The project id is your project folder's name, lowercased and slugified; ~/.gemini/projects.json maps folders to ids.

**How long does Gemini CLI keep sessions?**

30 days by default. The general.sessionRetention setting controls it - maxAge (default 30d), maxCount (default unlimited) and enabled (default true).

**How do I resume a Gemini CLI session?**

gemini --resume resumes the latest, or pass an index or session id. gemini --list-sessions lists them, and /resume opens a browser inside the CLI.

## Sources

- [Gemini CLI docs, session management](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/session-management.md)
- [Gemini CLI source, storage paths](https://github.com/google-gemini/gemini-cli/blob/main/packages/core/src/config/storage.ts)
