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.
No mail app or GitHub login? Send this directly from any inbox.
liuminsheng3@gmail.com - SafeDisk AI Agent Storage Pilot Invoice
Claude, Codex, Cursor, or Gemini says ENOSPC? Email before deleting agent state.
Work email is enough. We reply with the lowest-risk check before deleting VM bundles, session state, logs, temp captures, or app support folders.
No mail app or GitHub login? Send this directly from any inbox.
liuminsheng3@gmail.com - SafeDisk AI Agent Storage Pilot Invoice
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-xi-orcin-50.vercel.app/scan.sh -o safedisk-scan.sh && bash safedisk-scan.sh "$HOME/Desktop"
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.
Want an AI-agent storage policy instead of ad hoc cleanup?
Request the $99 team pilot invoice. One representative Mac is enough to draft 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.
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.
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-xi-orcin-50.vercel.app/scan.sh && bash scan.sh