src/pages/sitemap.xml.tsOKgemini --resume 9b2e1dGemini CLI stores local conversation transcripts as JSON and JSONL files under ~/.gemini/tmp/<project-hash>/chats/. If GEMINI_CLI_HOME is set, Gemini CLI and CodeSesh read from $GEMINI_CLI_HOME/.gemini/tmp/ instead. To reopen a previous conversation in the terminal, run gemini --resume. To search conversations, tool calls, reasoning, and token usage across projects in a local Web UI, run npx codesesh --agent gemini-cli --days 0.
Where Gemini CLI stores local chat history
By default, Gemini CLI writes per-project chat transcripts under your home directory:
- Session files:
~/.gemini/tmp/<project-hash>/chats/*.jsonand*.jsonl - Custom root override: Set
GEMINI_CLI_HOMEto override the parent directory of.gemini/(CodeSesh scans$GEMINI_CLI_HOME/.gemini/tmp/)
Because folders under ~/.gemini/tmp/ are keyed by project hashes rather than readable repository names, locating a specific past conversation manually in the filesystem is slow.
Reopen a previous Gemini CLI session
When you are already inside the project directory, use Gemini CLI’s built-in resume flag:
gemini --resumeIf you have a specific session ID from CodeSesh, pass it directly to gemini --resume <session-id>.
Search and replay Gemini CLI history with CodeSesh
CodeSesh scans ~/.gemini/tmp/*/chats/ read-only, resolves project identities, and builds a local SQLite index so you can search across hashed project folders without opening raw JSON files.
Scan all local Gemini CLI sessions:
npx codesesh --agent gemini-cli --days 0Scope to the current repository:
npx codesesh --agent gemini-cli --days 0 --cwd .In the Web UI at http://localhost:4521, you can:
- Search across all projects: Match prompts, Gemini replies, tool outputs, and touched file paths without hunting through hashed directories under
~/.gemini/tmp/. - Replay reasoning and tool calls: Inspect thought steps, tool arguments, and results in chronological order, including nested subagent sessions.
- Inspect token usage and estimated cost: Review input, output, reasoning, and cached tokens per project or model.
- Copy resume commands: Copy
gemini --resume <session-id>directly from any session detail view.
Troubleshoot missing Gemini CLI sessions
- Check
GEMINI_CLI_HOME. RememberGEMINI_CLI_HOMEpoints to the parent directory containing.gemini/, not directly to.gemini/tmp/. - Pass
--days 0. Plainnpx codeseshopens with the last 7 local calendar days; pass--days 0or choose All in the UI for older chats. - Check temporary directory cleanup. Because Gemini CLI stores chats under
~/.gemini/tmp/, clearing that folder removes source records permanently. CodeSesh keeps already-indexed records if a source temporarily disappears, but cannot recover files deleted before scanning.
See also the cross-agent session history overview, Claude Code session history guide, and Codex session history guide.
Browse your local history in one Web UI
MIT open source and read-only on your machine. Search conversations, tool calls, file changes, and token costs with one command.
Frequently asked questions
Where does Gemini CLI store local chat history?
Gemini CLI stores local chat transcripts as JSON and JSONL files under ~/.gemini/tmp/<project-hash>/chats/. If GEMINI_CLI_HOME is set, both Gemini CLI and CodeSesh read from $GEMINI_CLI_HOME/.gemini/tmp/ instead.
How do I reopen a previous Gemini CLI session?
Run gemini --resume inside the project directory, or pass a specific ID with gemini --resume <session-id>. CodeSesh lets you copy the exact resume command from any indexed Gemini CLI session.
Why are folders under ~/.gemini/tmp/ named with hashes?
Gemini CLI groups chat files by a project hash instead of the repository name. CodeSesh parses each transcript's project metadata so you can browse and search by readable repository names.
How do I search Gemini CLI history across all repositories?
Run npx codesesh --agent gemini-cli --days 0. CodeSesh indexes every transcript under ~/.gemini/tmp/*/chats/ into a local SQLite database so you can search prompts, tool calls, reasoning, and touched file paths.
Related guides
- Start locally
Install CodeSesh and browse AI coding sessions
Read - Start locally
How to find AI coding session history locally
Read