Auto-archive and zstd-compress inactive local rollout files to reduce disk usage
Resolved 💬 2 comments Opened Apr 7, 2026 by JoeyTeng Closed Apr 7, 2026
What variant of Codex are you using?
CLI, App
What feature would you like to see?
Summary
Please add built-in archival and compression for old local rollout/session files (for example under ~/.codex/sessions/) to reduce disk usage.
This is about local storage management, not context compaction.
Problem
Heavy Codex usage can accumulate tens of GBs of historical rollout-*.jsonl files.
Current archive behavior appears to be organizational rather than storage-reducing: it helps move tasks out of the main list, but does not seem to reclaim disk space.
Today, users have to manage old session files manually, which is inconvenient and risky.
Request
Please support:
- archiving inactive sessions after a configurable period
- compressing archived files (ideally with
zstd) - listing archived sessions
- restoring archived sessions on demand
- optional retention/pruning policies
Example UX
codex sessions archive --older-than 30d --compress zstd
codex sessions list --archived
codex sessions restore <session-id>
codex sessions prune --older-than 180d
````
### Additional information
#### Why `zstd`
`zstd` would be a good fit because it has strong compression/decompression performance and supports streaming well, which matches log-like JSONL rollout files and sequential archive/restore workflows.
#### Notes
This request is specifically about **disk-efficient storage of inactive local session artifacts**, not context compaction or memory features.
This also relates to https://github.com/openai/codex/discussions/1442, https://github.com/openai/codex/issues/7727 and https://github.com/openai/codex/issues/13018This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗