Reduce Codex storage while keeping the conversations you need
First separate conversation history, embedded images, caches and indexes. On one developer Mac, images accounted for 71% of 22.83 GB across 1,231 conversations. For supported conversations you still need, Mint offers Optimize to reduce repeated image storage while retaining the pictures Codex reads. Media removal and deletion are separate choices; archiving alone does not free space.
TL;DR
- Start here. Keep the conversations you need. Review supported Optimize actions before deciding to discard media or entire conversations.
- What we measured. One Mac: 1,231 conversations, 22.83 GB, 71% images. This is a sample, not your expected savings.
- Check the result. Compare actual space and reopen the conversation. Being smaller is useful only if the work you need still works.
A measured result on real conversations
On October 15, a test with public Mint 1.0.99 reduced storage by 35.1% in eight eligible conversation copies; continuation and Undo content checks passed. Separately, in a September 26 Mint-team experiment with a development build, a different, file-level compression method saved 1.29 GB on 3.13 GB of real Codex files: about 41%, or 428.42 MB per conversation on average. All four files were byte-identical and Codex read the same 1,598 turns. Different methods and files, with separate dated evidence.
I still need these conversations. What can I change?
A duplicate-file scan can find nothing even when conversations contain repeated images: different text makes the whole files different. Our separate 1,467-file study counted that repetition. It did not measure how many bytes Mint could reclaim.
| Your goal | Action to review | What remains |
|---|---|---|
| Keep supported conversation images and reduce repeated storage | Optimize | Conversation text and the pictures Codex needs to continue; eligibility depends on format, use and dependencies. |
| Keep the text, give up embedded media | Remove media | Text remains. Selected embedded images, audio and video are permanently removed. |
| Stop keeping a conversation | Delete permanently | The selected conversation is removed. This is not a storage-preserving optimization. |
Read the method, limits and steps for testing your own result
What’s in ~/.codex
Conversations are files that Codex calls rollouts. Active ones are in ~/.codex/sessions and archived ones in ~/.codex/archived_sessions. Each starts as a .jsonl file. In the measured codex-cli 0.155.1 setup, Codex stores a conversation that has been idle for seven days as a .jsonl.zst file under the same name, a compressed copy Codex still opens; newer ones stay .jsonl. This observed setup is not a default guarantee for every client: native compression depends on the installed version and configuration. 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 conversation file yourself, check whether another conversation depends on it.
- If one does, leave that file alone. Shortening it can leave the dependent conversation unreadable.
What Mint adds
Mint Direct 1.1.0 reads both ordinary .jsonl conversations and compressed .jsonl.zst conversations. In Disk · Yours · Codex, review each conversation’s size, last use and picture count; the “Last used” menu narrows the list. Optimizable · Codex shows the supported optimizations and their measured savings. These capabilities describe Direct 1.1.0; Mac App Store and Setapp capabilities depend on their own released versions.
For supported .jsonl conversations, Optimize reduces repeated screenshot storage and can store pictures in less space without changing their pixels. It keeps the pictures Codex reads when you continue the conversation. Eligible image optimization can be undone while the required original data and history remain available.
For eligible .jsonl.zst conversations, Optimize compresses the existing conversation more efficiently. After decompression, every byte of the conversation, including its text and embedded media, is unchanged. This compression-only optimization does not provide Undo; Mint offers it only when it measures supported savings.
Under Yours · Codex, Keep text only (Remove media) keeps the conversation text and permanently removes embedded images, audio and video, leaving placeholders instead of small previews. Removed media cannot be restored. Delete permanently removes the whole selected conversation through Codex.
Mint checks whether the selected action is supported before changing a conversation. Its format, current use and dependencies can affect which actions are available, so read the confirmation in your installed edition. Mint measures the SQLite files and never edits them.
Watch the demo (0:33): Where did my Mac storage go? What AI agents leave behind
Your first result: keep the files, use less space
Start with Optimizable after the first scan. It shows supported ways to store files more efficiently while keeping their names, locations and contents. Your Mac may have little to optimize; the scan tells you before you choose an action.
- Review one offered optimization and the files it will affect. For Codex conversations, choose Optimize only when the installed version offers it; Remove media and Delete have different, permanent effects.
- After completion, compare the reported result with free disk space and reopen the files or conversation you need. A scan estimate and the change in free space can differ.
- Once you understand the result, enable the supported Auto Care routines and folders you want maintained. Mint follows your scope and schedule while it runs. Conversation-specific choices still need the review described in the app.
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.
How much you can recover depends on the action. Optimize only offers supported savings that keep what Codex reads. Keep text only can also take images that appear only once, but those images are gone for good. Go by the figure Mint measures for your selection, not the totals from our sample Mac.
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?
In Direct 1.1.0, Optimize keeps the pictures Codex reads when you continue a supported conversation. For .jsonl image optimization, Undo requires the original data and history to remain available. For .jsonl.zst compression-only optimization, every byte of the decompressed conversation stays unchanged, but there is no Undo. Keep text only is a separate, permanent action: text remains, while embedded images, audio and video are removed without small previews or Undo.
Look at your Codex conversations with their sizes first
Run a scan, open Yours in the Disk tab and pick the Codex chip. You can see each conversation’s size and picture count before you press anything.