---
title: "Time and token tracking for Codex"
description: "Track OpenAI Codex, CLI or desktop app, per project: time, the lines its patches changed and its tokens, read on your machine. Never your prompts or code."
url: https://inlinr.com/integrations/codex
lang: en
---

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

# Time and token tracking for Codex

Codex writes every session to \~/.codex/sessions, the CLI and the desktop app alike. inlinr reads each file from where it last stopped and turns it into time, the lines Codex's patches changed and token counts per project, next to your editor time and Claude Code.

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

acme-api · feat/async-cookies Codex

Session today · gpt-5-codex

- **Time**: 1h 8m
- **Lines**: +236 −41
- **Cost at API prices**: $3.40
- **Cache read**: 2.1M
- **Uncached input**: 380k
- **Output**: 64k

## Set it up

1. Already use the inlinr plugin for Claude Code? Nothing to install: it reads Codex 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 codex
```
3. Have Codex run inlinr after each turn, through its notify setting:  
Terminal  
```
node inlinr.js setup codex
```

## What gets recorded

- Time spent in each session, per project and branch
- Files and lines changed by the patches Codex applied
- Input, cached input and output tokens, and the model
- Sessions you archived, read from \~/.codex/archived\_sessions

## Good to know

- Never your prompts, the assistant's replies or file contents.
- Tracking starts when you activate; past sessions are not uploaded.
- setup adds notify to \~/.codex/config.toml. Codex takes one notify program: if you have one, setup prints the command to call from it.
- No cost figure yet for OpenAI models: inlinr shows a cost only for prices it has checked.

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 Codex

### Does it work with the Codex desktop app?

Yes. The desktop app writes the same session files as the CLI, so one setup covers both.

### How are Codex's lines counted?

From the patches it applies, once Codex reports a patch went through. A rejected patch that is tried again counts once, not twice.

### Why is cached input shown apart from input?

OpenAI counts cached input inside input. inlinr takes it out, so input means the same for Codex as for Claude Code: what was sent fresh.

### What about a forked session?

A fork starts with a copy of its parent's history. That copy is skipped, so the parent's work is not counted a second time.

## Read also

- [Integration Time and token tracking for Gemini CLI Track Gemini CLI per project: time, the lines its edits wrote and its tokens, thinking included, read on your machine. Open](https://inlinr.com/integrations/gemini-cli)
- [Integration Time and token tracking for Claude Code Track Claude Code per project: time, lines written and the four token counts with their cost, in the terminal, the desktop app, IDEs and cloud sessions.. Open](https://inlinr.com/integrations/claude-code)
- [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)

## Start tracking Codex

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)
