What is the relationship between Xcode and Xcode command line tools When I install Xcode from App Store, I can compile programs in Xcode as well as command line too. Several command line utilities like clang, make and git all become available when Xcode.app is installed. So I thought that the separate package of command line tools are only for those who do not want a full IDE installed.

But to my surprise, one of the linking problems I encountered when compiling MacVim can be successfully solved by installing the command line tools with xcode-select --install. So apparently the Xcode.app and the command line tools differ, at least in subtle ways. What is the difference then? Does the latter have better coverage for all the essentials for programming than the former?

Currently I am using Xcode 6.0.1 on Mavericks.
You can see it as:


The command line tools are the basic foundation. Many basic tools are needed to compile your Swift/Objective-C code.
XCode is the IDE which brings a few additional packages with it. 



  So the command line tools get sure that the basic UNIX tools are
  covered (as GCC for example) to be able to compile and link code.


Xcode then is using those basic tools.



From the documents:

What is the Command Line Tools Package?


  The Command Line Tools Package is a small self-contained package
  available for download separately from Xcode and that allows you to do
  command line development in OS X. It consists of two components: OS X
  SDK and command-line tools such as Clang, which are installed in
  /usr/bin.