Where apps hide your files
The standalone Command Line Tools install into one system folder, and xcode-select -p tells you which developer folder your Mac is actually using right now. That answer is either the Command Line Tools or a full Xcode.
/Library/Developer/CommandLineTools
That is where the tools from xcode-select --install go. It is the top-level /Library, not the one in your home folder, and it is owned by root. To open it in Finder, press ⇧⌘G in Finder (Go > Go to Folder), paste the path and press Return. From Terminal:
open /Library/Developer/CommandLineTools
Having the folder does not mean it is the one in use. Ask the Mac:
xcode-select -p
You get one of two answers:
| Output | Meaning |
|---|---|
/Library/Developer/CommandLineTools | The standalone Command Line Tools are active. |
/Applications/Xcode.app/Contents/Developer | A full Xcode is selected, and its own copy of the tools is used instead. |
On the Mac used for this guide both exist side by side, and the command prints the Xcode path. The 2.7 GB Command Line Tools folder is still there, simply unused by git, clang and make until you switch.
/usr/bin/git is not where git livesCommands such as /usr/bin/git, /usr/bin/clang and /usr/bin/python3 are small stubs, not the real programs. They ask xcrun to find the real tool in the active developer folder and run that. You can see where a stub will land:
xcrun --find git
With the standalone tools active this points into /Library/Developer/CommandLineTools/usr/bin/. With Xcode active, it points into /Applications/Xcode.app/Contents/Developer/usr/bin/, which is what the Mac used here reports. This is also why /usr/bin/git exists on a Mac that has never had anything installed: the first run of one of these stubs is what triggers the install prompt.
| Folder | What it holds |
|---|---|
usr/bin | The real tools: clang, git, make, lldb, swift, python3, ar, as and over a hundred more. |
usr/include, usr/lib | Headers and libraries used when compiling. |
SDKs | The macOS SDKs. MacOSX.sdk is a symbolic link to the newest versioned one, for example MacOSX26.2.sdk, and older ones such as MacOSX15.4.sdk can sit beside it. |
Library | Frameworks: Python3.framework in Library/Frameworks, and the Swift Testing frameworks in Library/Developer/Frameworks. |
One release installs more than one SDK (version 26.2 put both MacOSX26.2.sdk and MacOSX15.4.sdk on the Mac used here), and SDK folders from earlier releases can stay behind after an update. Ask for the one in use with xcrun --show-sdk-path.
Install them from Terminal:
xcode-select --install
That opens a dialog asking to install the tools. If they are already installed, it prints a note saying so and points you to Software Update instead. To see the installed package version without opening anything:
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
Updates arrive through Software Update in System Settings, or softwareupdate --list in Terminal, as a separate Command Line Tools item when Apple has a newer release. The copy of the tools inside Xcode is separate: it only changes when Xcode itself is updated.
These two commands change system configuration and ask for your administrator password, so run them only when you mean to. Point at the standalone tools:
sudo xcode-select --switch /Library/Developer/CommandLineTools
Point at Xcode:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcode-select --reset drops back to the default path. After switching, run xcode-select -p again to confirm.
When builds fail with missing headers or an SDK mismatch after a macOS upgrade, the standard fix is to remove the folder and install it again. Quit anything that is compiling first. This deletes only that one folder, which the installer recreates:
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
Check the path twice before pressing Return. Do not run it with a different path, and do not use it on /Library/Developer as a whole, which also holds other Apple developer data.
Two read-only commands show the contents quickly. The first lists the tools; the second shows how much space each part takes:
ls /Library/Developer/CommandLineTools/usr/bin
du -sh /Library/Developer/CommandLineTools/*
The folder is mostly SDKs and compilers, so SDKs and usr account for nearly all of it. If you see several SDK folders, some came with the current release and some are left from earlier ones; the MacOSX.sdk link is the one a plain build uses.
The folder is roughly 2.7 GB on the Mac used here, mostly SDKs and compilers. Nothing in it is a cache you can trim file by file: deleting one SDK by hand can break builds that name it. The sizeable developer data that is safe to clear lives elsewhere, for example Xcode's build folders under ~/Library/Developer/Xcode, which is a different topic.
Spotlight and Finder searches leave most of /Library/Developer out of their results, and the tools are stored as many small binaries with no extension. Typing clang into a normal Finder search finds nothing useful, though which -a clang finds the stub immediately.
Everywhere indexes the system /Library and the unprotected parts of your home folder as well, so typing MacOSX lists every SDK folder, in these tools and inside Xcode.app, and lldb or clang finds the real binaries inside CommandLineTools/usr/bin. Press ⌘↵ to reveal one in Finder. It matches file names only, so it will not tell you which tools are active; xcode-select -p does.
In /Library/Developer/CommandLineTools. Run xcode-select -p to see whether that folder or a full Xcode's Contents/Developer is the one in use.
The path of the active developer directory: /Library/Developer/CommandLineTools when the standalone tools are selected, or /Applications/Xcode.app/Contents/Developer when Xcode is.
Run xcode-select --install in Terminal and follow the dialog. Running git, clang or make for the first time also offers the install.
Yes, with sudo, and xcode-select --install recreates it. Delete only that one folder, and remember that if it is the active developer folder, git and clang stop working until you reinstall.
Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Version 2.20.3 · macOS 13+ · 4.7 MB · notarised