Skip to content

The Codex CLI was using 4.4 GB, and 1.9 GB was an install that never finished

OpenAI's Codex CLI keeps runtimes in ~/.cache and sessions in ~/.codex. Measured at 4.4 GB, including an abandoned 1.9 GB install staging folder.

5 min read

AI coding agents that run in the terminal are not a single binary. The Codex CLI downloads its own runtime, keeps every session transcript, and installs plugins and packages alongside, in two hidden folders in your home directory.

Where it went

FolderSizeWhat it is
~/.cache/codex-runtimes/codex-runtime-install-j4scDL1.88 GBA staging folder from 3 August
~/.cache/codex-runtimes/codex-primary-runtime1.57 GBThe runtime actually in use, written 6 August
~/.codex/packages310 MBDownloaded packages
~/.codex/plugins297 MBInstalled plugins
~/.codex/sessions115 MBYour conversation history
~/.codex/logs_2.sqlite66 MBLogs
~/.codex/computer-use63 MBComputer use support files

The first row is the interesting one. A folder named ...-install- followed by random characters is how installers stage a download before moving it into place. This one is older than the working runtime and larger than it, which is what an install that was interrupted and then retried looks like. Nothing reads it.

Check yours

du -sh ~/.cache/codex-runtimes/* ~/.codex/* 2>/dev/null | sort -h
ls -la ~/.cache/codex-runtimes/

What is safe to remove

WhatSafe?Note
codex-runtime-install-* staging foldersYesLeftovers from an install; the working runtime is separate
logs_2.sqliteYesRecreated
Old months in sessionsYes, if you do not resume themSessions are organised by year, then month
codex-primary-runtimeIt comes backRemoving it forces a fresh download next launch
plugins, packagesOnly if you remove the plugin tooOtherwise they are downloaded again

Other agents keep their files in similar places and make the same kind of mess: Claude Code keeps a folder per version. The editors built around them are in AI coding tools taking up space.

Common questions

Where does the Codex CLI store its files on a Mac?

In two hidden folders: ~/.cache/codex-runtimes for the runtime it downloads, and ~/.codex for sessions, plugins, packages and logs.

What is the codex-runtime-install folder?

A staging folder an install writes to before moving into place. One left behind next to a working codex-primary-runtime is a leftover and can be removed.

Is it safe to delete ~/.codex/sessions?

Yes, if you do not need to resume old conversations. It is your history, not something the CLI needs to run.

How much space does the Codex CLI use?

On the Mac measured, 4.4 GB in total. 1.9 GB of that was an abandoned install folder.

Read next