Start by measuring, not deleting
Codex CLI data defaults to ~/.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.
CODEX_HOME can override the CLI home, and a configured log_dir can move logs. The paths below describe categories recognized by DevCleaner 1.14.5, not a universal layout for every Codex release. Keep the configuration, auth, skills/plugins you use and active sessions. See the official Codex configuration guide.
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
These are DevCleaner’s Safe cache candidates. Review plugin/runtime caches carefully and keep required files when offline; the next launch may need a refresh or download. Do not remove the full plugins directory or active worktrees.
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.
FAQ
- Is it safe to delete Codex cache on Mac?
- Codex cache, temporary files and diagnostic logs can be removed safely; they are recreated as needed. Do not delete configuration, credentials, memories or archived session transcripts unless you intentionally want to reset or remove that information.
- Where does Codex store its files on macOS?
- Codex CLI data is commonly stored in ~/.codex. The desktop app can also use ~/Library/Caches/com.openai.codex and ~/Library/Logs/com.openai.codex for regenerable data and diagnostics.
References and scope
Reviewed for DevCleaner 1.14.5 on October 4, 2026. Paths depend on tool version and configuration. Size ranges are illustrative, not measured savings or a recovery guarantee. Check the installed tool’s version/help before running cleanup commands.