Codex

Codex usage on Linux

Track Codex usage on Linux from an AppImage, .deb, or .rpm. Session paths, container caveats, and how to keep history when you reinstall.

Quick answer

Codex writes session files to `~/.codex/sessions` on Linux, or `$CODEX_HOME/sessions` if set. UsageAtlas ships as an AppImage, .deb, and .rpm, reads that folder, and keeps history locally. If Codex runs in Docker or a devcontainer, the host tracker cannot see those sessions unless you mount the folder.

Install and point it at Codex

  1. Choose the AppImage for any distribution, or the .deb / .rpm for your package manager.
  2. Launch the app and let it detect Codex.
  3. If detection fails, set the sessions path explicitly.
  4. Check that the app can read the directory as your user.
chmod +x UsageAtlas-*.AppImage
./UsageAtlas-*.AppImage
ls -la ~/.codex/sessions | tail

The container caveat

A devcontainer has its own home directory. Codex inside it writes to the container's ~/.codex/sessions, which disappears when the container is rebuilt and is invisible to a host app.

  • Mount the host ~/.codex into the container at the same path.
  • Or set CODEX_HOME to a bind-mounted directory.
  • Back up the folder before rebuilding a container.
  • Do not run two Codex instances writing to the same file.

Keep history across reinstalls

The tracker is separate from the data. Reinstalling the app does not delete sessions, but wiping your home directory does. If you test distributions often, keep ~/.codex/sessions on a separate volume or back it up with the rest of your dotfiles.

Where Codex keeps data on Linux

On Linux the sessions live under your home directory as JSONL files, which makes them easy to inspect with standard tools. That is also the catch: if you work inside a container, the files live in the container and disappear when it is rebuilt.

  1. List the session directory and confirm files are being written.
  2. Bind-mount or copy the directory out of ephemeral containers.
  3. Count sessions and tokens with a short script or a tracker.
  4. Keep permissions readable only by your user.
ls ~/.codex/sessions
find ~/.codex/sessions -name '*.jsonl' | wc -l

UsageAtlas ships for Linux and reads the same files, which avoids maintaining a script. See the macOS guide for the equivalent path.

Questions, answered

Does Codex run on Linux?

Yes. The CLI runs on Linux, and sessions are stored under ~/.codex/sessions like the other platforms.

Which Linux package should I use?

AppImage for any distribution, .deb for Debian and Ubuntu, .rpm for Fedora and openSUSE. All three run the same app.

Why is Codex usage empty in a devcontainer?

The container has a different home directory. Mount the host sessions folder or set CODEX_HOME to a shared location.

Browse by topic