What's in ~/.codex, and what's safe to delete?
~/.codex is where OpenAI's Codex keeps its settings, your sign-in and a log of every session. The session logs are what grows. Here's what you can clear and what to keep.
The short answer
Old session logs are safe to delete once Codex is closed. You won't be able to resume those sessions afterwards. Keep config.toml and auth.json: they're your settings and your sign-in.
What's inside
| Path | What it is | Delete it? |
|---|---|---|
config.toml | Your Codex settings | Keep |
auth.json | Your sign-in, when Codex stores it in a file | Keep. Deleting it signs you out |
sessions/ | A log of each session, in folders by year, month and day | Old ones are safe to remove. You can't resume them afterwards |
archived_ | Archived session logs | Safe if you won't need them again |
history.jsonl | Session transcripts | Safe. You can cap its size instead (below) |
.sqlite files | Databases Codex uses for logs, history and resumable work | Leave them. Never touch them while Codex is running |
plugins/, cache/ | Installed plugins and cached files | Manage plugins from Codex. The cache is safe to clear |
On our Mac, ~/.codex was 2.7 GB: 977 MB of session logs going back eight months, a 386 MB log database, 403 MB of plugins and 275 MB of archived sessions.
Before you delete anything
Quit Codex completely, including the command-line tool and the app if you use both. Codex writes to its databases while it runs, and deleting files mid-write can corrupt them.
Clear old sessions
- Quit Codex.
- See how much each year takes:
du -sh ~/.codex/sessions/* - Open
~/.codex/sessionsin Finder (Go › Go to Folder…) and move the oldest months to the Trash.
Stop history.jsonl growing
Codex has two settings for its history file. In ~/.codex/config.toml:
[history]max_bytes = 104857600
That caps history.jsonl at 100 MB by dropping the oldest entries. Setting persistence = "none" instead stops Codex saving transcripts to history.jsonl at all. These settings only cover history.jsonl; the session logs in sessions/ stay until you remove them.
Keep it somewhere else
Codex keeps everything in the folder named by the CODEX_HOME environment variable, which is ~/.codex unless you set it. Point it at another drive if your Mac's own disk is tight.
How Macaroom handles it
Macaroom shows ~/.codex under Developer & AI tools as Codex data, marked Manage in app. It can't be selected, so your settings and sign-in are never removed by accident.
Related guides
See it on your own Mac
Macaroom scans your Mac, names what each chunk of storage is, and marks what's safe to clear. Anything you remove goes to the Trash, so you can put it back.
Get Macaroom