--- title: Gemini CLI description: How ClawMetry observes Gemini CLI — where its data lives, the environment variables that move it, what cost data is real, and the traps in its store. eyebrow: Runtime reference --- # Gemini CLI Gemini CLI records chat unconditionally — there is no setting to opt into — so any real user has sessions on disk. It shares the `~/.gemini` tree with Antigravity, and ClawMetry keeps the two apart by data root. | | | |---|---| | **Runtime id** | `gemini_cli` | | **Category** | Terminal coding agent | | **Vendor** | Google | | **Tier** | Paid tier (Starter and up) | | **Upstream** | [github.com/google-gemini/gemini-cli](https://github.com/google-gemini/gemini-cli) | ## Where the data comes from ClawMetry reads these locations, in order, and never writes to any of them. - `~/.gemini/tmp//chats/session--.jsonl` — main - `~/.gemini/tmp//chats//.jsonl` — subagent - `~/.gemini/tmp//.project_root` — the real cwd for that dir - `~/.gemini/projects.json` — project root to directory map **Format.** Append log with upsert semantics: a metadata first line, `$set` patches, then messages. ## Environment variables | Variable | Effect | |---|---| | `GEMINI_CLI_HOME` | points at the dir that *contains* `.gemini` | | `CLAWMETRY_GEMINI_CLI_HOME` | ClawMetry-side override | See [Environment variables](/docs/config/environment/) for the variables that apply to every runtime. ## Tokens and cost **Tokens.** Real: input, output, cached, thoughts, tool and total per message. **Cost.** Derived from the token split and model. :::note Why this section exists Runtimes differ enormously in what they persist. Rather than showing a plausible number everywhere, ClawMetry reports what the store actually contains and marks the rest unknown. A cost of `$0.00` and a cost of *unknown* mean different things, and the dashboard keeps them different. ::: ## Sub-agents and delegation Sub-agent sessions are JSONL files nested under the parent session id. ## Things worth knowing - `GEMINI_CLI_HOME` points at the *parent* of `.gemini`, while Qwen's `QWEN_HOME` points at the data dir itself. Getting that backwards silently reads nothing. - The upsert trap: a turn is written once when its text lands and again once its tool calls resolve, with the same token block both times. Summing line by line double-counts every tool-using turn, so ClawMetry de-duplicates by message id, last write wins. - `` is the project root's basename, not the sha256. The hash exists but lives *inside* the file as `projectHash`. ## Verify it is being read ```bash # Is this runtime detected, and would this install unlock it? clawmetry runtimes --json | jq '.runtimes[] | select(.id=="gemini_cli")' # Why is it locked, if it is? clawmetry runtimes --why gemini_cli # Any sessions ingested yet? curl -s 'http://localhost:8900/api/local/sessions?limit=5' \ | jq '.rows[] | {session_id, agent_id, events, cost_usd}' ``` If detection succeeds but no sessions appear, work through [Troubleshooting](/docs/ops/troubleshooting/) — the usual causes are a relocated data directory (set the override above), a session limit that is hiding older runs, or a runtime that simply has not written anything yet.