Awesome Go

mac-cleanup-go

CategorySoftware Packages
SubcategoryOther Software
Stars469

Preview-first TUI for cleaning macOS caches, logs, and temporary files

About mac-cleanup-go

Overview

  • Select items that take up space and delete them yourself.
  • By default, items go to Trash; only the Trash and Shell History Residue categories delete permanently.
  • Risky categories are unselected by default; even when selected, items are auto-excluded. (Include them in Preview to delete.)
  • Manual categories show guides only.
  • Scope: caches/logs/temp and selected app data (no system optimization or uninstaller).

demo

Quick Start

1) Install

brew install mac-cleanup-go

Or download the archive from GitHub Releases.

2) Optional: Full Disk Access (needed for Trash/restricted locations) System Settings -> Privacy & Security -> Full Disk Access -> add Terminal

3) Run

mac-cleanup

Tip: Use Enter to preview, then y to proceed with deletion. Press ? to see key bindings.

demo

  • Update: brew upgrade mac-cleanup-go or mac-cleanup update.
  • Uninstall: brew uninstall mac-cleanup-go.
  • Debug: mac-cleanup --debug saves log to ~/.config/mac-cleanup-go/debug.log.

List view:

  • Up/Down or k/j: move
  • Space: select category
  • a: select all, d: deselect all
  • Enter or p: preview selection
  • ?: help, q: quit

Preview view:

  • Up/Down or k/j: move
  • h/l: previous/next category
  • Space: toggle exclude
  • Enter: drill into directory
  • /: search, s: sort, o: open in Finder
  • a: include all, d: exclude all
  • y: delete (confirm), esc: back

Confirm view:

  • y or Enter: confirm
  • n or esc: cancel

CLI mode

Scan and clean without the TUI. targets, scan, and clean take target IDs; --json gives machine-readable output.

mac-cleanup scan                            # Sizes per target (read-only)
mac-cleanup scan system-cache --items       # Largest items in one target
mac-cleanup clean npm go-build --dry-run    # Preview exactly what will be cleaned
mac-cleanup clean npm go-build              # Clean (asks to confirm; --yes skips)
  • mac-cleanup targets lists every target ID without scanning.
  • mac-cleanup select saves targets for mac-cleanup clean --selected.
  • Risky targets are only cleaned item by item with --item <path>.
  • homebrew moves only the scanned download cache to Trash. Installed formula versions are kept, and --item accepts the scanned cache root.
  • Exit codes: 0 ok, 1 error, 2 usage error or confirmation needed, 3 some items failed.
  • Run mac-cleanup help <command> for all flags.

1) Select targets

$ mac-cleanup select

Select cleanup targets                  ● safe  ○ moderate
─────────────────────────────────────────────────────────
        Name                                      Size
  [ ] ● Trash                                      0 B
  [✓] ○ App Caches                              3.2 GB
  [✓] ○ System Logs                           259.7 MB
▸ [✓] ● Go Build Cache                        845.0 MB
  [✓] ○ Docker                                  2.8 GB
  [✓] ● Homebrew Cache                          1.5 GB
  [ ] ● Chrome Cache                               0 B
─────────────────────────────────────────────────────────
Selected: 5
↑/↓ Move  space Select  s Save  ? Help  q Cancel

2) Preview / Clean

$ mac-cleanup clean --selected --dry-run

Dry Run Report
--------------
Mode: Dry Run

Summary                             Highlights
Freed (dry-run): 8.6 GB             1. App Caches - 3.2 GB (523 items)
                                    2. Docker - 2.8 GB (12 items)
                                    3. Homebrew Cache - 1.5 GB (1 items)

Details
STATUS  CATEGORY              ITEMS        SIZE
OK      App Caches              523      3.2 GB
OK      Docker                   12      2.8 GB
OK      Homebrew Cache            1      1.5 GB
OK      Go Build Cache           89    845.0 MB
OK      System Logs              67    259.7 MB

Use with AI agents

mac-cleanup ships an Agent Skill that teaches coding agents (Claude Code, Codex, Copilot, ...) the scan → preview → approve → clean workflow. Agents can read it with mac-cleanup skill without installing it.

To install the latest skill from the repository:

npx skills add 2ykwang/mac-cleanup-go --skill mac-cleanup -g

Or save the copy bundled with your installed version:

mkdir -p ~/.claude/skills/mac-cleanup
mac-cleanup skill > ~/.claude/skills/mac-cleanup/SKILL.md

Agents use --json output and never clean without --yes, which the skill only allows after you approve a dry run.

Try prompts like:

Find what's using disk space in my development caches. Show me the largest cleanup candidates and what each one contains.

Clean my npm and Go build caches.

Find and clean up caches on my Mac.

How it works & safety

  • Scans known cache/log/temp paths across apps and tools in parallel.
  • Lets you preview items and exclude what you want to keep.
  • Labels targets by impact level (safe, moderate, risky, manual).
  • SIP-protected paths are excluded from scan/cleanup.
  • Built-in scans for Homebrew, Docker, old downloads, stale project build caches, and old Claude Code/Codex releases (command output, last-modified time, or the active release).

Impact levels

  • safe: auto-regenerated caches/logs.
  • moderate: may require re-download or re-login.
  • risky: user data possible; items start excluded.
  • manual: no automatic deletion; shows an app guide only.

Targets (as of v1.7.0)

  • Total targets: 202.
  • Groups: System 14, Browsers 15, Development 71, Applications 97, Storage 5.
  • Cleanup methods: trash 192, permanent 2, builtin 6, manual 2.
  • Builtins: homebrew, docker, old-downloads, project-cache, claude-code-versions, codex-daemon-releases.
  • Manual: telegram, kakaotalk (no automatic deletion; surfaces large data like chat caches).
  • Counts are release-based and may change over time.

Alternatives

  • mac-cleanup-py - Python cleanup script for macOS
  • Mole - Deep clean and optimize your Mac

License

MIT

Frequently Asked Questions

What is mac-cleanup-go?

mac-cleanup-go is a Software Packages library for the Go programming language. Preview-first TUI for cleaning macOS caches, logs, and temporary files

How do I install mac-cleanup-go?

Install mac-cleanup-go with the Go module system using `go get 2ykwang/mac-cleanup-go`. Check the repository for the current installation instructions.

What category does mac-cleanup-go belong to?

mac-cleanup-go is listed under Software Packages, specifically Other Software.

← Back to Other Software