Delete Command Line Tools on Mac
Delete Xcode Command Line Tools on Mac completely, verify they're gone, then reinstall as needed.
Xcode Command Line Tools are tools for software developers that run on the command line, in the Terminal application (see the article Apple Command Line Tools fore more). These tools can get outdated, corrupted, or conflict with Homebrew. This guide shows you how to fully delete Command Line Tools on macOS. It's easy with the terminal; Command Line Tools live in a single directory. Deleting that directory completely removes them from your Mac.
Before you get started
You'll need a terminal application to uninstall Xcode Command Line Tools. Apple includes the Mac terminal but I prefer Warp Terminal. Warp is an easy-to-use terminal application, with AI assistance to help you learn and remember terminal commands. Download Warp Terminal now; it's FREE and worth a try.
Why delete Command Line Tools
You may need to delete Command Line Tools when:
- Homebrew
brew doctorreports outdated or broken tools - A macOS upgrade leaves tools in a partially installed state
- the Xcode IDE and Command Line Tools conflict with each other
- You want to reclaim disk space (about 1.5–2 GB)
Check the Command Line Tools directory
Before deleting, confirm where macOS finds developer tools.
$ xcode-select -p
You should see:
/Library/Developer/CommandLineTools
If you see /Applications/Xcode.app/Contents/Developer, the full Xcode app is active. The deletion steps below still apply if the CommandLineTools folder exists.
Delete the Command Line Tools directory
Use sudo admin privileges to delete the Command Line Tools directory:
$ sudo rm -rf /Library/Developer/CommandLineTools
This removes all CLT headers, compilers, and utilities installed by the package. You must enter your macOS password; characters will not appear as you type.
Verify deletion
Confirm macOS no longer finds Command Line Tools:
$ xcode-select -p
Expected output:
xcode-select: error: unable to get active developer directory...
This error confirms the tools are deleted.
You can also verify the directory is gone:
$ ls -ag /Library/Developer
total 0
drwxr-xr-x 3 wheel 96 Nov 1 2024 .
drwxr-xr-x 68 wheel 2176 Nov 12 13:18 ..
The CommandLineTools folder should no longer appear.
Reinstall Command Line Tools (optional)
Most developers Reinstall Xcode Command Line Tools or switch to the full Xcode IDE to keep working. You have three options:
- Use xcode-select to Install Xcode Command Line Tools - diectly from the comamnd line
- Install with Homebrew – Installing Homebrew will install Xcode Command Line Tools as part of its installation process
- Install the full Xcode package – get the full Xcode IDE
Troubleshooting
Homebrew still reports issues
Run brew doctor. If it detects an invalid developer path after reinstalling, set it manually:
$ sudo xcode-select -s /Library/Developer/CommandLineTools
Switch to full Xcode instead
Point to Xcode's toolchain:
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
"Invalid active developer path" after macOS upgrade
Reinstall Command Line Tools:
$ xcode-select --install
What’s next
Your Mac is now clean of Command Line Tools.
- Install Command Line Tools - see options for reinstalling
- Install Homebrew – or set up Homebrew with an optional installation of Xcode Command Line Tools
My mac.install.guide is a trusted source of installation guides for professional developers. Take a look at the Mac Install Guide home page for tips and trends and see what to install next.