Shabash
Blog · Claude Code guides

Gemini CLI: how to resume a session, and why old sessions disappear after 30 days

Resume, list, search and export Gemini CLI sessions, where they're stored, and the retention setting that deletes them after 30 days by default.

By Robin Mehta · September 25, 2026

Gemini CLI saves every session automatically and can resume any of them, but it also deletes them after 30 days unless you change a setting. Checked against the Gemini CLI docs as of September 2026 (v0.61.0).

Resuming

gemini --resume          # the latest session (short: -r)
gemini --resume 1        # by index from the list
gemini --resume <uuid>   # a specific session
gemini --list-sessions   # see what's there

Inside the CLI, /resume opens a session browser where you can search, preview, and press x to delete.

Where sessions are stored

Sessions save automatically to:

~/.gemini/tmp/<project_hash>/chats/

They're scoped to the project you started in. Named saves (below) live in ~/.gemini/tmp/<project_hash>/ too.

Why sessions disappear

Session retention is on by default:

{
  "general": {
    "sessionRetention": { "enabled": true, "maxAge": "30d" }
  }
}

Sessions older than 30 days are deleted, along with their plans, tool output and logs. To keep them longer, raise maxAge in your Gemini settings, or set enabled to false. There's also maxCount (unset, so unlimited, by default) and a minRetention floor of one day.

Saving, naming and exporting chats

/chat is now an alias of /resume, with these subcommands:

CommandWhat it does
/chat save <tag>Save the current chat under a name
/chat resume <tag>Go back to a named chat (/chat load works too)
/chat listList named chats
/chat delete <tag>Delete one
/chat share file.mdExport as Markdown (or .json for JSON)

Checkpoints are separate

Checkpointing snapshots your files before edits so /restore can roll them back. It's off by default; turn it on with "general": {"checkpointing": {"enabled": true}}. The old --checkpointing flag was removed in 0.11.0.

If you also use Claude Code, it has the same 30-day cleanup: see why Claude Code sessions disappear. Shabash keeps and organizes Claude Code sessions today, with other agents on the roadmap.

Questions

How do I resume a Gemini CLI session?

Run gemini --resume (or -r) for the latest, gemini --resume 1 for one by its index, or gemini --resume <uuid>. Inside the CLI, /resume opens a session browser.

Where does Gemini CLI store chat history?

In ~/.gemini/tmp/<project_hash>/chats/, saved automatically and scoped to each project.

Why did my Gemini CLI sessions disappear?

Session retention is on by default and deletes sessions older than 30 days (general.sessionRetention.maxAge = "30d"). Raise it or turn it off in your settings.

How do I export a Gemini CLI chat?

Use /chat share file.md for Markdown or /chat share file.json for JSON.