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
- Custom
CODEX_HOME: sessions are under that path, not your home directory. - Sandbox or container: the CLI writes inside the container and the host never sees it.
- Permissions: the tracker cannot read the folder under a different user account.
- New session not flushed: the file appears after the first turn completes.
- Filter or date range: the app is showing a window that excludes the session.
- 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 | tailOn 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
| Symptom | First check | Then |
|---|---|---|
| Panel shows zeros | Start a session and send one prompt | Reopen the panel |
| No sessions on disk | Confirm the data directory | Check the CLI version |
| Tracker shows old data | Refresh or restart the app | Confirm file permissions |
| Totals lower than expected | You are reading one machine | Compare 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.