ElfClean

ElfClean / Guides

What Claude Code, Codex and Cursor leave on your Mac

Coding agents save every conversation, keep earlier versions of themselves, make extra working copies of your repositories and cache like any editor. None of it is large on day one. After a few months of vibe coding it can be tens of gigabytes. Here's where each tool keeps what, and what you can safely clear.

Some of these folders are your only copy of something: a conversation you may want to resume, or code an agent wrote in a worktree and never committed. Read the notes before removing anything, and prefer the Trash to rm.

Claude Code

FolderWhat it isSafe to remove?
~/.claude/projectsYour past conversations, one folder per project, used by claude --resume.Only if you won't want to resume or read them again. Your code isn't touched.
~/.claude/file-history, shell-snapshots, todos, debugBackups of files each session changed (for rewinding), shell snapshots, task lists and debug logs.Yes, for old sessions. You can't rewind those sessions afterwards. Claude Code removes them itself after 30 days.
~/.local/share/claude/versionsThe current version and the two before it, so you can roll back.The older ones, yes. Keep the one in use.

How long conversations are kept is set by cleanupPeriodDays in ~/.claude/settings.json.

The Claude desktop app keeps its caches in ~/Library/Application Support/Claude, along with the system files of the Linux virtual machine it uses to run code for you (vm_bundles). Those can be removed with Claude closed; it downloads them again, several gigabytes, the next time a task needs them.

Codex

FolderWhat it isSafe to remove?
~/.codex/sessions, ~/.codex/archived_sessionsYour past Codex conversations.Only if you won't resume them. Codex's settings and memories are elsewhere.
~/.codex/worktreesExtra working copies of your repositories that Codex made to work on a branch.Ones already merged, with nothing uncommitted, yes. See worktrees below.
~/.cache/codex-runtimesRuntimes Codex downloads.Yes. Downloaded again when needed.

Cursor, Devin and VS Code

Cursor and Devin (formerly Windsurf) are built on VS Code and lay their files out the same way, each under its own name in ~/Library/Application Support:

Git worktrees agents leave behind

Agents that work on several tasks at once make a Git worktree for each: a full extra checkout of your repository on its own branch. They're easy to forget, and each one is the size of your project.

cd ~/dev/my-project
git worktree list          # every worktree of this repository
git worktree remove ../my-project-feature   # remove one you've merged
git worktree prune         # forget worktrees whose folders are already gone

Before removing a worktree, check it the way you'd check any copy of your code: git status for uncommitted changes, and whether its branch is merged or pushed. Anything uncommitted in a worktree exists nowhere else. Committed work stays in the main repository.

Aider, Continue and Roo Code

Aider keeps caches in ~/.aider/caches and a repository map in each project's .aider.tags.cache.v4; both rebuild. Continue keeps a code index in ~/.continue/index and a downloaded browser in ~/.continue/.utils. Roo Code saves each task's conversation in the editor's extension storage, under User/globalStorage/rooveterinaryinc.roo-cline/tasks; treat those like any other conversation history.

How ElfClean does it

ElfClean's AI & coding screen shows how much each tool uses and how that has grown since about a week ago. Caches are marked as rebuilding themselves. Conversations are never treated as a cache: you can archive old ones to a zip on your Mac before they're removed, and conversations for projects you've deleted are found separately. Projects used in the last day are skipped.

Every worktree an agent made is listed with its repository; merged ones with nothing uncommitted are ready to prune, and ones with work that isn't committed or pushed are marked At risk. Folders a running agent is using are left alone.

ElfClean's AI & coding screen, showing how much Claude and Codex use, with buttons to clean what rebuilds itself or review selections.

More guides