Gemini CLI
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.
Updated October 29, 2026 // Markdown
- Made by
- History lives in
- macOS / Linux
~/.gemini/tmp/<project-id>/chats/session-<date>-<id>.jsonl - Windows
C:\Users\<user>\.gemini\tmp\<project-id>\chats\
- macOS / Linux
- Format
- JSONL
- Kept for
- 30 days by default (general.sessionRetention.maxAge)
- Resume
gemini --resume, /resume- Cloud copy
- Local only
Gemini CLI saves every session automatically, per project, and cleans them up after 30 days unless you change it.
Where the files are
~/.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:
{
"general": {
"sessionRetention": { "enabled": true, "maxAge": "365d" }
}
}
maxCount caps the number of sessions instead; minRetention (default one day) protects recent ones.
Resume, share and delete
gemini --resume # the latest session
gemini --resume 3 # by index or session id
gemini --list-sessions
gemini --delete-session <id>
Inside the CLI:
/resumeopens a session browser (xdeletes the selected one)./chat save <tag>,/chat list,/chat resume <tag>,/chat delete <tag>manage named checkpoints./chat share file.mdorfile.jsonexports the conversation./quit --deleteleaves 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 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
Waitlist
Your sessions, your call.
We are building an opt-in marketplace where developers license redacted sessions they pick, one by one. Join to hear first.
Read next
- Claude CodeWhere Claude Code stores your session historyClaude Code keeps every session as a JSONL file in ~/.claude/projects and deletes them after 30 days by default. How to find, resume, export, keep and delete them.Read +
- Codex CLIWhere OpenAI Codex CLI stores your session historyCodex CLI saves each session as a rollout JSONL file in ~/.codex/sessions by date and compresses old ones to .jsonl.zst. How to find, resume, archive and delete them.Read +
- Market$500, then $200: what one posting tells us about the price of a coding sessionIn October 2026 Mercor paid developers $500 per recorded coding session, then cut it to $200 within a week. What the price says about the market for agent session data.Read +