SweepBarGet it free

Claude Code taking up disk space on your Mac? What is safe to delete

By Qiffe · October 22, 2026 · 3 min read

AI coding tools write a lot to disk, and none of them tells you. On one Mac used for months with Claude Code, Claude Desktop and Codex, these folders were the big ones. The numbers below are from that Mac and are only an example: yours will differ.

Checked on 2026-10-22 on macOS 27.0.1 with Claude Code 2.1.301. Sizes are measured, not typical.

Measure first

du -sh /private/tmp/claude-$(id -u) 2>/dev/null
du -sh ~/.claude ~/.codex ~/.npm/_npx 2>/dev/null
du -sh ~/Library/Application\ Support/Claude/* 2>/dev/null | sort -rh | head

Where the space went

What Where Size seen Safe to delete?
Session scratch files /private/tmp/claude-<your user id> 7.4 GB Yes, when no session is running
Transcripts and history ~/.claude/projects 5.6 GB Your history. Deleting loses resume and rewind
Claude Desktop VM files ~/Library/Application Support/Claude/vm_bundles 9.4 GB Not by hand, see below
Codex sessions and logs ~/.codex 1.7 GB Your history, same idea
npx downloads ~/.npm/_npx 480 MB Yes, downloaded again
App caches ~/Library/Caches (Claude, Codex, Cursor) under 20 MB Yes, with the app closed

Session scratch files

Claude Code writes temporary files for each session into a folder under /private/tmp named after your user id. This is what we measured on our Mac; it is not documented by Anthropic, so check the folder before you delete anything. Wait until no session is running, and leave recent files alone. SweepBar treats files that nothing has touched for 7 days as old enough to clear.

Transcripts and history: yours, not cache

Anthropic’s documentation says each session’s full transcript lives in ~/.claude/projects/<project>/, and that deleting that folder removes resume, continue and rewind for past sessions, plus auto memory for every project. That is your work history, not a cache.

You do not have to delete it by hand. Claude Code removes old transcripts itself after the number of days in the cleanupPeriodDays setting (30 by default, minimum 1), without showing a message. Lower that number if you want it to keep less. Also never delete ~/.claude.json, ~/.claude/settings.json or ~/.claude/plugins/.

Claude Desktop’s VM files

The biggest single folder on our Mac was vm_bundles in Claude Desktop’s data folder, 9.4 GB. We did not verify what Claude Desktop does if it is deleted or whether it is downloaded again, so do not delete it by hand. If you want the space, reset or uninstall the app from its own settings and check what it says first.

Codex

~/.codex holds session logs, a history database and plugins. Like the Claude folders, most of it is your history rather than a cache. Look inside with du -sh ~/.codex/* and delete only what you recognise as logs or cache, with Codex closed.

npx downloads

npx keeps every package it has ever run, and many MCP servers and AI tools are started that way. The folder ~/.npm/_npx only grows. Close the tools that use it and delete the folder: each package is downloaded again when it runs next. See also the npm cache, which is a separate folder.

What it costs

Where to go next

AI tools are one part of a full Mac. See the developer checklist, Cursor’s cache and why System Data gets so big.

Quick answers

Is it safe to delete ~/.claude?

No, not the whole folder. It holds your transcripts, settings and plugins. Anthropic's documentation says not to delete ~/.claude.json, ~/.claude/settings.json or ~/.claude/plugins/. Deleting ~/.claude/projects removes resume, continue and rewind for past sessions, and auto memory for every project.

How do I make Claude Code keep less history?

Set cleanupPeriodDays in your settings file. It is a whole number of days, 30 by default, and old transcripts are deleted in the background without a message.

Are the npx downloads safe to delete?

Yes. They are packages npx downloaded, many of them MCP servers and AI command line tools. Each one is downloaded again the next time it runs, so the first run after clearing is slower.