Cursor, Claude Code and Codex Caches on a Mac: What Is Safe to Clear
The caches come back. The chats do not. Treat them as two different things, even when they sit in neighbouring folders.
Cache Cursor, Claude Code và Codex trên Mac: cái nào dọn được, cái nào cần xem lại
After a few months of daily use, Cursor, Claude Code or Codex can leave several gigabytes on a Mac. Some of that is the ordinary cache of an Electron app: images, HTTP responses, GPU shaders, logs, updater downloads. Some of it is the work itself: chats you may want to resume, transcripts of an agent run, a worktree that still has a patch in it.
The two are easy to mix up, because they often sit under the same parent folder. A cache comes back the next time the tool launches. A chat does not. The reliable habit is to quit the tool first, clear the caches without worry, and look twice at anything that looks like a conversation or a project.
1. Two kinds of leftover, sitting side by side
Difficulty1 of 5
Before opening any of the folders below, it helps to have the distinction in mind. A cache is something the tool created to go faster or to keep a log: it has no unique sentences in it. A session is a record of work you did with the tool: a chat, a transcript, a worktree.
If you only remember one thing from this guide, remember that split. The rest is just names of folders.
A rough, read-only look at how large the usual roots are:
du -sh ~/Library/Application\ Support/Cursor ~/Library/Caches/claude-cli-nodejs ~/.claude ~/.codex ~/.cursor 2>/dev/nullMissing paths mean that tool is not installed, or has not been used on this Mac. Skip those sections.
Separate “comes back on its own” from “this was a conversation.” The names of the folders follow from that.
2. Cursor: caches you can clear, chats you should keep
Difficulty2 of 5
Cursor keeps most of its data in ~/Library/Application Support/Cursor. The rebuildable parts are familiar if you have ever cleared a Chromium cache:
CachedData,CacheandGPUCache— the usual browser-engine caches. Cursor rebuilds them. Chats stay.logs— log files, written again on the next launch.- The ShipIt updater cache, under
~/Library/Caches, holds downloaded update files. Cursor fetches them again if it needs them.
Quit Cursor (Command-Q, not just closing the window) before you move any of those folders to the Trash.
The other side of the same tree is not a cache. User/globalStorage holds app-wide state, including the AI chat database. User/workspaceStorage holds chat history and workspace state for each project. Agent transcripts also live under ~/.cursor/projects. Clear one of those and you cannot resume the chat. If a project is gone and you are sure you do not need the conversation, that session can go — but it is a decision, not a cleanup reflex.
Cursor’s Chromium caches and logs are safe once the app is quit. The chat folders are not caches.
3. Claude Code: a small cache, and a folder of transcripts
Difficulty2 of 5
Claude Code’s rebuildable cache is ~/Library/Caches/claude-cli-nodejs. It holds debug logs and a small Node CLI cache. After you quit the tool, that folder can go to the Trash; Claude Code creates it again.
The folder people usually mean when they say “Claude is using a lot of space” is often ~/.claude/projects. That is where conversation transcripts for each project are stored, typically as .jsonl files. They are a record of the work, not a cache. If you remove them, the conversation is gone.
Next to the projects folder, Claude Code also keeps memory, settings and credentials. Those are small, and they are not leftovers. Leave them where they are. The Claude desktop app, if you use it, has its own Chromium cache under ~/Library/Application Support/Claude; that cache rebuilds, and the chats stay.
Clear the CLI cache after quitting. Treat ~/.claude/projects as chats, and leave memory and settings alone.
4. Codex: old sessions, worktrees, and files to leave alone
Difficulty3 of 5
Codex lives in ~/.codex. Session rollouts sit in sessions. Over a few months they add up. Rollouts older than a couple of weeks are usually the ones worth reviewing; newer sessions are the work you may still want to reopen. This is a look-twice folder, not a cache you empty in one gesture.
~/.codex/worktrees is stricter. A worktree can hold finished work from a project, including work whose original git repository is no longer on the Mac. If the repo is gone, look inside before you throw the worktree away.
Two files, and a short markdown file, should not be part of any cleanup: config.toml, auth.json and AGENTS.md. They are configuration and sign-in, not leftovers.
Downloaded runtimes under ~/.cache/codex-runtimes are the one straightforward cache in this set. Codex fetches them again on the next use.
Review old sessions and worktrees one by one. Leave config and auth alone. Runtimes can be fetched again.
Conclusions
The three tools are built differently, but the folders they leave behind sort the same way:
- Is its cause still alive? If you still use the tool, its caches are doing their job and will grow back. If a project is gone, its session is a record, not a cache.
- If I remove it, does it come back? Caches, logs and runtimes: yes, on the next launch or the next use. Chats, transcripts and worktrees: no.
Clear the caches after quitting the tool. Look twice at anything that was a conversation or a piece of work.
If you would rather have those folders listed for you, with a plain note on whether each one rebuilds, Haikos Clean does that for Cursor, Claude Code and Codex, never ticks a chat for you, and moves only what you pick to the Trash first. Local models are a separate, much larger question, covered in Where Ollama, LM Studio and Hugging Face models live on a Mac. For the wider picture, see Your Mac Looks Clean. Until You Ask One Question.
Questions people ask
Is it safe to clear the Cursor cache on a Mac?
The Chromium caches — CachedData, Cache, GPUCache — and the logs and updater downloads are safe to clear once Cursor is quit. Cursor rebuilds them on the next launch, and your chats stay. What is not a cache is User/globalStorage, workspaceStorage, and the agent transcripts under ~/.cursor/projects. Those hold chat history and workspace state. Clearing them does not come back, so look twice and only remove a project’s session if you are sure you do not need it.
Why is Claude Code using so much disk space?
Two different folders are usually involved. ~/Library/Caches/claude-cli-nodejs holds debug logs and a small CLI cache that Claude Code rebuilds, and it is safe to clear after you quit the tool. The much more personal folder is ~/.claude/projects, which stores conversation transcripts for each project as .jsonl files. Those are chats, not caches. Claude’s memory folder, settings and credentials sit nearby and should be left alone.
Where does Codex store sessions on a Mac?
Codex keeps session rollouts in ~/.codex/sessions and project worktrees in ~/.codex/worktrees. Older rollouts can add up, while a worktree may still hold finished work from a repo you have since deleted. Leave ~/.codex/config.toml, auth.json and AGENTS.md where they are: those are configuration and sign-in files, not leftovers. Downloaded runtimes under ~/.cache/codex-runtimes are a cache and can be fetched again.
Sources
Paths and commands were checked against these pages on the date above.