Customizable retention period for sessions

Open 💬 4 comments Opened Oct 31, 2025 by BobbyWang0120

What feature would you like to see?

I would like Codex CLI to periodically clean up old conversation history files based on a user-defined retention window. Currently, Codex retains every conversation indefinitely, so the history folder grows larger over time even though many of those conversations are no longer useful.

The proposed feature would allow users to specify a retention period (for example, 30 or 60 days), and Codex would automatically remove conversations older than that window. This would help keep the history directory at a manageable size and prevent storage from being consumed by outdated or irrelevant sessions. It would also be helpful if the retention duration were configurable so users could choose the period that best fits their needs.

Additional information

_No response_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗