Claude Code and Codex disk usage on a Mac: what's safe to delete

What fills ~/.claude, ~/.codex and the MCP caches on a Mac, which parts clean themselves up, and how to free the rest without losing chats you still need.

Short answer

Claude Code keeps chats in ~/.claude/projects and plugins in ~/.claude/plugins/cache; Codex keeps chats in ~/.codex/sessions and a SQLite history beside it. Claude Code deletes chats older than 30 days (cleanupPeriodDays) and old plugin versions 14 days after an update on its own. Codex has no age limit. MCP servers add their own caches, such as a full Chrome profile in ~/.cache/chrome-devtools-mcp. Check sizes with du, lower cleanupPeriodDays if chats pile up, and use claude purge rather than Finder to remove a project's chats.

How much space do AI coding tools use?

I measured my own Mac on 3 November 2026 (macOS 26.5.1, Claude Code 2.1.317, Codex CLI 0.159.3), after about five weeks of daily use across a dozen projects:

FolderSizeWhat's in it
~/.claude/projects4.4 GB2,427 chat transcripts in 119 project folders
~/.claude/plugins2.7 GB2.4 GB of it is one plugin, in three versions
~/.codex2.3 GBSkills, plugins, a SQLite history, images, sessions
~/.cache/chrome-devtools-mcp1.8 GBThe Chrome profile one MCP server uses
~/.cache/codex-runtimes1.8 GBThe Codex app's runtime, plus three leftover install folders
~/Library/Application Support/Claude705 MBThe Claude desktop app's own copy of Claude Code, and its data

That's about 13 GB, all in hidden folders that Finder doesn't show by default.

Check your Mac

These only read:

Terminal
$ du -sh ~/.claude ~/.codex ~/.cache/* "$HOME/Library/Application Support/Claude" 2>/dev/null | sort -h
$ du -sh ~/.claude/* 2>/dev/null | sort -h | tail -6
$ du -sh ~/.claude/projects/* 2>/dev/null | sort -h | tail -5

The last line shows which projects hold the most chat history. Folder names are your project paths with every / turned into -.

Claude Code chats: ~/.claude/projects

Every session is one .jsonl file named after the session ID. Next to it, a folder of the same name holds the transcripts of its subagents and large tool outputs that didn't fit in the chat. Anthropic's docs say a transcript holds the messages, tool calls and tool results, and also the system prompt and tool definitions sent with each request. That's why a long session with many subagents gets big: my largest single session takes 296 MB, 293 MB of it subagents.

Claude Code already cleans this up. At startup it deletes transcripts and their folders once they're older than cleanupPeriodDays, 30 days by default, along with file-history snapshots, plans, debug logs and the paste cache. My oldest transcript is from 30 September, 34 days before I measured: the sweep keeps it to about a month.

To keep less, set a lower number in ~/.claude/settings.json:

json
{
  "cleanupPeriodDays": 14
}

The minimum is 1. 0 fails validation instead of turning history off. Fewer days also means fewer plain-text copies on disk: transcripts aren't encrypted, so anything a tool printed, an .env file included, sits in them until the sweep removes it.

To remove one project's chats now, use claude purge. It prints the plan and asks before deleting:

Terminal
$ claude purge ~/Projects/my-app --dry-run   # show what would go
$ claude purge ~/Projects/my-app             # delete, after a y/N prompt

It removes the project's transcripts and auto memory, its file-history, task and debug entries, its lines in history.jsonl, and its entry in ~/.claude.json. On versions before 2.1.288 the command is claude project purge.

Check first

Deleting chats costs you /resume, --continue and rewind for those sessions, and the auto memory Claude Code saved for that project. Keep ~/.claude/settings.json, ~/.claude.json, .credentials.json, agent-memory/ and jobs/.

Plugin versions: ~/.claude/plugins/cache

This was the surprise on my Mac. 2.4 GB of the plugin cache was one memory plugin, in three folders of about 800 MB each: 15.8.2, 15.8.3 and 15.9.0. Each version carries its own 785 MB node_modules. Three updates in one day left three full copies.

Claude Code handles this, slowly. When a plugin updates, it writes an .orphaned_at file into the old version's folder and removes that folder 14 days later, so a session that still runs the old version doesn't break. My two old copies were marked on 2 November and would go by themselves around 16 November.

See which versions are waiting:

Terminal
$ find ~/.claude/plugins/cache -maxdepth 4 -name .orphaned_at

Each line is an old version. Once every Claude Code session started before the update has ended, you can move those folders to the Trash early. Leave the version without .orphaned_at alone: that's the one you run. The sweep only runs while at least one plugin is installed, so if you uninstall your last plugin, old folders stay until you install another.

Smaller leftovers sit next to them: on my Mac, 13 temp_git_… folders from plugin installs, about 1 MB each.

Codex: ~/.codex

Codex writes each session to ~/.codex/sessions/YEAR/MONTH/DAY/rollout-….jsonl, one line per event, which is also what codex resume reads. My sessions folder is only 130 MB. The rest of my 2.3 GB:

  • Skills, 692 MB. One skill I'd installed kept 686 MB of its own output inside its folder. Check du -sh ~/.codex/skills/* for the same.
  • thread_history_1.sqlite, 384 MB, and sqlite/, 76 MB: the Codex app's thread database.
  • Plugins, 380 MB.
  • generated_images, 170 MB: 95 images Codex generated.

Codex's configuration reference has no age limit for session files. history.persistence = "none" and history.max_bytes only control history.jsonl, the prompt history. So Codex chats stay until you remove them. To see how much each month holds:

Terminal
$ du -sh ~/.codex/sessions/*/* 2>/dev/null

Moving a month's folder to the Trash is safe for Codex; you just can't resume those chats. Don't delete auth.json or config.toml.

MCP servers and agent runtimes: ~/.cache

~/.cache is where several tools put downloads that never show up anywhere else:

  • chrome-devtools-mcp, 1.8 GB on my Mac. The Chrome DevTools MCP server runs Chrome with its own profile, by default in ~/.cache/chrome-devtools-mcp/chrome-profile. It grows like any Chrome profile, with caches and history. Deleting it is safe, but that browser is then signed out of every site you logged into through it. Starting the server with --isolated uses a temporary profile that's removed when the browser closes, so nothing builds up.
  • codex-runtimes, 1.8 GB. 1.6 GB is the runtime the Codex app runs. The other 249 MB were three codex-runtime-install-… folders, left behind by updates. Keep codex-primary-runtime.

The Claude desktop app

~/Library/Application Support/Claude held 705 MB on my Mac: 433 MB in claude-code (the copy of Claude Code that the desktop app runs) and 240 MB in claude-code-vm. The app's web caches (Cache, Code Cache, GPUCache) come back when needed. Quit the app before you touch anything here.

Editor extensions add more: the Claude Code extension for VS Code and Cursor is 250–320 MB per version, because it bundles its own binary. VS Code and Cursor remove replaced versions on their own; on my Mac, all 17 old versions Cursor had marked were already gone.

Shedi finds old AI chats and plugin versions for youIt lists Claude Code chats untouched for 30 days per project, Codex chats older than 30 days, plugin versions Claude Code marked unused, and the Claude app's caches, with sizes and what you lose, and moves what you pick to the Trash.
Get Shedi

What not to delete

  • ~/.claude/settings.json, ~/.claude.json and ~/.claude/plugins as a whole: your settings, account details and installed plugins.
  • ~/.claude/.credentials.json and ~/.codex/auth.json: your logins.
  • The plugin version folder without .orphaned_at, and codex-primary-runtime.
  • Chats of work you still want to resume. Lower cleanupPeriodDays instead of emptying projects/ by hand.

Sources

Questions

Why is my ~/.claude folder so big?

Mostly two things: chat transcripts in ~/.claude/projects, one JSONL file per session plus a folder of subagent transcripts and large tool outputs, and plugins in ~/.claude/plugins/cache, which keeps the previous version of a plugin for 14 days after every update. A plugin that ships its own node_modules can leave several copies of hundreds of megabytes each.

Does Claude Code delete old chats by itself?

Yes. At startup it deletes transcripts, subagent transcripts, file-history snapshots, plans, debug logs and paste cache older than cleanupPeriodDays, which is 30 days by default. Set a lower number in ~/.claude/settings.json to keep less. The minimum is 1; 0 is rejected.

Is it safe to delete ~/.claude/projects?

It's safe for Claude Code, but you lose /resume, --continue and rewind for those sessions, and the auto memory saved for each project. claude purge <path> removes one project's chats and shows the plan first; claude purge <path> --dry-run only prints it.

Can I delete old plugin versions in ~/.claude/plugins/cache?

Claude Code does it for you: when a plugin updates, it writes an .orphaned_at file into the old version's folder and removes that folder 14 days later. You can delete a folder that has .orphaned_at sooner once no running session uses it. Don't delete the folder of the version you run, or ~/.claude/plugins itself.

Does Codex delete old sessions?

Codex's configuration reference has no age limit for ~/.codex/sessions. history.persistence and history.max_bytes control only history.jsonl. Session files stay until you remove them; deleting one means codex resume can't open that chat.

What is ~/.cache/chrome-devtools-mcp?

The Chrome profile that the Chrome DevTools MCP server uses by default: its cache, cookies and logins. It grows like any Chrome profile. Deleting it signs that browser out of every site. Starting the server with --isolated uses a temporary profile that's removed when the browser closes.