---
title: "Time and token tracking for Gemini CLI"
description: "Track Gemini CLI per project: time, the lines its edits wrote and its tokens, thinking included, read on your machine. Never your prompts or code."
url: https://inlinr.com/integrations/gemini-cli
lang: en
---

[Integrations](https://inlinr.com/integrations)

# Time and token tracking for Gemini CLI

Gemini CLI keeps each session in \~/.gemini/tmp/<project>/chats. inlinr reads them and turns them into time, the lines its file tools wrote and token counts per project, next to your editor time, Claude Code and Codex.

[Start free](https://inlinr.com/signin) [Get it on GitHub](https://github.com/inlinrhq/inlinr-claude-code)

acme-api · feat/async-cookies Gemini CLI

Session today · gemini-2.5-pro

- **Time**: 54m
- **Lines**: +178 −22
- **Tokens**: 1.6M
- **Cache read**: 1.2M
- **Uncached input**: 290k
- **Output**: 41k

## Set it up

1. Already use the inlinr plugin for Claude Code? Nothing to install: it reads Gemini CLI sessions on the same machine. Otherwise, with Node 18 or later, download the script:  
Terminal  
```
curl -fsSL https://github.com/inlinrhq/inlinr-claude-code/raw/main/dist/index.js -o inlinr.js
```
2. Connect this machine, then open the link and approve in your browser:  
Terminal  
```
node inlinr.js activate --editor gemini-cli
```
3. Add inlinr's two hooks to Gemini CLI's settings:  
Terminal  
```
node inlinr.js setup gemini-cli
```

## What gets recorded

- Time spent in each session, per project and branch
- Lines added and removed by its file tools, from Gemini CLI's own diff
- Input, cached and output tokens, thinking included, and the model

## Good to know

- What leaves the machine is paths, line and token counts, the model and the session's id: no prompt, no reply, no file contents.
- Sessions from before you activate stay on your machine.
- setup adds an AfterAgent and a SessionEnd hook, named inlinr, to \~/.gemini/settings.json.
- Gemini sessions show tokens without a cost for now: inlinr prices only the models whose rates it has checked, and Google's are not among them yet.

Never file contents, prompts or replies. [The full list of what is sent](https://inlinr.com/security)

[Tracking Claude Code, Codex and Gemini CLI, from terminal to cloud](https://inlinr.com/guides/track-claude-code)

## Questions about Gemini CLI

### Which lines count as written by Gemini?

The ones its file tools report in their own diff: what the model added and removed. If you change a proposed edit before accepting it, your changes are not credited to the model.

### Does Gemini CLI wait for inlinr after each turn?

No. Gemini CLI waits for its hooks, so the hook starts inlinr in the background and returns at once.

### Are thinking tokens counted?

Yes, as output tokens, the way Google bills them.

### Which versions of Gemini CLI are read?

Those that write sessions as JSON Lines, after 0.38\. Sessions from Gemini CLI 0.38 and older, one JSON file each, are not read.

## Read also

- [Integration Time and token tracking for Codex Track OpenAI Codex, CLI or desktop app, per project: time, the lines its patches changed and its tokens, read on your machine. Open](https://inlinr.com/integrations/codex)
- [AI usage Reading a token bill: four prices, and the cache that is most of it Four counts, four prices, and a cache that re-reads the whole conversation every turn. How to read them without being off several times over. 7 min read](https://inlinr.com/guides/ai-token-costs)
- [Product AI coding analytics Which assistant wrote how much of each project, with tokens and cost per week. Open](https://inlinr.com/ai-coding-analytics)

## Start tracking Gemini CLI

Free for solo use. Sign in with GitHub or by email, install, and your first session shows up on the dashboard.

[Start free](https://inlinr.com/signin) 

[Install in VS Code](https://inlinr.com/integrations/vscode)

No card to start · no source code leaves your machine

Not ready to sign in? [Try the demo dashboard](https://inlinr.com/demo)
