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
| Data | Why it matters | Risk |
|---|---|---|
~/.codex/config.toml and settings | Your configuration and preferences | DANGER |
| Credentials and sign-in files | Authentication and account access | DANGER |
~/.codex/memories | Stored conversation memories and learned context | WARNING |
~/.codex/archived_sessions | Past conversation transcripts | WARNING |
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.