Codex

Codex usage not showing: 6 causes and fixes

Codex usage missing from the CLI or a tracker? Six causes, from a custom CODEX_HOME to permission errors, and how to confirm each one.

Quick answer

Start with the session folder: if `~/.codex/sessions` has no recent files, Codex is not writing history, usually because `CODEX_HOME` points elsewhere or the app is running in a container. If the files exist, the problem is on the reader side: permissions, a stale scan, or a filter.

Six causes, in diagnostic order

  1. Custom CODEX_HOME: sessions are under that path, not your home directory.
  2. Sandbox or container: the CLI writes inside the container and the host never sees it.
  3. Permissions: the tracker cannot read the folder under a different user account.
  4. New session not flushed: the file appears after the first turn completes.
  5. Filter or date range: the app is showing a window that excludes the session.
  6. Version change: a new Codex release moved or renamed the storage path.

Confirm where Codex writes

echo $CODEX_HOME
ls -la ~/.codex/sessions | tail
ls -la "$CODEX_HOME/sessions" 2>/dev/null | tail

On Windows, check %USERPROFILE%\.codex\sessions and echo %CODEX_HOME%. If the folder is empty after a real session, the issue is upstream of any tracker.

Fix the reader side

  • Point the tracker at the correct folder rather than moving your data.
  • Restart the app after changing CODEX_HOME.
  • Check that the app has read access to the directory.
  • Clear the date filter before concluding that history is gone.

If the app still shows nothing, verify one file by opening it. A malformed or truncated JSONL line can stop a naive parser; the Codex usage history guide explains the event you need.

When Codex usage is missing

SymptomFirst checkThen
Panel shows zerosStart a session and send one promptReopen the panel
No sessions on diskConfirm the data directoryCheck the CLI version
Tracker shows old dataRefresh or restart the appConfirm file permissions
Totals lower than expectedYou are reading one machineCompare with the account view

Most cases are a path problem rather than a missing feature. The Codex usage tracker covers the default locations, and the general checklist in why usage is not showing applies to every provider.

Questions, answered

Why does Codex show usage in the CLI but not in my tracker?

The CLI reads live state in memory; the tracker reads files on disk. A different CODEX_HOME or a permission problem explains most cases.

Does Codex delete old session files?

Not on a schedule. Reinstalling, clearing the home directory, or a cleanup script can remove them.

Can I recover missing Codex usage history?

Only from a backup of the sessions folder. Once the JSONL files are gone, the token record is gone with them.

Browse by topic