Mac guide

Is it safe to delete Command Line Tools on Mac?

Updated

Command Line Tools is Apple's package of developer tools for the Terminal. It is not a cache, so deleting it doesn't just free space: anything that needs a compiler or git stops working until you install it again. This guide explains what it is, how to check whether you need it, and how to remove and reinstall it.

Short answer: it's safe to delete only if nothing you use needs it. Git, Clang and tools that build software, such as Homebrew, rely on it. It lives in /Library/Developer/CommandLineTools, and you can always reinstall it with xcode-select --install.

This applies to macOS Sonoma 14 and later.

1. What Command Line Tools is

Apple describes the package as the macOS SDK plus command-line tools such as Clang, the compiler. It also brings tools like git and make. It installs into /Library/Developer/CommandLineTools. You usually got it because you ran git for the first time, installed Homebrew, or accepted a prompt to install developer tools.

Xcode includes its own copy of the same tools. If you have Xcode installed, the standalone package may be unused.

2. Check whether you need it

  1. Open Terminal and run xcode-select -p. It prints the developer folder macOS uses for these tools.
  2. If it prints /Library/Developer/CommandLineTools, the standalone package is the one in use.
  3. If it prints a folder inside Xcode.app, your tools come from Xcode, and the standalone package isn't the active one.

To see how much space it takes, choose Go › Go to Folder in the Finder, enter /Library/Developer, select CommandLineTools and choose File › Get Info.

3. What stops working without it

Your projects, files and Xcode itself are not affected.

4. Remove it

There's no uninstaller: the tools live in that one folder.

  1. Quit Terminal windows and apps that use git or a compiler.
  2. In Terminal, run sudo rm -rf /Library/Developer/CommandLineTools and enter your administrator password. Type the path carefully: this deletes the folder permanently, without using the Trash.
  3. If you use Xcode, point the tools at it with sudo xcode-select --switch /Applications/Xcode.app.

5. Reinstall it

Run xcode-select --install in Terminal and follow the dialog. It downloads the current package from Apple. You can also install it from the Downloads page of the Apple Developer site.

With KittoCleaner

KittoCleaner doesn't remove Command Line Tools: it's a tool you install, not a cache. What KittoCleaner clears are the caches around it, which rebuild on their own.

Scanning is free; cleaning draws on the free cleaning allowance unless you have Pro or a Single Clean credit. KittoCleaner needs macOS 14 Sonoma or later.

Sources