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.
Get it on GitHubSet it up
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:
Terminalcurl -fsSL https://github.com/inlinrhq/inlinr-claude-code/raw/main/dist/index.js -o inlinr.jsConnect this machine, then open the link and approve with GitHub:
Terminalnode inlinr.js activate --editor codexHave Codex run inlinr after each turn, through its notify setting:
Terminalnode 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 · Tracking Claude Code, Codex and Gemini CLI: terminal, desktop, IDE and cloud
Questions about Codex
Does it work with the Codex desktop app?
How are Codex's lines counted?
Why is cached input shown apart from input?
What about a forked session?
Read also
- IntegrationTime and token tracking for Gemini CLITrack Gemini CLI sessions per project: time, the lines its file edits wrote and its token counts, thinking tokens included.Open
- IntegrationTime and token tracking for Claude CodeTrack Claude Code sessions per project: time, lines written, and the four token counts with their cost.Open
- AI usageReading a token bill: four prices, and the cache that is most of itFour 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
Start tracking Codex
Free for solo use. Sign in with GitHub, install, and your first session shows up on the dashboard.
No card to start · no source code leaves your machine