Add a first-class workflow for reviewing and clearing old CLI sessions
What variant of Codex are you using?
CLI
What feature would you like to see?
Add a first-class workflow for reviewing and clearing old CLI sessions
Codex CLI currently makes it easy to resume previous sessions, but there does not appear to be an equally clear workflow for clearing out sessions that are no longer useful.
Over time, ~/.codex/sessions accumulates many old session transcripts. Some are valuable because they preserve context for active work, but many are one-off experiments, abandoned attempts, or sessions tied to branches and directories that no longer matter. Right now, deciding what is safe to delete seems to require manually inspecting raw JSONL files, grepping for repo paths or branch names, and then deleting files by hand. That feels fragile and easy to get wrong.
The main problem is not disk usage alone. It is that old sessions become operational clutter:
codex resume --allbecomes harder to scan.- It is difficult to distinguish active, useful sessions from stale ones.
- There is no obvious way to tell which sessions are tied to current work versus obsolete branches or temporary directories.
- Users who want to clean up must reason about internal storage layout rather than using the CLI.
- Deleting raw files directly feels unsupported, even if it works in practice.
It would be helpful for Codex CLI to provide an intentional workflow for session cleanup, comparable in polish to the resume workflow. Ideally, a user should be able to review old sessions with enough context to decide whether they are still useful, then remove the ones they no longer care about without manually operating on files under ~/.codex.
The workflow should support the core user question: “Which of these sessions are still relevant to active work, and which can I safely remove?”
Useful context during review would include things like the working directory, last activity date and time, session summary/title if available, session size, git repository and branch the session was running on, etc. The important part is not the exact UI, but that users should not have to open raw transcripts to answer basic cleanup questions.
This would make long-term CLI usage feel much healthier. Session history is valuable when it is curated, but without a cleanup path it gradually turns into noise. A first-class cleanup workflow would also make users more comfortable relying on session persistence, because they would know there is a supported way to manage it later.
Additional information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗