Wipecraft
English
Buy · $19

Claude Code disk space on Mac: what it keeps and what you can delete

Claude Code keeps most of its data on a Mac in one folder, ~/.claude. Its history is session transcripts in ~/.claude/projects and file snapshots in ~/.claude/file-history. Claude Code deletes both after 30 days by default. The larger items are usually in other places: the sandbox image of Claude Desktop, local models, and the git worktrees that agents leave in your repositories.

This page also covers Codex, Cursor, Claude Desktop, Ollama, LM Studio, the Hugging Face cache and git worktrees. All of this is part of what macOS shows as System Data. If that name is new to you, read what System Data is.

The sizes come from the author's own Mac, a MacBook Pro with an M2 Pro chip and macOS 27.2. Wipecraft scanned it on 2026-11-08. The folder sizes were read by hand on 2026-11-15, with Claude Code 2.1.322, Codex CLI 0.153.4 and Claude Desktop 5.11492.5 installed. The author makes Wipecraft. Every step on this page works without it.

How much disk space do AI coding agents use on a Mac?

On one MacBook Pro scanned on 2026-11-08, git worktrees left by AI coding agents used 22.4 GB, Claude Desktop 12.4 GB, local models 5.7 GB, Claude Code 4.3 GB and Codex 3.1 GB. The history folders of the agents were the small part. Every row was in the bucket Your call.

SourceSize on the scan
Git worktrees22.4 GB
Claude Desktop12.4 GB
Local models5.7 GB
Claude Code4.3 GB
Codex3.1 GB
The Apps and AI screen
The AI agents rows in Wipecraft after the scan

The worktrees they left and the Claude Desktop sandbox were several times larger than the history folders. The desktop app of Cursor is not installed on this Mac, so Cursor has no row. Its command-line folder, ~/.cursor, was 420 MB on 2026-11-15.

On 2026-11-15 the same folders on the same Mac were read by hand. This table shows what was inside them.

FolderSize on 2026-11-15
~/.claude4.0 GB
~/.claude/plugins2.0 GB
~/.claude/projects1.5 GB
~/.claude/file-history3 MB
~/.codex3.7 GB
~/.codex/thread_history_1.sqlite1.6 GB
~/.codex/sessions840 MB
~/Library/Application Support/Claude13.0 GB
vm_bundles inside it10.0 GB
Agent worktrees in five repositories19.1 GB

Half of ~/.claude was installed plugins, not history.

Where do AI coding agents store their data on a Mac?

Claude Code stores its data in ~/.claude, Codex in ~/.codex, Claude Desktop in ~/Library/Application Support/Claude, Ollama in ~/.ollama/models, LM Studio in ~/.lmstudio/models and the Hugging Face cache in ~/.cache/huggingface/hub. Agent worktrees are in .claude/worktrees inside your repositories, in ~/.cursor/worktrees or in ~/.codex/worktrees. Each folder holds history, downloads and caches.

ToolMain folderRemoves old data by itself
Claude Code~/.claudeYes, after cleanupPeriodDays (default 30)
Codex~/.codexNot documented
CursorA local chat database. Cursor gives no pathWorktrees only: the newest 25, up to 50 gigabytes
Claude Desktop~/Library/Application Support/ClaudeNot documented
Ollama~/.ollama/modelsNot documented
LM Studio~/.lmstudio/modelsNot documented
Hugging Face cache~/.cache/huggingface/hubNo. Cached files are never deleted by themselves

Each tool has one or two folders. In each folder, some items are history, some are downloads and some are caches. The sections below give the path, what it holds and what you lose if you delete it. The paths and behaviours were checked against the sources on 2026-11-15. These tools change every month, so check the linked page before you act.

Where does Claude Code store its sessions and history?

Claude Code stores session transcripts and the auto memory of each project in ~/.claude/projects, and file snapshots in ~/.claude/file-history. You can delete ~/.claude/projects, but then you cannot resume or rewind past sessions, and the memory of each project is lost. Claude Code removes old transcripts and file history by itself. The setting for this is below.

Anthropic documents the whole folder at code.claude.com/docs/en/claude-directory.

PathWhat it holdsIf you delete it
~/.claude/projectsSession transcripts and the auto memory of each projectYou cannot resume or rewind past sessions, and the memory of the project is lost
~/.claude/file-historySnapshots of files before each edit, at most 100 checkpointsYou cannot restore checkpoints of past sessions
~/.claude/debug, ~/.claude/shell-snapshotsDebug logs and shell settings captured at startupNothing that you see
~/.claude/history.jsonlThe prompts you typedPrompt recall is lost
~/.claude/pluginsInstalled pluginsPlugins stop working. Leave it

Claude Code removes transcripts, file history and debug logs by itself after the number of days in the setting cleanupPeriodDays. The default is 30. Sessions that you started in Claude Desktop are kept at any age unless you set desktopSessionCleanupPeriodDays. The prompt history is kept until you delete it.

Do not delete ~/.claude.json, ~/.claude/settings.json, ~/.claude/plugins or ~/.claude/.credentials.json. The documentation lists them as files to keep.

To remove the state of one project, use the command that Claude Code gives you. The first line only shows what the second line deletes:

claude purge <project path> --dry-run
claude purge <project path>

Old versions of the command-line tool are in ~/.local/share/claude/versions. The installer keeps the current version and the two newest. On this Mac the folder was 687 MB.

Where does Codex store its sessions?

Codex keeps its data in ~/.codex. Session files are in ~/.codex/sessions, in folders by year, month and day, and the thread history is in the database ~/.codex/thread_history_1.sqlite. On the measured Mac, ~/.codex was 3.7 GB and that database was 1.6 GB. OpenAI does not publish a page that lists these folders.

The layout below comes from the open-source repository at github.com/openai/codex and can change.

PathWhat it holdsIf you delete it
~/.codex/sessionsOne file for each session, in folders by year, month and dayYou cannot resume or list those sessions
~/.codex/archived_sessionsSessions that Codex archivedYou cannot resume or list those sessions
~/.codex/thread_history_1.sqliteThe thread history databaseNot documented by OpenAI
~/.codex/generated_imagesImages that Codex generatedThe images are gone unless you saved them in a project
~/.codex/history.jsonlThe prompts you typedPrompt recall is lost

On this Mac the largest item was the thread history database. The session files were 840 MB and the generated images were 332 MB. Leave config.toml, auth.json and the other databases in the folder alone. Their purpose is not documented.

Why does Cursor use so much disk space?

Cursor uses disk space on a Mac mostly for chat history. Cursor says that old agent chats collect in a local database that can grow to many gigabytes, and that for most users this is larger than the extensions. Cursor gives two commands in the app to make it smaller: Delete Old Chats, and then GC Agent KV Blobs.

The source is cursor.com/help/troubleshooting/install-issues. Cursor does not give the path of that database, so this page does not print one. Do not delete the database by hand. Delete Old Chats alone often leaves the file the same size, and GC Agent KV Blobs makes it smaller. Worktrees that Cursor Agent creates are in ~/.cursor/worktrees.

What is vm_bundles in Claude Desktop?

Claude Desktop keeps its data in ~/Library/Application Support/Claude. The folder vm_bundles inside it holds the sandbox image that Cowork uses and the data disk of its sessions. Anthropic does not document what happens when you delete vm_bundles, so leave it while you use Cowork. On the measured Mac, vm_bundles was 10.0 GB of 13.0 GB.

Anthropic documents the folders inside it for its third-party deployments at claude.com/docs/third-party/claude-desktop/data-storage. On this Mac the standard app had folders with the same names.

FolderWhat it holdsIf you delete it
vm_bundlesThe sandbox image that Cowork uses, and the data disk of its sessionsNot documented. Leave it while you use Cowork
claude-code, claude-code-vmThe Claude Code program and its sandbox data for Code sessionsNot documented
local-agent-mode-sessionsCowork and chat history, uploads and outputsThe history exists only on this Mac, so it cannot be recovered
Cache, Code Cache, GraphiteDawnCacheCaches of the appThe app makes them again

On this Mac the three cache folders together were 1.4 GB. This guide did not delete any of them, so it does not state what the app downloads again.

Where are Ollama, LM Studio and Hugging Face models stored?

Ollama stores models in ~/.ollama/models, LM Studio in ~/.lmstudio/models and Hugging Face in ~/.cache/huggingface/hub. Delete a model with its own tool: ollama rm, the My Models tab in LM Studio, or hf cache rm. A local model is a download. It is the only copy on this Mac, and you get it back only when you download it again.

ToolModels folderHow to move itHow to delete a modelSource
Ollama~/.ollama/modelsThe variable OLLAMA_MODELSIts own commanddocs.ollama.com/faq
LM Studio~/.lmstudio/modelsChange the folder in the My Models tabThe My Models tablmstudio.ai/docs/app/advanced/import-model and lmstudio.ai/docs/app/basics/download-model
Hugging Face~/.cache/huggingface/hubThe variable HF_HOMEIts own command. Cached files are never deleted by themselveshuggingface.co/docs/huggingface_hub/guides/manage-cache
ollama ls
ollama rm <model>
hf cache ls
hf cache rm <repo>

Do not delete single files inside the Ollama or Hugging Face folders. Two models can share one file, so you can break a model that you wanted to keep.

On the measured Mac only LM Studio was installed. Its models folder was 29 MB, and the whole ~/.lmstudio folder was 3.3 GB, because the app keeps its engines there too. Ollama and the Hugging Face cache were not on this Mac.

How do you clean up git worktrees that agents leave behind?

To clean up git worktrees that AI agents leave behind, run git worktree list, then git worktree remove <path> for each one that you do not need, and then git worktree prune. Claude Code puts worktrees in .claude/worktrees inside the repository, Cursor in ~/.cursor/worktrees and Codex in ~/.codex/worktrees.

An agent that works on a task in parallel creates a git worktree: a second checkout of your repository in its own folder. Each one holds a full copy of the files, plus the dependencies and the build output of that task. That is why they are large.

ToolWhere it puts worktreesWhen it removes them
Claude Code.claude/worktrees inside the repositoryWhen an unnamed session or a subagent ends without changes. Worktrees of subagents and background sessions after cleanupPeriodDays, unless they hold changes or unpushed commits
Cursor~/.cursor/worktreesIt keeps the newest 25, up to 50 gigabytes in total
Codex~/.codex/worktreesNot documented

Sources: code.claude.com/docs/en/worktrees, cursor.com/docs/configuration/worktrees and cursor.com/help/troubleshooting/install-issues.

On 2026-11-15 this Mac had 19 agent worktrees in five repositories. Together they were 19.1 GB.

For git worktree cleanup by hand, list them, remove one, and then clean the records of folders that you deleted in Finder:

git worktree list
git worktree remove <path>
git worktree prune

git worktree remove refuses when the worktree has changes (git-scm.com/docs/git-worktree). Do not add --force to a worktree with work that you did not commit. That work is lost.

Wipecraft lists worktrees for each agent. It locks a worktree that has uncommitted or unpushed work, or that has an agent running in it. It removes the others with git worktree remove and never with --force.

Xcode and Docker disk space on Mac: what you can delete

Which AI agent folders are safe to delete?

App caches, debug logs, shell snapshots and old versions of a command-line tool are rebuildable, and they are safe to delete. Session transcripts, file history, Codex databases, Cowork sessions and worktrees with work in them are history. History is the only copy. Local models and the sandbox image of Claude Desktop are downloads.

Before you delete an agent folder, put it in one of three groups.

GroupWhat is in itWipecraft bucket
RebuildableApp caches, debug logs, shell snapshots, old versions of a command-line toolSafe to remove or Comes back
HistorySession transcripts, file history, Codex databases, Cowork sessions, worktrees with work in themYour call
DownloadsLocal models, the sandbox image of Claude DesktopYour call

History does not come back. A download comes back only when you download it again. You can read the full bucket rules.

There is one more reason to shorten how long transcripts are kept. Anthropic's documentation says that transcripts are plain text. They can contain anything that a tool read, such as the content of a file with a password in it.

What should you do first when the disk is full?

When your Mac disk is full, quit the AI coding agents first. A session that is running continues to write, and a full disk can cut its files short. Then measure the agent folders, remove a local model that you do not use, and remove git worktrees that are clean and merged. Do not delete the whole ~/.claude folder.

  1. Quit the agents.
  2. Look at how much space is free.
  3. Measure the agent folders before you delete anything.
  4. Remove a model that you do not use, with the command of its own tool.
  5. Remove worktrees that are clean and merged, with git worktree remove.
  6. In Claude Desktop, type /storage. Remove chats and Cowork tasks that are not active, and the worktrees of Code sessions that you do not need.
  7. For Claude Code history, look at the result of claude purge with --dry-run before you delete the state of a project.

The commands for steps 2 and 3:

df -h /
du -sh ~/.claude ~/.codex ~/.ollama ~/.lmstudio ~/.cache/huggingface 2>/dev/null
du -sh ~/Library/Application\ Support/Claude

The whole ~/.claude folder also holds your settings, your plugins and the auto memory of every project.

Claude Code also keeps scratch files for each session under /private/tmp, in a folder with a name that begins with claude-. On this Mac it was 1.5 GB. macOS can clear this folder when you restart.

What does the Storage window of Claude Desktop remove?

The Storage window of Claude Desktop shows the disk space that Claude uses. It removes Cowork tasks and chats that are not active, and the worktrees of Code sessions that you select. It leaves sessions that you pinned and the data of Codex, Cursor and local models, and the documentation does not list the sandbox image or the Claude Code program as removable. Its deletions cannot be undone.

It opens from Settings, when you type /storage in Chat, Cowork or Code, and from the notice that appears when less than 10 gigabytes are free. Anthropic describes it at claude.com/docs/cowork/changelog and at claude.com/docs/third-party/claude-desktop/data-storage. This guide did not open the window on the measured Mac. The table shows only what the documentation states.

The window removesThe window leaves
Cowork tasks and chats that are not active, with their outputs and attachmentsThe Claude Code program and the sandbox image. The documentation does not list them as removable
Worktrees of the Code sessions that you select. If a worktree has uncommitted changes, the app asks you to confirm, and those changes are lostThe Code sessions and their conversations
Sessions that you pinned
The rest of the Claude folder in your home folder. The live artifacts of a deleted chat go with it
Data of Claude Code sessions that you started in Terminal
Codex, Cursor and local models

How do you stop agent data from growing back?

To stop the data of AI coding agents from growing back, set a limit in each tool. In Claude Code, lower cleanupPeriodDays. In Cursor, lower cursor.worktreeMaxCount and cursor.worktreesGlobalMaxSizeGb. In Codex, set history.max_bytes. For local models, set OLLAMA_MODELS or HF_HOME to keep the models on another disk.

What to do with this

To free disk space from AI coding agents, start with git worktrees and local models. They are the largest items, and the space stays free after you remove them. Leave the caches: they are small here and they come back. For the other parts of System Data, read how to clear System Data safely.

Wipecraft scans your disk for free and shows these sources with the same split between history and rebuildable data. It locks what is in use. Items in Your call go to Quarantine first, where you can undo them for 30 days. Read how undo works. Wipecraft is the author's paid product.

See what Wipecraft finds on your Mac