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.
Find what the AI tool can delete.
Copy the read-only check first. If the output still needs judgment, leave your email and we send the free SafeDisk AI deletion trial step only when the agent cache or session state needs review.
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.
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
- Usually safe after app close: generated logs, temporary task output, old install packages, package-manager caches.
- Review first: VM bundles, session images, local plugin state, browser profiles, and tool-specific home directories.
- Do not touch blindly: active workspaces, mounted project folders, credential/auth material, databases, and live agent sessions.
Gemini And Antigravity Cache
If the storage spike is under Gemini or Antigravity, check the dedicated Gemini Antigravity cache guide. The SafeDisk Lite scan now groups browser cache, GPU cache, and recordings separately so the first cleanup step does not require deleting the whole hidden ~/.gemini folder.
Scan AI agent storage safely
Copy the read-only check first. Request the free SafeDisk AI deletion trial only if the output, app state, or cleanup boundary is still not obvious.
Download SafeDisk Lite from the scanner page, then run the local scan: Download free Mac scan.
Need a delete / confirm / protect answer for AI tool files?
Submit the form first; the command output or one-line agent storage symptom can follow. We check whether free guidance is enough before asking for the free SafeDisk AI deletion trial.