Where AI coding agents store data on your Mac, and what is safe to delete
Last checked 12 October 2026
AI coding agents store conversations, caches and old versions in hidden folders: ~/.claude, ~/.codex, ~/.gemini, and Application Support for Cursor, Windsurf and Claude Desktop. Caches and old versions are safe to delete. Conversations are safe only if you won't resume them. Settings, memory and sign-in: never.
Where each agent stores its data
| Agent | Where it writes | What grows | Never delete |
|---|---|---|---|
| Claude Code | ~/.claude, ~/.local/share/claude/versions | Conversations in projects/, old versions, file-history/ | Settings, CLAUDE.md, skills, memory/ folders, .credentials.json, ~/.claude.json |
| Codex | ~/.codex | Conversations in sessions/, old versions in packages/ | config.toml, AGENTS.md, memories, auth.json |
| Claude Desktop | ~/Library/Application Support/Claude, ~/Library/Logs/Claude | The Cowork virtual machine (vm_bundles), embedded Claude Code versions, caches | claude_desktop_config.json, config.json |
| Cursor | ~/Library/Application Support/Cursor, ~/.cursor | Caches, per-workspace state | settings.json, keybindings.json, mcp.json |
| Windsurf | ~/.codeium/windsurf, ~/Library/Application Support/Windsurf, ~/.windsurf | Cascade conversations, caches | memories, global_rules.md, mcp_config.json, your settings |
| Cline | ~/Library/Application Support/<editor>/User/globalStorage/saoudrizwan.claude-dev | Tasks (conversations) and checkpoints | Its settings and state folders |
| Gemini CLI | ~/.gemini | Saved chats in tmp/, checkpoints in history/ | oauth_creds.json, settings.json, GEMINI.md |
| Copilot CLI | ~/.copilot | Sessions in session-state/, logs | config.json, mcp-config.json, agents/ |
| OpenCode | ~/.local/share/opencode, ~/.cache/opencode | Conversation database, snapshots, cache | auth.json, ~/.config/opencode |
Paths were observed on macOS with current versions; the date at the top of this page says when they were last checked.
The four kinds of files, and what deleting them costs
Every agent writes the same four kinds of files. Knowing which kind you are looking at answers "is it safe?" before you open a single folder.
| Kind | Examples | Verdict | What you lose |
|---|---|---|---|
| Caches, logs, temporary files | cache/, logs/, tmp/, shell-snapshots/ | Safe | Nothing visible: the agent recreates them |
| Old versions | ~/.local/share/claude/versions, ~/.codex/packages | Safe, except the version in use | Nothing, as long as you keep the current one |
| Conversations and checkpoints | ~/.claude/projects, ~/.codex/sessions, Cline tasks | Review | Those sessions can no longer be resumed, and checkpoints can no longer rewind your files. Your code is not modified. |
| Settings, memory, sign-in | settings.json, CLAUDE.md, memory/, auth.json | Never delete | Your setup, what the agent learned, your login |
Why it keeps growing
None of these agents empties its own folders aggressively. Every session adds a transcript, every update adds a version, and every edit adds a snapshot. Git worktrees created by agents, node_modules in each worktree, Docker images and Xcode builds usually weigh even more than the agents' own folders, and they follow the same pattern: created by an agent, never removed.
To see where your space goes:
du -sh ~/.claude ~/.codex ~/.gemini ~/.copilot ~/.cursor ~/.codeium \
~/Library/Application\ Support/{Claude,Cursor,Windsurf} 2>/dev/null | sort -hNothing above deletes anything.
Before you delete anything
- Quit the agent. Cleaning a folder an open session is writing to interrupts it.
- Start with caches and old versions: they are safe and often the largest win.
- For conversations, keep what you might resume this week. Export what you want to keep as text before deleting.
- Never delete an agent's whole folder: it holds your settings, memory and sign-in next to the caches.
Doing it with Ouste
Ouste reads all of these folders, classifies every item as Safe, Review, Risky or Protected with the sentence that says what you lose, and puts anything you might regret in a 7-day quarantine you can restore in one click. Settings, memory and sign-in files are never touched.
Guides by agent and topic
Questions
Is it safe to delete the whole ~/.claude or ~/.codex folder?
No. These folders hold your settings, the agent's memory and your sign-in next to the caches. Delete the caches, old versions and conversations you no longer need, never the whole folder.
Will deleting conversations change my code?
No. Conversations are transcripts. Deleting them means the session can no longer be resumed; your project files are not modified.
Why does the space come back after I clean up?
Every new session writes a new transcript and every update downloads a new version. Cleaning up regularly, or lowering the retention settings the agents offer, keeps it in check.