SafeDisk AI

AI Coding Agent ENOSPC And Cache Storage On Mac

AI coding tools can create VM bundles, session state, logs, temporary task output, browser profiles, and package caches. Some are safe to rebuild; some can contain active sessions or local work state.

Free AI-agent evidence block

Copy the ENOSPC evidence before deleting agent state.

This first pass checks whether Claude, Codex, Cursor, Gemini, or a temp capture path is truly out of disk, out of inodes, blocked by APFS state, or only failing inside the agent capture layer. Use the $29 review when active sessions or VM bundles may be at risk.

Check firstFilesystem, inode, APFS, and control-write evidence.
PreserveSessions, VM bundles, app support, and local work state.
$29Use review before deleting anything that may hold active work.
task_dir="/private/tmp/claude-501"
df -h "$task_dir" 2>/dev/null
df -i "$task_dir" 2>/dev/null
diskutil apfs list 2>/dev/null | sed -n "1,80p"
du -sh "$task_dir" 2>/dev/null
xattr -l "$task_dir" 2>/dev/null | sed -n "1,40p"
ulimit -a
lsof +D "$task_dir" 2>/dev/null | sed -n "1,40p"
printf "capture-test\n" > "$HOME/agent-output-workaround.txt"
Still risky? Free scope check

If `$HOME` writes succeed while the agent says its capture path has 0 MB free, preserve the session and treat it as capture-layer evidence first.

Claude session recovery

Claude sidebar history vanished after ENOSPC? Back up JSONL before touching app state.

On Windows, a full C drive can break Claude's session index while transcript JSONL files are still intact. Use the recovery checklist before deleting IndexedDB, cache, or app-support folders.

No mail app or GitHub login? Send this directly from any inbox.

liuminsheng3@gmail.com - SafeDisk AI Agent Free Scope Check
Free first check

Claude, Codex, Cursor, or Gemini says ENOSPC? Get the safe first step before deleting agent state.

One email is enough to start. We reply with the lowest-risk check first, then offer the $29 review only if the failing path, storage evidence, or recovery order still needs judgment.

No mail app or GitHub login? Send this directly from any inbox.

liuminsheng3@gmail.com - SafeDisk AI Agent Free Scope Check

No secrets, transcripts, or full logs required. Send a short symptom first; scan output can come later.

Read-only first pass

Find whether Claude, Codex, Cursor, Docker, or Xcode is the real storage pressure.

Run the local scan before deleting VM bundles or app support folders. It records sizes and tool metadata, not file contents.

curl -fsSL https://site-iota-ebon-80.vercel.app/scan.sh -o safedisk-scan.sh && bash safedisk-scan.sh "$HOME/Desktop"
Ask for safe next step Check team policy fit Ask for safe next step Open scan steps Download Agent Watch Check team policy fit Open backup request
Before deleting agent state

Get the safest AI-agent storage check by email.

Email is enough for the first pass. Add the tool name or biggest folder only if you have it handy; we reply with the lowest-risk measurement before deleting VM images, logs, or caches.

Recurring team issue?

Want an AI-agent storage policy instead of ad hoc cleanup?

Ask for a free policy-fit check first. One representative Mac is enough to decide whether a paid team pilot would produce reusable safe/review/do-not-touch rules for Claude, Codex, Cursor, Docker, Xcode, and package caches.

Do Not Start With rm -rf

If an agent reports ENOSPC or a VM is full, first separate real disk pressure from a tool bug or stale session state. Deleting the whole application support folder can reset sessions, plugins, caches, and local tool state.

Read-Only Checks

df -h
du -sh "$HOME/Library/Application Support/Claude" 2>/dev/null
du -sh "$HOME/Library/Application Support/Claude/vm_bundles" 2>/dev/null
find "$HOME/Library/Application Support/Claude/vm_bundles" -maxdepth 3 \( -name rootfs.img -o -name sessiondata.img -o -name "*.img" \) -print0 2>/dev/null | xargs -0 du -sh 2>/dev/null
du -sh "$HOME/.claude" "$HOME/.codex" "$HOME/.gemini" 2>/dev/null
du -sh "$HOME/Library/Application Support/Cursor" 2>/dev/null

Those checks show where the storage is, without inspecting file contents or deleting active sessions.

When Claude Code Reports ENOSPC But Disk Is Not Full

If the failing path is under /private/tmp/claude-501/.../tasks and normal writes to $HOME still work, capture evidence that separates a real full filesystem from a stale temp/capture-layer failure.

task_dir="/private/tmp/claude-501"
df -h "$task_dir" 2>/dev/null
df -i "$task_dir" 2>/dev/null
diskutil apfs list 2>/dev/null | sed -n '1,80p'
du -sh "$task_dir" 2>/dev/null
xattr -l "$task_dir" 2>/dev/null | sed -n '1,40p'
ulimit -a
lsof +D "$task_dir" 2>/dev/null | sed -n '1,40p'
printf 'capture-test\n' > "$HOME/claude-output-workaround.txt"

For work you need to preserve, redirect command output to a file under $HOME and read it back. Avoid deleting Claude app support or VM bundles just because the capture path says 0 MB free.

Copy-ready GitHub reply

Paste this when an agent reports ENOSPC but the Mac still has space.

This keeps the conversation focused on evidence instead of broad deletion of Claude, Codex, Cursor, or temp state.

Claude Code is reporting ENOSPC on its temp capture path, but this may not be real disk exhaustion. Please capture the filesystem, inode, APFS, and control-write state before deleting Claude app support or VM bundles:

task_dir="/private/tmp/claude-501"
df -h "$task_dir" 2>/dev/null
df -i "$task_dir" 2>/dev/null
diskutil apfs list 2>/dev/null | sed -n "1,80p"
du -sh "$task_dir" 2>/dev/null
xattr -l "$task_dir" 2>/dev/null | sed -n "1,40p"
ulimit -a
lsof +D "$task_dir" 2>/dev/null | sed -n "1,40p"
printf "capture-test\n" > "$HOME/claude-output-workaround.txt"

If $HOME writes succeed while Claude says the task capture path has 0 MB free, redirect important command output to a file under $HOME and treat this as capture-layer evidence, not a reason to delete app state.

Claude VM Bundle Growth

For Claude Desktop local-agent or Cowork storage, pay special attention to claudevm.bundle, rootfs.img, and sessiondata.img. A growable VM image can keep its host-side size even after files are deleted inside the guest, so the safe first step is to measure the bundle and confirm no VM process is holding it open.

ps -axo pid=,comm=,args= | egrep 'vfkit|gvisor|Virtualization|Claude' | grep -v egrep | sed -n '1,40p'
lsof "$HOME/Library/Application Support/Claude/vm_bundles/claudevm.bundle/rootfs.img" 2>/dev/null
du -sh "$HOME/Library/Application Support/Claude/vm_bundles/claudevm.bundle" 2>/dev/null

Only consider reclaiming VM image files after the app and VM are fully stopped and you have separated rebuildable VM state from project files, transcripts, credentials, and active sessions.

Claude Desktop Debian Large Launcher Logs

On Linux builds, a large ~/.cache/claude-desktop-debian/launcher.log can make startup look broken even when disk space is available. Measure the log and stuck launcher processes before deleting broader cache folders.

du -sh "$HOME/.cache/claude-desktop-debian" "$HOME/.cache/claude-desktop-debian/launcher.log" 2>/dev/null
ps -axo pid=,comm=,args= | egrep 'claude-desktop|launcher.log|awk' | grep -v egrep | sed -n '1,80p'
tail -200 "$HOME/.cache/claude-desktop-debian/launcher.log" 2>/dev/null > /tmp/claude-launcher-tail.txt

If the log is the only oversized item, rotate or truncate that log after Claude and stuck launcher processes are stopped. Avoid deleting the whole cache or config tree unless you intentionally accept losing local app state.

Risk Buckets

Scan AI agent storage safely

The read-only scan now captures Claude, Codex, Gemini, Cursor, Docker, Xcode, and common developer caches so the first cleanup step is based on actual size.

curl -O https://site-iota-ebon-80.vercel.app/scan.sh && bash scan.sh