Codex storage
What’s in ~/.codex, and what you can safely remove
Most of ~/.codex is screenshots stored inside conversation files. On one developer Mac, 1,231 conversations took 22.83 GB, 71% of it images, while images that appeared only once made up 16%. You get the space back by optimizing conversations you still want to read or deleting the ones you’re done with, and archiving frees none of it.
What’s in ~/.codex
Conversations are .jsonl files that Codex calls rollouts. Active ones are in ~/.codex/sessions and archived ones in ~/.codex/archived_sessions. Archiving a conversation in Codex moves its file from one folder to the other, so no space comes back.
Screenshots are written into the file as data. When a long session compacts its context, it writes the same screenshot again, and on the measured Mac a single 1.76 GB conversation carried 1.57 GB of repeats.
The folder also holds thread_history_1.sqlite (1.74 GB on that Mac) and logs_2.sqlite (1.13 GB), plus worktrees and plugins. The two SQLite files are Codex’s own index and logs. They aren’t conversations, and they aren’t meant to be edited by hand.
Freeing space by hand
Go through Codex wherever you can, because it keeps its own index of conversations and expects files to change only through it.
- Delete conversations you’re done with from inside Codex so its index stays correct.
- Quit Codex before you clear caches or runtimes.
- Before editing a rollout file yourself, search the other rollouts’ session_meta for a history_base that names its thread.
- If one does, leave that file alone, because the fork reads its history from it by byte position.
What Mint adds
Mint reads each conversation on your Mac and fingerprints the images inside, so the Codex rows in the Disk tab show measured sizes for unarchived conversations, repeated screenshots in archived ones and the rest of the archived history. You pick conversations from a list sorted by size, with a slider for how long they’ve gone unused, and hovering a row shows how much media it holds.
Optimize keeps the text exactly as it was and turns each screenshot into a small preview, and the conversation still opens in Codex. Audio and video become placeholders. Delete removes whole conversations through Codex, so its index stays consistent. Nothing is ticked for you, and both actions are permanent, which the confirmation says before anything changes.
Mint won’t rewrite a conversation that another one is forked from. It measures the SQLite files and never edits them.
Watch the demo (0:17): AI Chats Taking Up Mac Storage? Compress Their Images with Mint
Why old conversations can free less than you expect
Repeated screenshots pile up in recent, long sessions that take a lot of them. On the measured Mac, 92% of them sat in conversations used within the last six days, so picking only conversations older than a week misses most of them.
Optimize doesn’t depend on repeats. It shrinks every screenshot that isn’t already small in the conversations you pick, so older conversations still give space back if they hold images.
Frequently asked questions
Does archiving a Codex conversation free space?
No. It moves the file from sessions to archived_sessions. Optimize or delete the conversation to get the space back.
Is it safe to delete ~/.codex or archived_sessions?
Not in bulk. Removing ~/.codex takes every conversation, your settings and Codex’s local state, so delete individual conversations through Codex or Mint instead.
Can I shrink thread_history_1.sqlite?
Not safely by hand. It’s Codex’s index, and Mint measures it without compacting or editing it.
What does an optimized conversation look like in Codex?
It opens as before, with a small preview where each screenshot used to be. The original images can’t be restored.
Look at your Codex conversations with their sizes first
Run a scan and open Codex conversations in the Disk tab. Hover a conversation to see how much media it holds before you press anything.