GeminiSoftwareShipping codeAI score · 73/100AI-assisted edit · no obvious prompt-injection riskX

Dual-Agent Mac Disk Cleanup: Scan, Audit, Reclaim 34.64 GB

Input: macOS disk and installed tool inventory → Process: Primary Agent builds interactive cleanup report; sub-agent audits delete list → Output: Verified safe cleanup script and reclaimed space

Some experienceStepsWorkflowTip
Who
macOS user with multiple dev tools installed (Cursor, Codex CLI, Grok, etc.)
You get
Reclaimed 34.64 GB without breaking any local tool or active process
You need
Gemini

Constraints

Requires macOS administrator access, Antigravity platform access, and Gemini 4 Argon High model access. Involves destructive commands (rm/find). Manual review is mandatory before execution. Author's environment: 494.4 GB APFS container; actual results vary by setup.

What they did

The author used Antigravity to invoke Gemini 4 Argon High as a primary agent to scan their 494.4 GB APFS container and build an interactive HTML cleanup report. After the report identified 25.26 GB of hidden bloat, the author spawned a second Gemini sub-agent to audit the delete list. The sub-agent checked active processes, symlinks, and logs, catching 4 bugs that would have broken the environment or caused command failures: an ARG_MAX-overflowing rm -rf switched to find -delete, protection of an active daemon's ~/.codex/.tmp, preserving a grok CLI symlink target while deleting only older binaries, and moving an active Chrome headless profile to a review tier instead of deleting it. The sub-agent also read ShipIt_stderr.log, found Cursor's updater stuck in an NSError Code 66 crash loop since October 10, and fixed it by clearing ShipItState.plist alongside temp folders.

How it went

Author-reported results: the verified Tier 1 script cleared 25.10 GB in one pass; removing unused apps freed another 9.66 GB, totaling 34.64 GB reclaimed. Used space on /System/Volumes/Data dropped from 142.13 GB to 107.49 GB. Post-cleanup, codex and grok symlinks resolved cleanly with no broken local tools. (author_report)

Worth knowing

1. The four bugs caught by the sub-agent: (a) 24,545 stale .com.openai.codex temp files in /var/folders; rm -rf would produce 1.91 MB of path arguments, exceeding the macOS ARG_MAX limit of 1 MB, so switched to find -delete. (b) A live daemon (PID 74495) was writing to ~/.codex/.tmp; folder removed from cleanup script. (c) ~/.local/bin/grok symlinked into ~/.grok/downloads/grok-1.0.67-macos-aarch64; kept 1.0.67 and deleted only two older binaries, freeing 295.7 MB. (d) ~/Library/Application Support/Google/Chrome-headless held 327.5 MB of active browser profile state, not HTTP cache; moved to review tier to preserve headless automation cookies. 2. Cursor's ToDesktop updater had been stuck in a crash loop since October 10 with NSError Code 66 ("Directory not empty"). Clearing ShipItState.plist alongside temp folders fixed the updater and freed 7.53 GB. 3. No reusable prompt text available: this case uses the Antigravity agent product UI without exposed system/user prompts. 4. Not tested by this site: all metrics are author-reported; actual results depend on macOS version, installed tools, and disk state. 5. Risk warning: involves irreversible deletion commands (rm/find). Full script audit and backup of important data are mandatory before execution.

Steps

  1. Launch primary agent to scan disk

    Start the primary agent on the Antigravity platform, selecting Gemini 4 Argon High. Instruct it to scan the local APFS container (author's: 494.4 GB) and produce an interactive HTML report with checkbox items and a script generator. Wait for the scan to complete; the report should list hidden bloat, caches, old runtime versions, and remnants of uninstalled apps.

  2. Review scan results and draft delete list

    Review the checkbox list in the HTML report. In the author's environment, findings included: ToDesktop updater leftovers 7.53 GB (ten failed staging folders in /var/folders and ~/Library/Caches), old Codex CLI and orphaned runtime install folders 6.28 GB, and uninstalled app residues (Conductor, Arc, t3code) 1.27 GB. Check items to confirm deletion and generate the initial cleanup script.

  3. Launch second sub-agent to audit the delete list

    Start a second Gemini 4 Argon High sub-agent in Antigravity. Pass the initial cleanup script and delete targets. Request audit across: active process ownership, symlink dependencies, and system log state. The sub-agent should return a modified script with a reason for each change. In the author's run, the sub-agent caught 4 issues:

  4. Execute the audited cleanup script

    Manually review the modified script returned by the sub-agent, then execute if confirmed safe. Author's result: the verified Tier 1 script cleared 25.10 GB in one pass; removing unused Microsoft Office apps, OneDrive, and Aside data freed another 9.66 GB of physical APFS blocks. Used space on /System/Volumes/Data dropped from 142.13 GB to 107.49 GB. Post-run verification confirmed codex and grok symlinks resolved cleanly.

Prompt you can copy

Reference prompt · Editorial suggestion。Confirm the destination, input variables and output format before use.

This block is the prompt. Ads are never placed here.

No prompt needed — just follow the steps.

Launch agents and select models through the Antigravity product UI; no prompt text to copy.

Source

用 Antigravity + Gemini 清理 Mac 磁盘:主 Agent 扫描出交互式报告,第二个子 Agent 审查删除清单,拦下 4 个会出事的 bug,回收 34.64 GB · raja_sudireddy · X · 2026-10-25T15:21:47.000Z

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related