Sitemap
DevelopersGlobal

Developers Global is a worldwide community where developers can come together to share insights, articles, and resources related to technology. It serves as a platform for developers of all skill levels to explore tech life, exchange ideas and much more

Cleaning developer clutter on a Mac from the Terminal

5 min readOct 12, 2026

--

Press enter or click to view image in full size

A developer’s day mostly happens in the Terminal. Projects get built there, logs get read, scripts get run, bugs get chased. And that is also where the mess collects, quietly, a few megabytes at a time. Caches, build artifacts, temporary files, the odd leftover nobody remembers creating: together they make up the developer clutter on a Mac that eventually shows up as a full disk.

Until now, clearing it meant leaving the Terminal for a separate app. CleanMyMac CLI removes that step. It brings CleanMyMac’s cleanup to the command line, so Docker artifacts, Xcode caches, build outputs and package manager leftovers can be dealt with in the same window where they were created. It is an early developer preview, and the footer on every screen says beta.

Where developer clutter actually comes from

It helps to know what is being cleaned, because the names are not always self-explanatory.

Some of it is generated by the tools themselves. Package managers such as Homebrew, npm, Yarn, pip and Cargo keep download caches. Build tools leave output folders behind: node_modules for installed JavaScript dependencies, .next for Next.js builds, .turbo for Turborepo’s cache, .build for Swift packages and target for Rust.

Some of it comes from Xcode. DerivedData holds the build output and index for every project that was ever opened. Device Support keeps symbol files copied from connected devices, Module Cache stores compiled modules, and Documentation Cache keeps documentation that was fetched along the way.

Get Hlib Serediuk’s stories in your inbox

Join Medium for free to get updates from this writer.

And some of it is just logs and trash. All of it is regenerable, and none of it is anything anyone wants to browse by hand.

Getting it running

CLI installs through Homebrew and needs macOS 11 Big Sur or later:

brew install --cask macpaw/taps/cleanmymac-cli

All commands follow the same pattern. Each one shows what it plans to remove and asks for confirmation before it deletes anything. The list is interactive, with a checkbox on every row, and the footer spells out the keys: arrows to move, Space to toggle an item, A to deselect everything, O to reveal in Finder, Enter to confirm and Q to quit.

One pass over everything

The simplest start is a full cleanup, which covers system junk, developer-tool caches and trash in a single run:

cleanmymac clean

The screenshot below catches the scan midway: checkmarks where a category is done, a spinner on npm, hollow circles for what is still waiting. System Junk lists user logs, DerivedData, macOS Device Support, Archives and simulator runtimes. Dev Tools begins with Homebrew, npm, Docker and VS Code. Trash Bins and AI Junk, which currently names Claude Code and Codex, make up the other two of the four categories.

Press enter or click to view image in full size
CLI scanning a Mac for system junk, dev tools, trash bins and AI junk in macOS Terminal

Caches left by developer tools

For a single category, clean takes a subcommand. This one targets the cached packages and build files that developer tools leave behind:

cleanmymac clean dev-tools

The list is long: Homebrew, npm, Yarn, pnpm, pip, Cargo, Go, CocoaPods, Docker, VS Code, JetBrains, Maven, Gradle, Poetry, uv, Bun, Deno and mise. In this screenshot Homebrew is the heavyweight at 1.4 GB, npm follows at 389 MB, and mise, pip and Bun add a bit more, which brings the selection to 1.97 GB.

Press enter or click to view image in full size
CLI Dev Tools cleanup screen showing Homebrew 1.4 GB, npm 389 MB, mise 61 MB, pip 29 MB and Bun 14 MB selected

Junk closer to the system

Another subcommand covers what lives nearer to the operating system: user logs, Xcode DerivedData, Device Support, Module Cache and Documentation Cache.

cleanmymac clean junk

The logs view is a good example of how the review works. Every entry shows its size and its full path, whether it is a Zoom folder, a log from a code editor or a launch service, so there is no guessing about what a name refers to.

Press enter or click to view image in full size
CLI User Logs view listing log folders with their size and full path

Build artifacts that outlived their projects

The last command goes after something different: old build output scattered across project folders.

cleanmymac purge

It scans the usual places developers keep code (~/Projects, ~/Code, ~/dev, ~/GitHub and ~/Workspace) and lists the removable artifacts grouped by project. Grouping matters because a project name is far easier to judge than a path. Artifacts older than seven days are preselected, while anything newer is left alone, so work from this week is not swept up with a project that has been idle for months. In the sample scan, Rust target folders sit next to node_modules, .turbo, .next and .build, from six projects.

Press enter or click to view image in full size
CLI purge scan results listing projects with node_modules, .next, .build, .turbo and target artifacts

What a finished run looks like

At the end of a run the tool prints a summary per category. In this example: 4.41 GB of System Junk, 1.97 GB of Dev Tools, 19.9 MB of Trash Bins and 736 MB of AI Junk. That adds up to 7.1 GB across 42 items. These numbers come from one machine, so they show what the output looks like and not what any other Mac will recover.

Press enter or click to view image in full size
CLI cleanup complete screen: 7.1 GB cleaned, 42 items removed

The last two lines of that screen point to two extra commands. cleanmymac ignore <path> adds an item to a whitelist, so a folder that should never be touched stops being offered. cleanmymac clean — force skips the confirmation, which is meant for situations where nobody is around to press Enter.

Where it stands

The tool is still an early preview, and the footer on every screen says beta. The set of commands is small, and a couple of its conventions are worth keeping in mind: purge only looks in the usual project folders, so a project stored elsewhere will not show up, and the seven-day rule is a fixed cutoff. The full command list and the notes on privacy and safety are in the GitHub repository.

Press enter or click to view image in full size

Thank you for being a part of the community

Before you go:

Press enter or click to view image in full size

--

Hlib Serediuk
Hlib Serediuk

Written by Hlib Serediuk

Software engineer. I work on macOS developer tools, mostly in the terminal. I write when something took me hours to figure out, usually with the logs attached.

DevelopersGlobal
DevelopersGlobal

Published in DevelopersGlobal

Developers Global is a worldwide community where developers can come together to share insights, articles, and resources related to technology. It serves as a platform for developers of all skill levels to explore tech life, exchange ideas and much more