Local AI · Codex CLI history

Is it safe to delete Codex CLI sessions in ~/.codex/sessions?

Review firstDoesn’t come backTypical size: 10 MB–5 GB
~/.codex/sessions

Items inside this folder.

Updated October 17, 2026By the MoreRoom team, Yando Pte. Ltd.This page as Markdown

The short answer

Usually, after a check. Might hold something you care about. Look inside before removing it.

What is it?

OpenAI’s Codex CLI records each session as a transcript (rollout) file in ~/.codex/sessions, organised in year, month and day folders. Heavy users can accumulate hundreds of MB.

Old session transcripts, grouped by year. Recent sessions are never touched; deleted ones cannot be resumed.

What happens if you delete it?

No. Deleted sessions cannot be resumed and their history is gone. Your code and Codex settings are not affected.

How to remove it properly

Quit Codex, then move old year or month folders to the Trash in Finder (Go › Go to Folder… ~/.codex/sessions).

Quit the app that uses it, then move it to the Trash. Empty the Trash when you’re sure.

  • MoreRoom only suggests items unused for 60 days or more.

Before you delete it

Keep recent sessions you may want to resume with codex resume.

How MoreRoom helps

MoreRoom recognises this item and labels it “Review first”: it shows what’s inside, its size and last use, so you can decide. Nothing is removed without your say, and everything goes to the Trash first, with Undo.

Frequently asked questions

Is it safe to delete Codex CLI sessions in ~/.codex/sessions?

Usually, after a check. Might hold something you care about. Look inside before removing it. No. Deleted sessions cannot be resumed and their history is gone. Your code and Codex settings are not affected.

Will Codex CLI history come back after I delete it?

No. No. Deleted sessions cannot be resumed and their history is gone. Your code and Codex settings are not affected.

How do I remove Codex CLI history properly?

Quit Codex, then move old year or month folders to the Trash in Finder (Go › Go to Folder… ~/.codex/sessions).

Guides that mention it

Related folders