The short answer
- 01
Careful. Every file is one archived Codex session, a rollout-*.jsonl file.
- 02
Nothing prunes it. The public issue reports 28 GB there, and archived rollouts never cleaned up, compressed or pruned.
- 03
You lose the archived chats you delete. They cannot be restored or resumed.
- 04
Hand-deleting leaves traces: a comment on that issue reports orphaned rows in Codex's state databases.
- 05
Never delete config.toml, auth.json or the sessions you still use.
See its real size on your Mac. Hoardless measures this folder and previews the delete.Download free trial
What is ~/.codex/archived_sessions?
It is where Codex keeps the sessions you archived. The public issue openai/codex#41806 describes it as a flat folder of rollout-*.jsonl files, each one a session log, with no dated subfolders. It sits inside ~/.codex, or inside CODEX_HOME if you set it.
What writes it and why does it grow?
Codex moves a session here when you archive it. The issue reports that archived rollouts are never cleaned up, compressed, or pruned
, and that the folder held 28 GB, the largest part of a 42 GB ~/.codex. Why the files are large, per the issue:
- Compaction records re-serialize the full conversation history.
- Inline payloads such as base64 screenshots and large tool outputs.
The issue lists 82 files over 100 MB, about 23 GB together, and a largest file of 1.2 GB. A later comment says Codex 0.153.0 added an experimental, default-off option to compress cold archived rollouts with zstd. The same comment says it adds no retention, cleanup or automatic deletion.
How big does it get?
It depends on how many sessions you archive and how heavy they are. Check yours:
du -sh ~/.codex/archived_sessions
Prints the total. Removes nothing. If you set CODEX_HOME, measure that folder instead.
find ~/.codex/archived_sessions -name 'rollout-*.jsonl' -size +100M
Lists archived sessions over 100 MB. Removes nothing.
Is it safe to delete?
| What | Verdict | What you lose |
|---|---|---|
| Old archived rollout files | Careful | Those archived sessions can no longer be restored or resumed. Codex may keep stale entries for them in its state databases. |
| The 20 newest archived sessions | Careful | The sessions you most likely still want. Hoardless always keeps them. |
state_*.sqlite, thread_history_*.sqlite and other Codex databases | Never | Codex's own bookkeeping for threads and sessions. |
config.toml, auth.json | Never | Your settings and sign-in. |
How do I clean up archived_sessions?
Codex has no documented command to delete archived sessions, and the issue lists deleting old rollout-*.jsonl files by hand as the only workaround. Quit Codex first, then pick the files by size or date from the check above and move them to the Trash in Finder, or delete a chosen set:
find ~/.codex/archived_sessions -name 'rollout-*.jsonl' -size +100M -mtime +30 -delete
Deletes archived sessions that are over 100 MB and older than 30 days, permanently, without the Trash. Drop -delete to list them first. This does not keep your newest 20 the way Hoardless does; check the list first.
What Hoardless does: its Codex detector reads CODEX_HOME, else ~/.codex, and lists archived rollouts older than 30 days as one Confirm row named Archived sessions. The 20 newest archived sessions are always kept, whatever their age. It never reads the archived files, only their names and dates. It never touches config.toml, auth.json, AGENTS.md, history.jsonl, the .sqlite state databases, memories, skills, rules, plugins or worktrees. It also does not edit the databases, so after a removal Codex can still list a stale entry for a deleted session. Everything goes to the Trash with an undo log, so you can put a file back.
What comes back and when?
Only sessions you archive in future arrive here. A deleted archived session does not come back, unless you restore it from the Trash.
Old archived sessions, your newest kept
Hoardless lists Codex archived sessions older than 30 days (Confirm tier), always keeps the 20 newest, never touches config, sign-in or databases, and moves what you pick to the Trash with an undo log.
14-day full trial. macOS 14 or later.
Questions
What goes into archived_sessions?
Sessions you archive in Codex. The public issue describes a flat folder of rollout-*.jsonl files with no subfolders, unlike the dated folders in ~/.codex/sessions.
Why is it so big?
The issue says compaction records re-serialize the full conversation history, and some files hold large inline payloads such as base64 screenshots and big tool outputs. It reports 82 files over 100 MB making up about 23 GB, and a largest file of 1.2 GB.
Does Codex compress or prune it?
The issue says archived rollouts are never cleaned up, compressed or pruned. A comment says version 0.153.0 added an experimental, default-off option to compress cold archived rollouts with zstd, with no retention, cleanup or automatic deletion.
Will deleting files break Codex?
A comment on the issue reports that hand-deleting rollouts left orphaned rows in state_5.sqlite and thread_history_1.sqlite. Delete only old archived files, never the databases, and expect stale entries.
Is this the same as ~/.codex/sessions?
No. sessions holds your regular sessions in dated folders. archived_sessions holds ones you archived. Both hold rollout files.
New guides by email
New guides and Hoardless releases, twice a month at most.
Confirm first. Unsubscribe in one click. Privacy.