Quick answer
In the Codex CLI, type `/status` to see the active model, context usage, and token counts for the current session. For history, read the JSONL files under `~/.codex/sessions` or open UsageAtlas, which parses those files and totals input, cached, output, and reasoning tokens per session.
Check token usage in the Codex CLI
Codex keeps a running tally for the session you are in. The fastest view is the status panel inside the TUI.
- Start
codexin the project you are working on. - Type
/statusand press Enter. The panel shows the model, approval mode, working directory, context window usage, and token counts. - Type
/contextif your build exposes it, to see what is filling the window: system prompt, instructions, conversation, and tool output. - Press Esc to return to the prompt. The numbers refresh as the session grows.
The status panel is per session. It resets when you start a new conversation, which is why the number can look small even after a long day. If you want the total across sessions, you need the session files or a tracker.
codex --version
codex
/statusWhat each token number means
Codex reports four numbers. They are not additive in the way most people assume, so read the labels before you add anything up.
| Field | What it counts | Where it shows up |
|---|---|---|
| Input | Everything sent to the model, including cached context | Status panel, session log, usage views |
| Cached input | The part of the input the provider served from its prompt cache | Session log, token detail views |
| Output | Tokens the model generated, including reasoning tokens | Status panel, session log |
| Reasoning | Internal thinking tokens, billed as output but usually shown separately | Session log, detailed views |
If you want billable input, subtract cached input from total input. If you want the full picture, keep all four. The Codex token counting guide walks through a worked example.
See token usage across every session
Codex writes a JSONL file per session under ~/.codex/sessions, or under $CODEX_HOME/sessions if you set that variable. Each file contains the messages and a token count event you can parse.
- Windows:
%USERPROFILE%\.codex\sessions - macOS and Linux:
~/.codex/sessions - Custom installs:
$CODEX_HOME/sessions
Reading those files by hand gets old after a week. UsageAtlas reads the same folder locally and shows tokens per session, per model, and per day, plus the reset time for the current window. Nothing leaves the machine unless you turn on cloud sync.
Questions, answered
Why does my Codex token count not match my provider bill?
Codex counts the tokens it sends and receives. A provider dashboard may bill cached input at a lower rate, include reasoning tokens differently, or round per request. Compare totals over the same date range and expect small differences.
Does the Codex CLI show token usage for past sessions?
Not in the TUI. Past sessions live in JSONL files under ~/.codex/sessions. Open the file or use a tracker that parses the folder.
Where does Codex store token usage on Windows?
Under %USERPROFILE%\.codex\sessions, unless CODEX_HOME points somewhere else.