AI agent storage
Why AI coding agents take up so much space on your Mac
Most of that space is conversation history, and most of the history is screenshots. Codex and Claude Code store every screenshot inside the conversation file itself, and a long session often stores the same one again and again. On one developer Mac, 1,231 Codex conversations took 22.8 GB, 71% of it images, while images that appeared only once made up 16%.
Where each tool keeps its data
Codex keeps conversations as .jsonl files in ~/.codex/sessions and moves them to ~/.codex/archived_sessions when you archive one. Archiving only moves the file, so it frees no space. Its caches and runtimes sit in the same folder.
Claude Code writes one .jsonl file per session under ~/.claude/projects, in a folder named after the project path. On the Mac we measured, about 30% of those bytes were embedded images. Its debug logs and file snapshots live next to the sessions and can end up larger than the sessions themselves.
Cursor stores chat history in a state database and chat images as ordinary files under workspaceStorage. Claude Desktop keeps your conversations on Anthropic’s servers, so its local gigabytes are mostly the Cowork virtual machine bundle and session metadata.
Doing it by hand
Look before you delete anything. Each of these folders mixes data the tool can rebuild with data it can’t, and running rm -rf on ~/.codex or ~/.claude takes every conversation and your settings with it.
- Quit the agent, including any CLI session still open in a terminal.
- Run du -sh on the tool’s folder and its subfolders to find the part that is actually large.
- Remove conversations you are done with one at a time, through the tool itself when it has a delete command.
- Clear cache folders only while the tool is closed, and leave settings and databases alone.
What Mint adds
Mint reads the conversation files on your Mac and shows Codex, Claude and Cursor by name in the Disk tab. Space it can give back is shown apart from space that is simply in use, and none of your data leaves the Mac.
For Codex, you pick conversations by when you last used them. Optimize keeps all the text and turns each screenshot into a small preview, and the conversation still opens in Codex. Delete removes whole conversations through Codex so its index stays consistent. Both are permanent, and the confirmation tells you so first.
Claude Code sessions are measured and left where they are, so removing old ones is still up to you. An agent’s full caches are offered while that agent is closed, and while it runs Mint offers only cache entries nothing is using. In the Direct and Setapp editions, Claude Desktop’s Cowork bundle appears unticked and can be removed only after you quit Claude, which downloads it again the next time you use Cowork.
Watch the demo (0:17): AI Chats Taking Up Mac Storage? Compress Their Images with Mint
Things to check before you delete
Some Codex conversations are forks, and a fork reads part of its history straight out of another conversation’s file by byte position. If that base file gets shorter, Codex can no longer open the fork. Mint won’t rewrite a conversation another one depends on, and a cleanup script of your own should check for this too.
Codex also writes each completed step twice on purpose, and that repeated text is what it reads back. After any change you make yourself, open the conversation in the agent and check that it still loads.
Frequently asked questions
Is it safe to delete the ~/.codex folder?
Not the whole folder. It holds every conversation along with Codex’s settings and local state. Remove the conversations you don’t need and clear caches while Codex is closed.
Does archiving a Codex conversation free disk space?
No. Archiving moves the .jsonl file from sessions to archived_sessions, and every byte stays on disk until the conversation is optimized or deleted.
Why is one conversation file several gigabytes?
Screenshots are stored in the file, and each time a long session compacts its context it stores the same screenshot again. On one Mac, a 14.8 GB conversation held just 155 MB of unique image content.
What does Optimize do to a conversation?
It swaps each screenshot for a small preview, turns audio and video into placeholders, and leaves the text as it was. The conversation still opens in Codex, but the full-size media can’t be brought back.
See what your agents are keeping
Run a scan and look at the Codex, Claude and Cursor rows in the Disk tab before you optimize or delete anything.