DevCleaner Download .dmg

Where Codex Stores Files on Mac: What Is Safe to Delete

Codex can retain tool caches, diagnostics and conversation-related data. Here is how to reclaim the disposable parts without casually deleting your configuration or past work.

Start by measuring, not deleting

Codex CLI data typically lives under ~/.codex. Check the top-level footprint first:

du -sh ~/.codex 2>/dev/null
du -sh ~/Library/Caches/com.openai.codex 2>/dev/null
du -sh ~/Library/Logs/com.openai.codex 2>/dev/null

Quit Codex before clearing files so an active process is not writing a log or cache while you remove it.

What is safe to clear

These locations contain data that Codex can rebuild or re-download:

~/.codex/cache
~/.codex/vendor_imports
~/.codex/plugins/cache
~/.codex/plugins/.remote-plugin-install-staging
~/.codex/.tmp
~/.codex/tmp
~/.codex/log
~/Library/Caches/com.openai.codex
~/Library/Logs/com.openai.codex

They are suitable for a SAFE cleanup: the next launch or CLI run may take a little longer while Codex rebuilds metadata or caches.

What to keep unless you mean to remove it

DataWhy it mattersRisk
~/.codex/config.toml and settingsYour configuration and preferencesDANGER
Credentials and sign-in filesAuthentication and account accessDANGER
~/.codex/memoriesStored conversation memories and learned contextWARNING
~/.codex/archived_sessionsPast conversation transcriptsWARNING

Warnings are not necessarily dangerous, but they are not disposable cache either. Delete them only if you understand exactly what you are giving up.

Why a generic disk cleaner gets this wrong

A folder visualizer can correctly report that ~/.codex is large, yet it cannot tell you which bytes are cache and which are memories, transcripts or configuration. That distinction is the difference between reclaiming space and unexpectedly losing useful context.

Use a purpose-built scanner

DevCleaner has a dedicated Codex scanner that separates caches, temporary files and logs from memories and archived sessions. Safe categories are selected by default; conversation-related data is visible but opt-in.

Clean caches, not context

DevCleaner understands Codex and 30+ other developer tools, measures their data separately and never pre-selects the risky bits.

Download DevCleaner — free
free · no account · ~10 MB · macOS 14+
Developer ID signed · notarized by Apple