Tool

Claude Code disk space: a free check for AI coding agents on a Mac

The AI agent disk check is a free, read-only Terminal script that shows how much disk Claude Code, Codex, Cursor and other AI coding agents hold on a Mac, and deletes nothing.

updated read 8 minfor macOS 27, macOS 26 Tahoe and macOS 15 Sequoia

The short answer

  1. 01

    What it is: one shell script, ai-agent-disk-check.sh, that measures agent folders, the git worktrees agents leave behind, local models and the developer data around them.

  2. 02

    Run it: curl -fsSL https://hoardless.app/tools/ai-agent-disk-check.sh | bash, or download it, read it and run bash ai-agent-disk-check.sh.

  3. 03

    It only reads. No sudo, no files written, no git commands, no network use.

  4. 04

    Time: under a minute on most Macs. Every folder walk has a time limit.

  5. 05

    Output: each group largest first with a total, a grand total, the three biggest items and the page that explains each one.

AI coding agents write a lot to disk and clean up little of it. Session transcripts, task output, VM images, git worktrees and local models add up to tens of GB, spread across a dozen folders. The AI agent disk check is a free Terminal script that measures all of them in one run: it groups them, sorts them largest first, gives a total for each group, and links the page that explains each big item. It changes nothing on your Mac.

How do I run the AI agent disk check?

Open Terminal (Applications > Utilities) and use either of these two ways. The script works with the Bash 3.2 that ships with macOS and when piped into bash.

Download it, read it, run it

curl -fsSLO https://hoardless.app/tools/ai-agent-disk-check.sh
less ai-agent-disk-check.sh
bash ai-agent-disk-check.sh

The first line saves the script to the current folder. The second opens it so you can read it; press q to leave. The third runs it. This is the way to use any script you did not write.

Run it in one line

curl -fsSL https://hoardless.app/tools/ai-agent-disk-check.sh | bash

This runs the same file without saving it. Only do this if you trust hoardless.app; the download-first way lets you check the file yourself.

It takes under a minute on most Macs. Run it again after a week of agent work to see what grew.

What does it measure?

Four groups, each with its own total. It reads only the folders Hoardless knows for each tool, and skips the ones that are not on your Mac. Items under 1 MB are named in one line instead of a row.

GroupFolders it measuresRead next
1. AI coding agentsClaude Code: ~/.claude (or CLAUDE_CONFIG_DIR) with projects, file-history, debug, vm_bundles, shell-snapshots and todos; task output in /private/tmp/claude-<uid>; MCP logs in ~/Library/Caches/claude-cli-nodejs. The Claude desktop app in ~/Library/Application Support/Claude, with its three largest folders. Codex: ~/.codex (or CODEX_HOME) with sessions, archived sessions and logs. Cursor: ~/Library/Application Support/Cursor with snapshots, workspace state and state.vscdb, and ~/.cursor. VS Code workspace storage. Gemini CLI: ~/.gemini. Kiro: ~/.kiro and its app data. Windsurf: ~/.codeium/windsurfThe ~/.claude folder
2. Git worktrees left by agents~/.claude-worktrees, ~/.codex/worktrees, ~/.cursor/worktrees, ~/conductor/workspaces, and <repo>/.claude/worktrees or <repo>/.worktrees found by a bounded search. Count, size, and how many point to a repo that is goneClean git worktrees
3. Local AI modelsOllama: ~/.ollama/models (or OLLAMA_MODELS). LM Studio models and app cache. Hugging Face: ~/.cache/huggingface (or HF_HOME). Docker Model Runner: ~/.docker/modelsWhere local models live
4. Developer data around agentsDocker.raw (the blocks it holds, not its Finder size), Xcode DerivedData, ~/Library/Developer/CoreSimulator, and the count and size of node_modules folders from the same bounded searchDocker.raw

Each byte is counted in one row only. When worktrees sit inside an agent folder, such as ~/.codex/worktrees, they are taken out of that folder's row and shown in group 2. node_modules folders inside a worktree stay in the worktree's size.

What does the check read, and what does it never do?

Every command in it is a read. The header lists them: du, find, stat, awk, sed, sort, head, sw_vers and date, plus sleep and kill to stop its own walk at a time limit.

QuestionAnswer
Does it use sudo or ask for a password?No
Does it delete, move, rename or write a file?No, not even a temp file
Does it run git?No. It reads the first line of each worktree's .git file and nothing else
Does it open transcripts or print their names?No. It prints folder paths and sizes only
Does it send data anywhere?No. It has no upload or download step
Does it start Docker, Ollama or any agent?No. It only measures their folders
Does it wait forever on a big folder?No. Each folder walk stops after 45 seconds, and the home search after 30. The output says when a limit was hit

What does the output look like?

This is real output from a Mac used every day with Claude Code, Codex and Cursor. Project folder names are replaced with neutral ones; the sizes are as printed.

AI agent disk check 1.0 (hoardless.app)
Read-only: this only measures sizes. Nothing is deleted, moved or written.
Sizes are decimal GB like Finder (1 GB = 1,000,000,000 bytes).

== 1. AI coding agents ==
    15.3 GB  ~/Library/Application Support/Claude                  Claude desktop app
               12.3 GB  vm_bundles                                 VM images for sandboxed tasks
                1.4 GB  Cache
                392 MB  Code Cache
     6.0 GB  ~/.claude                                             Claude Code
                5.6 GB  projects                                   session transcripts
                 15 MB  file-history                               file edit history
                  1 MB  shell-snapshots                            shell snapshots
     3.6 GB  /private/tmp/claude-501                               Claude Code task output
     2.5 GB  ~/.cursor                                             Cursor
                2.5 GB  extensions                                 editor extensions
     1.1 GB  ~/Library/Application Support/Cursor                  Cursor app data
                813 MB  User/workspaceStorage                      workspace state
                174 MB  state.vscdb                                chat and editor state
     746 MB  ~/.codex                                              Codex
                 71 MB  sessions                                   session transcripts
                 12 MB  logs_*.sqlite                              log database
     452 MB  .../Application Support/Code/User/workspaceStorage    VS Code workspace state
      34 MB  ~/Library/Caches/claude-cli-nodejs                    Claude Code MCP logs
       4 MB  ~/.kiro                                               Kiro
  Also found, under 1 MB each: Gemini CLI, Windsurf.
  Total: 29.7 GB

== 2. Git worktrees left by agents ==
    17.2 GB  ~/code/web-store/.claude/worktrees      3 worktrees, Claude Code
    16.1 GB  ~/code/mac-app/.claude/worktrees        6 worktrees, Claude Code
     7.1 GB  ~/code/api-server/.claude/worktrees     3 worktrees, Claude Code
     2.7 GB  ~/code/client/sims/.claude/worktrees    1 worktree, Claude Code
     357 MB  ~/code/billing/.worktrees               1 worktree, agent or manual
     298 MB  ~/code/pos/.worktrees                   2 worktrees, agent or manual
       3 MB  ~/code/docs-site/.claude/worktrees      1 worktree, Claude Code
  Total: 43.7 GB
  17 worktrees in 7 folders.

== 3. Local AI models ==
    10.9 GB  ~/.cache/huggingface              Hugging Face
               10.9 GB  hub                    models, datasets, MLX models
     2.0 GB  ~/.ollama/models                  Ollama
  Also found, under 1 MB each: Docker Model Runner.
  Total: 12.9 GB

== 4. Developer data around agents ==
    31.3 GB  .../com.docker.docker/Data/vms/0/data/Docker.raw      Docker disk image, Finder shows 34.4 GB
    19.7 GB  node_modules folders                                  31 folders
                2.3 GB  ~/code/dashboard/node_modules
                1.7 GB  ~/code/landing/node_modules
                1.4 GB  ~/code/admin/node_modules
    12.2 GB  ~/Library/Developer/CoreSimulator                     iOS simulators
               12.2 GB  Devices                                    simulator devices
  Total: 63.2 GB

== Summary ==
  Grand total: 149.5 GB (each byte counted in one row only)
  Three biggest:
    1.  31.3 GB  ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw (Docker disk image, Finder shows 34.4 GB)
    2.  19.7 GB  node_modules folders (31 folders)
    3.  17.2 GB  ~/code/web-store/.claude/worktrees (3 worktrees, Claude Code)
  What each one is and what is safe to remove:
    https://hoardless.app/paths/docker-raw
    https://hoardless.app/paths/node-modules
    https://hoardless.app/guides/clean-git-worktrees
  Every folder was readable.
  Finished in 43 seconds.

Indented lines are parts of the row above them and are not added again. A * next to a size means part of that folder was unreadable, so the real size is larger. no access means the whole folder was unreadable, and timed out means its walk hit the time limit.

Why does Claude Code use so much disk space?

Because it keeps a record of every session and cleans up only some of it. On the Mac above, Claude Code and the Claude desktop app held 25 GB between them, and the worktrees Claude Code made held another 43 GB.

  • Session transcripts in ~/.claude/projects. Claude Code deletes session data older than cleanupPeriodDays, 30 days by default, so this folder tracks how much you used it in the last month. See the ~/.claude folder.
  • Task output in /private/tmp/claude-<uid>: the output of background commands and subagents. macOS clears it at restart, so it grows on a Mac that stays up for weeks. See Claude Code task output.
  • VM bundles: virtual machine images Claude downloads to run sandboxed tasks. One bundle can be about 10 GB, and Claude downloads it again when it next needs it.
  • Worktrees: each one is a full checkout, and once you run a build in it, it carries its own node_modules and build output. See clean git worktrees.

Codex and Cursor follow the same pattern with their own folders: see the ~/.codex folder and Cursor app data.

How is this different from the System Data check?

The System Data check looks at the whole Data volume; this one looks only at what agents and the tools around them hold. Run the System Data check when Storage settings shows a large gray System Data bar. Run this one when you use Claude Code, Codex or Cursor every day and want to know what they cost in disk.

The script is at version 1.0, dated November 14, 2026. It is the same file this site serves at https://hoardless.app/tools/ai-agent-disk-check.sh.

Want to know which of these is safe to remove?

The check measures folders and cannot tell you what to keep. Hoardless reads the same agent folders, worktrees and models, marks each item by what removing it would break, and previews each removal before anything moves to the Trash. It does not delete anything without your confirmation.

14-day full trial. macOS 14 or later.

Questions

Is the AI agent disk check safe to run?

Yes. It only runs read commands: du, find, stat, awk, sed, sort, head, sw_vers and date. It uses sleep and kill only to stop its own du or find at a time limit. The header lists them, and the script is short enough to read before you run it.

Does it read my Claude Code transcripts?

No. It measures folder sizes with du. It never opens a session file and never prints the names of transcripts, only folder paths and sizes.

Does it run git?

No. To find worktrees it checks for a .git entry in each folder and reads the first line of the .git file with the shell's own read. It never runs git worktree prune, git gc, git fetch or any other git command.

Does it need sudo or Full Disk Access?

No. Run it as your normal user. Folders macOS protects are skipped and counted at the end. To include them, give Terminal Full Disk Access in System Settings > Privacy & Security, run the check again, then remove the access if you like.

Why is my node_modules or worktree total lower than I expected?

Both come from a bounded search: 6 folder levels below your home, outside ~/Library and hidden folders, with a 30 second limit. Projects deeper than that are not counted, and the output says when the search hit its limit. A node_modules folder inside an agent worktree is counted once, in the worktree row.

Why does Docker.raw show less than Finder?

Docker.raw is a sparse file. Finder shows its full size, which is the most it can grow to. The check prints the blocks it really holds on disk, from du, and names the Finder size next to it.

Does it delete anything for me?

No. It only measures and links the page that explains each big item. To remove something you follow that page yourself, or use Hoardless, which previews each removal and moves it to the Trash.

Which agents does it know?

Claude Code, the Claude desktop app, Codex, Cursor, VS Code workspace storage, Gemini CLI, Kiro and Windsurf, plus worktrees from Claude Code, Codex, Cursor and Conductor. It reads only the folders Hoardless already knows for each tool, and skips any that are not on your Mac.