AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified BSD-3-Clause Self-run

Brew Cleanup

skill-lexfrei-ccc-brew-cleanup · by lexfrei

Reclaim Homebrew disk by removing old formula/cask versions, pruning the download cache, and uninstalling orphaned dependencies (brew autoremove). Shows a dry-run estimate first, then runs the user-chosen scope after approval. TRIGGER when the user wants to free Homebrew space ("brew cleanup", "почисти brew", "remove orphaned brew packages"). DO NOT trigger for uninstalling a specific named formu…

No reviews yet
0 installs
22 views
0.0% view→install

Install

$ agentstack add skill-lexfrei-ccc-brew-cleanup

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-lexfrei-ccc-brew-cleanup)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Brew Cleanup? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Reclaim Homebrew disk space, then report what was freed.

Operates in report → confirm → execute order. The scope is chosen through an interactive question, not flags. After approval, run the cleanup autonomously.

Step 1: Check Homebrew

command -v brew >/dev/null 2>&1

If brew is not installed, stop and say so. Otherwise note the cache location: brew --cache.

Step 2: Dry-run report

Gather what each scope would do, without changing anything:

brew autoremove -n   # orphaned dependencies that would be uninstalled
brew cleanup -n      # old versions + stale cache; prints "This operation would free approximately N"

Report the orphan list from autoremove -n and the freed-space estimate from cleanup -n. Record baseline sizes of every location these scopes touch — not just the cache. brew cleanup removes old versions from the Cellar/Caskroom, and brew autoremove uninstalls formulae from the Cellar with little or no cache impact, so a cache-only measurement under-reports (and reads as 0 for autoremove). Capture all three:

du -sh "$(brew --cache)" "$(brew --cellar)" "$(brew --prefix)/Caskroom" 2>/dev/null

Step 3: Ask what to run (interactive)

Explain each scope, then ask the user (interactive, multi-select) which to run:

  • Remove old versions + stale cachebrew cleanup: deletes superseded versions of installed formulae/casks and cache older than the default retention. Safe; nothing currently installed is removed.
  • Uninstall orphaned dependenciesbrew autoremove: uninstalls formulae that were pulled in only as dependencies and are no longer required by anything. Review the dry-run list — a formula you use directly but never brew installed explicitly would be removed (re-install with brew install if needed).
  • Scrub the entire download cachebrew cleanup --prune=all: also removes the latest cached downloads, not just stale ones. Frees more; the next brew install/upgrade re-downloads.

Step 4: Execute (after approval)

Run the selected actions. If autoremove is selected, run it first, so the freshly-orphaned versions are then swept by the cleanup pass:

brew autoremove

For the cleanup pass, use the full-scrub variant if the user selected it, otherwise the standard one — selecting both the standard cleanup and the full scrub collapses to a single --prune=all run:

brew cleanup              # standard: old versions + stale cache
brew cleanup --prune=all  # full scrub: also removes the latest cached downloads

Step 5: Report

Re-measure the same locations recorded in Step 2 — cache, Cellar, and Caskroom — and report the space reclaimed from the before/after delta, not the cache alone (old-version removal and autoremove free Cellar/Caskroom space with little or no cache impact). Prefer any explicit freed-space figure brew prints. List the formulae uninstalled by autoremove (if run) and what was kept.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.