Where coding agents keep their data on a Mac

A folder-by-folder map of Claude Code, Codex, Cursor, OpenCode and Orca: what each folder holds and whether to clean it.

7 min read · Updated October 9, 2026

Coding agents keep their history, checkpoints, caches and worktrees in your home folder, and each one does it differently. This page is a map: for each agent, the folders, what's in them, and what to do with them. "Own command" means the agent has a command for it, and that's the way to clean it. "Never" means deleting it costs you an account, settings or a database.

To see how much each folder takes, du only reads:

du -sh ~/.claude ~/.codex ~/.cursor ~/.local/share/opencode ~/orca 2>/dev/null

Claude Code

Claude Code keeps almost everything in ~/.claude, or in CLAUDE_CONFIG_DIR if you set it. It deletes most session files itself once they're older than cleanupPeriodDays, 30 days by default.

Folder What it holds Clean it?
/private/tmp/claude-<uid> Session scratchpads and pasted images Yes, for sessions that have ended
~/Library/Caches/claude-cli-nodejs MCP and error logs Yes, logs only
~/.claude/projects Session transcripts and each project's auto memory Own command: claude purge
~/.claude/file-history Checkpoint snapshots Claude Code deletes old ones
~/.claude/debug, shell-snapshots, paste-cache, image-cache Debug logs, shell setup, pastes, legacy images Claude Code deletes old ones
~/.claude/plugins Installed plugins and marketplaces Never; use /plugin
~/.claude.json, ~/.claude/settings.json, ~/.claude/.credentials.json Account and global state, settings, login Never
~/.claude/history.jsonl, ~/.claude/agent-memory Prompt history, subagent memory Never

Worktrees go to .claude/worktrees inside each repository. claude purge <path> --dry-run shows what purging a project would delete, including its auto memory. More in How to free up disk space taken by Claude Code and on the Claude Code page.

Codex

Codex keeps its state under CODEX_HOME, which is ~/.codex unless you change it. The CLI, the desktop app and the IDE extension share it.

Folder What it holds Clean it?
~/.codex/.tmp Leftover temporary git repositories After a look; what they're for isn't documented
~/.codex/cache, ~/.codex/log, ~/Library/Logs/com.openai.codex Cache and logs Yes
~/.codex/sessions, ~/.codex/archived_sessions Session logs Own command: codex delete <id>
~/.codex/worktrees Worktrees made by the app Codex keeps the newest 15 and snapshots before deleting
~/.codex/shell_snapshots Shell setup snapshots Leave to Codex
~/.codex/plugins/cache Plugins Never; Codex manages them
~/Library/Application Support/Codex, ~/.codex/sqlite, ~/.codex/*.sqlite App state and databases Never
~/.codex/auth.json, config.toml, history.jsonl Login, settings, prompt history Never

Deleting session files by hand leaves stale rows in Codex's database. codex delete takes a session id or name and deletes it permanently, so check which one first. More on the Codex page.

Cursor

Cursor splits its data between ~/.cursor, or CURSOR_CONFIG_DIR, and ~/Library/Application Support/Cursor.

Folder What it holds Clean it?
~/.cursor/projects Agent transcripts left behind when chats are deleted Look first
~/Library/Application Support/Cursor/CachedData, logs A cache folder per version, and logs Look first; keep the newest versions
~/Library/Application Support/Cursor/User/globalStorage/state.vscdb Chat and agent database, with session keys Never by hand; only from inside Cursor
~/.cursor/chats CLI chats, kept only on this Mac Only from the Cursor CLI
~/.cursor/worktrees Agent worktrees Cursor keeps up to 25 per machine
~/.local/share/cursor-agent/versions CLI versions Leave to the updater
~/.cursor/mcp.json, cli-config.json, hooks.json MCP, CLI and hook settings Never

Never edit state.vscdb while Cursor is open. More on the Cursor page.

OpenCode

OpenCode keeps its data in ~/.local/share/opencode and its cache in ~/.cache/opencode, or under XDG_DATA_HOME and XDG_CACHE_HOME if you set them. Since version 1.2, sessions are in a SQLite database.

Folder What it holds Clean it?
~/.local/share/opencode/snapshot Undo snapshots, kept as shadow git repositories After a look; some outlive their projects
~/.local/share/opencode/storage Session files from before 1.2, copied into the database After a look
~/.local/share/opencode/log, ~/.cache/opencode Logs, and the provider package cache Yes; OpenCode rebuilds the cache
~/.local/share/opencode/opencode.db Session database Own command: opencode session delete <id>
~/.local/share/opencode/worktree OpenCode worktrees From the OpenCode app
~/.local/share/opencode/tool-output Tool output Leave to OpenCode
auth.json, mcp-auth.json Credentials Never

opencode session list shows the session ids. More on the OpenCode page.

Orca

Orca runs agents in git worktrees, so its data is your code.

Folder What it holds Clean it?
~/orca/workspaces/<repo>/<name> Workspaces, each a git worktree One by one, with the checks for any worktree
.orca-worktree-trash in a repository Workspaces Orca already removed After a look
~/orca/workspaces/.orca-preparing Setups that stopped halfway After a look

Treat each workspace like any worktree: check for uncommitted work, ignored files and unpushed commits, then remove it with git. See How to remove git worktrees left by coding agents, safely and the Orca page.

The rule of thumb

  • Logs, caches and scratch space are the safe part. They come back or don't matter.
  • Session history has an owner. Use the agent's own command, or the agent's database ends up out of step with its files.
  • Accounts, settings, credentials and databases stay. Deleting them logs you out, resets your setup or breaks the agent.
  • Worktrees hold code. Check them with git before removing anything.

Doing it with Devbroom

Devbroom knows these folders and treats each one the way its agent does. What the agent cleans itself it leaves to the agent, what has its own command it does or shows with that command, and accounts, settings and databases are never touched. Every item gets a verdict, Ready, Review, Blocked or Unknown, with its reasons. Cursor's data is only read for now, and so is OpenCode's if its database format doesn't match what Devbroom expects.

What you confirm moves to the Trash, and Put back returns it from History. The full list is in Agents. Devbroom is free to download; Pro adds automatic upkeep, Analytics and the session tools.

More guides