Skip to content
SquirrelDisk

Mac

Is it safe to delete Command Line Tools on Mac?

Yes, if you don't use git, Homebrew or developer tools. macOS still works, and you can reinstall them with one command. Xcode data is often bigger.

Updated 6 October 2026

Yes, if you don't need them. The Command Line Tools are an optional package for developers. macOS doesn't depend on them, and removing /Library/Developer/CommandLineTools only affects tools like git, clang, make and Homebrew. If you need them again, one command reinstalls them.

Quick verdict:

  • You never use Terminal for development: safe to delete.
  • You use git, Homebrew, Python packages or compile code: keep them, or you'll reinstall them soon.
  • You have full Xcode: the separate package is optional, but Xcode's own data is usually a much bigger space hog.
  • How: in Terminal with admin rights. There is no uninstaller.

What are Command Line Tools?

The Command Line Tools for Xcode are a small package from Apple with the macOS SDK and command-line developer tools such as the Clang compiler. Apple's command-line FAQ says they install into:

/Library/Developer/CommandLineTools

Inside you'll find usr/bin with the tools (git, clang, make, swift and others) and SDKs with one or more macOS SDKs.

You may have installed them on purpose, but often they arrive on their own:

  • The first time you run git, make or python3 in Terminal. Those commands in /usr/bin are small stand-ins (Apple calls them shims) that point to the real tools. If the tools are missing, macOS offers to install them.
  • When you install Homebrew, which needs them to build packages.
  • When a developer app or script needs a compiler.

They grow over time because updates can add new SDKs next to older ones. On the Mac we checked, the folder held six macOS SDKs and took about 2 GB.

Full Xcode (/Applications/Xcode.app) contains the same tools, so you don't need both. Run xcode-select -p to see which one your Mac uses: /Library/Developer/CommandLineTools or /Applications/Xcode.app/Contents/Developer.

How much space does it use?

With Terminal:

du -sh /Library/Developer/CommandLineTools
du -sh /Library/Developer/CommandLineTools/SDKs/*

With Finder. Choose Go → Go to Folder (Shift-Command-G), type /Library/Developer, select CommandLineTools and choose File → Get Info.

With SquirrelDisk. SquirrelDisk is a free disk space analyzer. Scan your startup disk, or click A folder and choose /Library/Developer, to see the tools next to everything else. It's most useful for the bigger developer folders in your home folder (see below): scan ~/Library/Developer to see how much Xcode, its build data and simulators take. From Terminal: squirreldisk scan ~/Library/Developer --depth 2 --top 10.

How to delete it safely

There's no uninstaller and no setting in System Settings. Apple's FAQ simply says to remove the folder. Because it belongs to the system's /Library, you need admin rights, so Terminal is the right tool:

  1. Check what uses them. If you use Homebrew, git, or build Python or Node packages, think twice. You'll need the tools back to update or install anything.

  2. Check which developer folder is active:

    xcode-select -p
    
  3. Delete the folder. Type this carefully; rm -rf deletes without asking and skips the Trash:

    sudo rm -rf /Library/Developer/CommandLineTools
    

    Enter your Mac password when asked (nothing appears while you type).

  4. If you have Xcode and step 2 showed the CommandLineTools path, point your Mac at Xcode instead, so commands keep working:

    sudo xcode-select --reset
    
  5. Done. No restart is needed.

To reinstall them later, run:

xcode-select --install

and follow the dialog. Typing git in Terminal also brings up the install prompt.

SquirrelDisk won't delete /Library itself, and it asks for an extra confirmation for anything inside it. As it runs without admin rights, it can't remove admin-owned folders like this one anyway, so use the Terminal command above.

What you should not delete

  • Anything in /usr/bin. Those are part of macOS, not of the Command Line Tools. The system protects them.
  • /Library/Developer as a whole if you have Xcode: it can also hold simulator runtimes and other Xcode components, which are better removed from Xcode (see below).
  • xcode-select, which is part of macOS.

If something breaks after removing the tools, such as an error saying xcrun: error: invalid active developer path, run xcode-select --install to put them back, or sudo xcode-select --reset if you have Xcode.

Xcode: the bigger space hogs

If you have full Xcode, the Command Line Tools are rarely the problem. Xcode's own data in your home folder usually grows much larger:

FolderWhat it isSafe to delete?
~/Library/Developer/Xcode/DerivedDataBuild products and indexes for your projectsYes. Xcode rebuilds them, the next build is slower
~/Library/Developer/Xcode/iOS DeviceSupportDebug symbols for devices you've connectedYes, for old iOS versions you no longer test on
~/Library/Developer/Xcode/ArchivesArchived app buildsOnly if you don't need them to symbolicate crash reports
~/Library/Developer/CoreSimulator/DevicesYour simulators and the apps inside themUse xcrun simctl (below)

For simulators, a thread on Apple's Developer Forums suggests:

xcrun simctl delete unavailable

which removes simulators for runtimes you no longer have. Simulator runtimes themselves are best removed from Xcode → Settings → Components (called Platforms in older versions of Xcode). If you don't develop for Apple platforms at all, uninstalling Xcode from /Applications and deleting ~/Library/Developer frees all of it.

For more places where space hides in your Library, see Is it safe to delete cache files on Mac? and Is it safe to delete the Application Support folder?.

Questions

What happens if I delete Command Line Tools?

macOS keeps working normally. Commands like git, make, clang and python3 stop working and ask you to install the tools again, and Homebrew can't build or update packages that need them.

How do I uninstall Command Line Tools?

Run sudo rm -rf /Library/Developer/CommandLineTools in Terminal and enter your password. That's the method Apple describes in its command-line FAQ. Check the path carefully before pressing Return.

How do I reinstall Command Line Tools?

Run xcode-select --install in Terminal and follow the dialog. Typing a command such as git also offers to install them.

Do I need Command Line Tools if I have Xcode?

No. Xcode includes the same tools. If you have Xcode, the separate Command Line Tools package is optional, but some setups, such as Homebrew, may still use it.

Why do Command Line Tools keep coming back?

Because something asked for them. Running git, installing Homebrew or a developer app can trigger the install prompt again, and Software Update offers new versions once they are installed.

Where are Command Line Tools installed on Mac?

In /Library/Developer/CommandLineTools. Run xcode-select -p to see which developer folder your Mac is currently using.

Try SquirrelDisk

Free and open source, for macOS, Windows and Linux.

v2.5.0 · macOS · Windows · Linux