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
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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/13018

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #15425

Powered by Codex Action

etraut-openai contributor · 4 months ago

This feature request overlaps with #6015, which already has some upvotes.