Gemini CLI¶
Gemini CLI keeps a prompt-history log alongside active JSONL and legacy JSON
chat files. Normal search reads the prompt log; --exhaustive also projects prompts
from the chat files. The prompt-log adapter has no proof-bound targeted route,
so --deep does not select Gemini conversations.
Base path: ~/.gemini (env override: GEMINI_CLI_HOME).
observed_version: gemini-cli v0.47.0 stable (observed 2026-06-21);
types pinned at HEAD 927170fc.
Stores¶
- Role:
primary_chat- Format:
jsonl- Coverage:
default_search- Adapter:
gemini.tmp_chats_jsonl.v1
- Role:
supplementary_chat- Format:
json_object- Coverage:
catalog_only- Adapter:
-
- Role:
prompt_history- Format:
json_array- Coverage:
default_search- Adapter:
gemini.tmp_logs_json.v1
- Role:
supplementary_chat- Format:
json_object- Coverage:
default_search- Adapter:
gemini.tmp_chats_legacy_json.v1
- Role:
app_state- Format:
md_frontmatter- Coverage:
catalog_only- Adapter:
-
- Role:
app_state- Format:
json_object- Coverage:
catalog_only- Adapter:
-
- Role:
persistent_memory- Format:
text- Coverage:
inspectable- Adapter:
gemini.memory_text.v1
- Role:
app_state- Format:
text- Coverage:
inspectable- Adapter:
gemini.tool_outputs_text.v1
gemini.tmp.chats¶
JSONL with mixed record types. Line 1 is a SessionMetadataRecord (sessionId, projectHash, startTime, lastUpdated, kind). Subsequent lines are MessageRecord turns (id, timestamp, type, content, optional toolCalls/thoughts/tokens/model/displayContent) interleaved with MetadataUpdateRecord updates ({$set: ...}). content is the searched (expanded) form; the occasional displayContent key is the UI-echo variant. Upstream types also declare RewindRecord and PartialMetadataRecord plus type values info/error/warning. The CLI does write info/error system records, but agentgrep surfaces only the user and gemini conversation turns and skips the system records. Adapter store field uses the underscore-flattened form gemini.tmp_chats.
- Agent:
Gemini
- Role:
primary_chat- Format:
jsonl- Coverage:
default_search- Path:
${GEMINI_CLI_HOME or ${HOME}/.gemini}/tmp/<project_hash>/chats/session-<timestamp><id>.jsonl- Adapter:
gemini.tmp_chats_jsonl.v1- Data version:
-- Version strategies:
-- Observed:
gemini-cli v0.47.0 stable (2026-06-21)
- Default search:
yes
Parsed by agentgrep via parse_gemini_chat_file (gemini.tmp_chats_jsonl.v1). When a gemini-typed record’s content is empty, the assistant’s prose is drawn from thoughts[*].subject/description and the tool-call context from toolCalls[*].name/description — concatenated into one SearchRecord per turn.
gemini.tmp.checkpoints¶
Single-file conversation snapshot written by the /chat save command. JSON object { history: Content[]; authType?: AuthType } where each Content is {role: 'user'|'model', parts: [...]}.
- Agent:
Gemini
- Role:
supplementary_chat- Format:
json_object- Coverage:
catalog_only- Path:
${GEMINI_CLI_HOME or ${HOME}/.gemini}/tmp/<project_hash>/chats/checkpoint-<tag>.json- Adapter:
-
- Data version:
-- Version strategies:
-- Observed:
gemini-cli v0.47.0 stable (2026-06-21)
- Default search:
no
User-named snapshots vs. continuous transcript.
gemini.tmp.logs¶
JSON array of LogEntry { sessionId, messageId, timestamp, type, message } — user-prompt audit log. Adapter store field uses the underscore-flattened form gemini.tmp_logs.
- Agent:
Gemini
- Role:
prompt_history- Format:
json_array- Coverage:
default_search- Path:
${GEMINI_CLI_HOME or ${HOME}/.gemini}/tmp/<project_hash>/logs.json- Adapter:
gemini.tmp_logs_json.v1- Data version:
-- Version strategies:
-- Observed:
gemini-cli v0.47.0 stable (2026-06-21)
- Default search:
yes
Parsed by agentgrep via parse_gemini_logs_file (gemini.tmp_logs_json.v1).
gemini.tmp.chats_legacy¶
Pre-Feb 2026 single-file session format. JSON object with top-level sessionId, projectHash, startTime, lastUpdated, and a messages array carrying the same per-turn fields as the current JSONL format. Upstream still reads this shape via the isLegacyRecord discriminator. Adapter store field uses the underscore-flattened form gemini.tmp_chats_legacy.
- Agent:
Gemini
- Role:
supplementary_chat- Format:
json_object- Coverage:
default_search- Path:
${GEMINI_CLI_HOME or ${HOME}/.gemini}/tmp/<project_hash>/chats/session-<timestamp><id>.json- Adapter:
gemini.tmp_chats_legacy_json.v1- Data version:
-- Version strategies:
-- Observed:
gemini-cli v0.47.0 stable (2026-06-21)
- Default search:
yes
Parsed by agentgrep via parse_gemini_chat_legacy_file (gemini.tmp_chats_legacy_json.v1). Covers sessions whose files predate the JSONL migration; upstream still handles them.
gemini.skills¶
Skill definitions; not chat.
- Agent:
Gemini
- Role:
app_state- Format:
md_frontmatter- Coverage:
catalog_only- Path:
${GEMINI_CLI_HOME or ${HOME}/.gemini}/skills/- Adapter:
-
- Data version:
-- Version strategies:
-- Observed:
gemini-cli v0.47.0 stable (2026-06-21)
- Default search:
no
gemini.settings¶
Configuration; not chat.
- Agent:
Gemini
- Role:
app_state- Format:
json_object- Coverage:
catalog_only- Path:
${GEMINI_CLI_HOME or ${HOME}/.gemini}/settings.json- Adapter:
-
- Data version:
-- Version strategies:
-- Observed:
gemini-cli v0.47.0 stable (2026-06-21)
- Default search:
no
gemini.memory¶
Global user-authored context/memory Markdown injected into Gemini CLI sessions — the Gemini analogue of Claude’s CLAUDE.md. Standing instructions, not chat; inspectable opt-in rather than searched by default.
- Agent:
Gemini
- Role:
persistent_memory- Format:
text- Coverage:
inspectable- Path:
${GEMINI_CLI_HOME or ${HOME}/.gemini}/GEMINI.md- Adapter:
gemini.memory_text.v1- Data version:
gemini.memory.markdown.v1- Version strategies:
shape_inference, catalog_observation- Observed:
gemini-cli v0.47.0 stable (2026-06-21)
- Default search:
no
gemini.tool_outputs¶
Per-tool-call output text (run_shell_command / read_file / update_topic results) under tmp/<hash>/tool-outputs/session-<id>/. Tool output rather than user prompts (may echo file or command content), so inspectable opt-in, not searched by default.
- Agent:
Gemini
- Role:
app_state- Format:
text- Coverage:
inspectable- Path:
${GEMINI_CLI_HOME or ${HOME}/.gemini}/tmp/<project_hash>/tool-outputs/session-<id>/<name>.txt- Adapter:
gemini.tool_outputs_text.v1- Data version:
-- Version strategies:
-- Observed:
gemini-cli v0.47.0 stable (2026-06-21)
- Default search:
no
Record schemas¶
Active chat JSONL¶
gemini.tmp.chats is JSONL with mixed record types. Line 1 is a
SessionMetadataRecord (sessionId, projectHash, startTime,
lastUpdated, kind). Subsequent lines are MessageRecord turns (id,
timestamp, type, content) interleaved with MetadataUpdateRecord updates
({$set: {...}}). Some user records also carry displayContent (the UI-echo
variant); content is the expanded form agentgrep searches.
For gemini-typed records whose content is empty, the assistant’s
prose is drawn from thoughts[*].subject/description and the
tool-call context from toolCalls[*].name/description.
Legacy chat JSON¶
gemini.tmp.chats_legacy is the pre-Feb 2026 single-file .json
format. It is a JSON object with session metadata at the top level and the full
conversation under a messages array.
Prompt logs¶
gemini.tmp.logs is a flat JSON array of
LogEntry { sessionId, messageId, timestamp, type, message } — a user-prompt
audit log.
Memory file¶
gemini.memory is ~/.gemini/GEMINI.md — the global user-authored
context/memory file injected into Gemini CLI sessions, the analogue of
Claude’s CLAUDE.md. Standing instructions rather than chat, so it is
inspectable (opt-in) rather than searched by default.
Path hashing¶
Legacy tmp/ project directories are named by the SHA-256 of the
project root; current Gemini CLI also uses timestamp-style and plain
project-basename directory names. Discovery does not depend on the
scheme — agentgrep walks tmp/ recursively — but agentgrep still
exposes gemini_project_hash() to
reproduce the legacy hash directories.
Project context¶
Store |
|
|
|
|---|---|---|---|
assistant turn’s |
metadata line’s |
— |
|
— |
sibling |
— |
|
— |
sibling |
— |
All three prompt stores live under tmp/<project_hash>/, so the
directory name gives every record its origin.cwd_hash. The literal path
is on disk too, in two places: the session metadata line names it in a
plural directories array — where every other agent writes a scalar
cwd — and Gemini drops a .project_root file next to the hashed
directory. agentgrep reads both, so Gemini records carry cwd and
cwd_hash together and answer --cwd, cwd:, repo:, and project:
alongside cwd_hash:. Both sources are
lossless; a missing .project_root is ordinary
on older trees and simply leaves the record without a cwd.
Gemini records no git branch in any of its prompt stores, so branch:
does not reach this backend.