CClawMetryDocs

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 idgemini_cli
CategoryTerminal coding agent
VendorGoogle
TierPaid tier (Starter and up)
Upstreamgithub.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/<project-dir>/chats/session-<ts>-<id8>.jsonl — main
  • ~/.gemini/tmp/<project-dir>/chats/<parentSessionId>/<id>.jsonl — subagent
  • ~/.gemini/tmp/<project-dir>/.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#

VariableEffect
GEMINI_CLI_HOMEpoints at the dir that contains .gemini
CLAWMETRY_GEMINI_CLI_HOMEClawMetry-side override

See Environment variables 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.

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.
  • <project-dir> 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 — 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.

Cookie preferences