CodeSeshv1.5.3
Start locally

Gemini CLI session history: storage, resume & viewer

Find where Gemini CLI stores chat logs under ~/.gemini/tmp/, reopen past sessions with gemini --resume, and search Gemini CLI transcripts across projects with CodeSesh.

By CodeSeshUpdated

npx codesesh --agent gemini-cli --days 0
Explore live preview
localhost:4521docs-site
~/.gemini/tmp/Sample UI
Gemini CLIRead-only index
2.1M tokens$0.98
Audit sitemap hreflang & structured data
22 messages · 5 tool calls · gemini-2.5-pro
readsrc/pages/sitemap.xml.tsOK
gemini --resume 9b2e1d

Gemini 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/*.json and *.jsonl
  • Custom root override: Set GEMINI_CLI_HOME to 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:

Terminal
gemini --resume

If 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:

Terminal
npx codesesh --agent gemini-cli --days 0

Scope to the current repository:

Terminal
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. Remember GEMINI_CLI_HOME points to the parent directory containing .gemini/, not directly to .gemini/tmp/.
  • Pass --days 0. Plain npx codesesh opens with the last 7 local calendar days; pass --days 0 or 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.

Explore live preview

Installation method

npx codesesh@latest

macOS / Linux / Windows · Node.js 22+

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.

Browse all guides