DevCleaner
Menu
Skip to content
Browse guides

Clear Codex cache on Mac: ~/.codex vs /clear

/clear in the Codex chat starts a fresh chat. It leaves ~/.codex on disk. That folder is Codex's home: config, credentials, sessions, logs, and caches.

# In the Codex chat. Starts a new chat. Does not delete files.
/clear

# On disk. This is the folder /clear does not remove.
du -sh ~/.codex
On this page

/clear and ~/.codex are different

In the Codex terminal, /clear clears the screen and starts a fresh chat in the same CLI session. You can name that chat, as in /clear release prep. Ctrl+L only clears the view and keeps the current chat. Codex disables both while a task is running. /archive keeps the transcript and takes the session off the active list. /delete permanently deletes the current session's transcript. None of those commands removes ~/.codex.

CODEX_HOME defaults to ~/.codex. If you set it, that directory has to exist already. Codex stores config.toml, credentials (auth.json or the macOS keychain), session transcripts, skills, logs, and caches there. Live transcripts are under ~/.codex/sessions. Archived transcripts are under ~/.codex/archived_sessions. Logs default to ~/.codex/log. log_dir in config.toml can move them. The Mac app also writes logs under ~/Library/Logs/com.openai.codex. See Codex slash commands and config and state locations.

Quit Codex before you delete files. DevCleaner skips Codex cleanup while the codex process is running. Measure the folders 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

What is safe to clear

These are the regenerable locations DevCleaner treats as cache, temporary files, or logs. Codex rebuilds them. They are not the chat command /clear, and they are not ~/.codex/sessions:

~/.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

On macOS 1.17.0, DevCleaner also lists Crash Reports as a Safe row, on by default. It removes the Crashpad buckets pending, new, completed, and attachments under ~/Library/Application Support/Codex/Crashpad and ~/Library/Application Support/com.openai.codex/web/Crashpad. Conversations, settings, and sign-in stay untouched. ~/.codex/sessions is not one of these folders.

Leave the rest of ~/.codex/plugins in place. Deleting the cache directories does not remove installed plugins, config, or session transcripts.

What to keep unless you mean to remove it

DataWhy it mattersRisk
~/.codex/config.toml and settingsConfiguration and preferencesDANGER
Credentials and sign-in filesAuthentication and account accessDANGER
~/.codex/sessionsLive session transcripts. DevCleaner does not list this folderWARNING
~/.codex/memoriesStored conversation memoriesWARNING
~/.codex/archived_sessionsArchived conversation transcriptsWARNING

Warning rows are not cache. Delete them only when you mean to drop that history. DevCleaner leaves memories and archived sessions unselected until you choose them.

A large ~/.codex folder

A disk map can show that ~/.codex is large. The size mixes cache with config, sessions, and memories. Deleting the whole directory removes all of it. /clear does not.

What DevCleaner removes

DevCleaner lists Codex caches, temporary files, and logs separately from memories and archived sessions. The cache rows are selected by default. Memories and archived sessions stay off until you choose them. It does not offer ~/.codex/sessions, config.toml, or credentials. On macOS 1.17.0, Settings → General → Deletion defaults to By risk: Safe rows, including caches and Crash Reports, are deleted permanently, and Warning rows such as memories and archived sessions move to the Trash. Always move to Trash and Always delete permanently are the other choices.

FAQ

Does /clear delete the Codex cache?
No. /clear in the Codex chat clears the terminal and starts a fresh chat. It does not delete ~/.codex or anything else on disk.
Where does Codex store its files on macOS?
Codex keeps config, sessions, logs, and caches in ~/.codex, unless CODEX_HOME points somewhere else. Logs default to ~/.codex/log, and log_dir can move them. The Mac app also writes logs under ~/Library/Logs/com.openai.codex.
Is it safe to delete the Codex cache on Mac?
Cache, temporary files, and diagnostic logs can be removed. Codex recreates them. Leave config.toml, credentials, ~/.codex/sessions, memories, and archived session transcripts unless you mean to remove that data.

References and scope

Reviewed October 19, 2026 against OpenAI's Codex slash commands, config and state locations, and the log_dir setting, and against the Codex folders DevCleaner scans. CODEX_HOME and log_dir can move files.

Clean caches, not context

DevCleaner measures Codex caches separately from memories and archived sessions. On macOS 1.17.0, Crash Reports are a Safe row and on by default. Settings → General → Deletion defaults to By risk.

Download DevCleaner ↓
Safe cleanup free · ~13 MB · macOS 14+
Developer ID signed · notarized by Apple
Featured on TryMacApps Featured on UsefulShelf Featured on Formac Listed on MacTools Pro Fazier badge