What's Needed to Run Claude Code
Prerequisites for Claude Code on Mac: set up a developer environment with a terminal, Homebrew, the Xcode Command Line Tools, git, a code editor, and a paid Claude plan.
Here's how to set up your Mac to run Claude Code CLI, the AI coding tool. Claude Code runs in your terminal with the claude command.
This is for Claude Code CLI, but the Claude Desktop app will require a similar setup, as these are prerequisites for any programming project on a Mac. See Claude Code vs Claude Desktop for the differences between the CLI and GUI apps. For the install itself, once your environment is ready, see Install Claude Code on Mac.
I recommend using our free app to set up Claude Code with all the prerequisites. It is a FREE Mac app that installs Claude Code and the developer tools it needs, configures your system, and verifies it is working. It does everything this guide covers, but easier and faster. Here are all the details about the app before you download. Then:
Setting up a developer environment is the foundation for any programming project. See the complete Mac setup checklist for more.
First steps to set up your Mac for Claude Code
First, check the macOS version. If you're running an older version, upgrade macOS to the latest macOS version.
Here is everything a Claude Code development environment needs. Each item has its own step below.
- macOS 13 or newer, on Apple Silicon (M-series) or Intel. This is Claude Code's supported floor.
- Terminal application. Where you run the
claudecommand. Every Mac includes Terminal, but I recommend Warp for a faster, AI-assisted option. - Homebrew. The package manager needed as a foundation. It installs the Apple Xcode CLT tools automatically.
- Xcode Command Line Tools. Compilers, headers, and git, for a basic developer toolchain. Homebrew installs these.
- Git. Claude Code works directly with git, staging changes, writing commits, and creating branches and pull requests for save-as-you-go version control
- A code editor. Where you read and edit the code Claude Code writes. Zed (recommended), VS Code, or another favorite editor.
- A paid Claude plan. The Claude Code capability requires Pro, Max, Team, Enterprise, or a Console or API account. The free plan does not include access to Claude Code.
- A workspace folder (optional). A project folder with a starter
CLAUDE.mdto provide guidance to Claude Code.
You do not have to install these one at a time by hand. Our free app "Set Up Your Mac for Claude Code" sets them all up for you; the manual checklist below is the same set of steps done by hand.
Diagnose what you already have
Before you install anything, find out what is already on your Mac. Run each check and compare it against the result described. Whatever passes, you can skip.
First, check the macOS version (you'll need 13.0 or newer):
$ sw_vers -productVersion
A version number such as 14.5 appears. If the major number is 13 or higher, you are fine. If it is 12 or lower, upgrade macOS first. Check whether your Mac uses Apple Silicon (M-series) or Intel, which is informational because both are supported:
$ uname -m
You see arm64 on Apple Silicon (M-series) or x86_64 on Intel. Check whether Homebrew is already installed:
$ brew --version
You see a version line such as Homebrew 6.x.x. If you instead get zsh: command not found: brew, Homebrew is not installed, so see "Install Homebrew and the Apple build tools," below. Check whether the Xcode Command Line Tools are installed:
$ xcode-select -p
A path such as /Library/Developer/CommandLineTools appears. If you get an error about an active developer directory, the tools are not installed yet, and installing Homebrew installs them.
Choose a terminal application
Every Mac ships with a terminal application (in the Utilities folder in the Applications directory). That is enough to run every command on this page and run Claude Code. If you have never opened a terminal application before, see How to Open Terminal in Mac.
For a faster, more modern terminal application for Claude Code, I recommend Warp, which is designed for the kind of command-driven, AI-assisted workflow Claude Code uses.
Install Homebrew and the Apple build tools
Homebrew is the macOS package manager. You'll need it to install Claude Code's cask, git, your editor, and Warp. It gives you one consistent way to install, update, and remove everything. Installing Homebrew also installs the Xcode Command Line Tools, because the Homebrew install script checks for them and runs Apple's installer if they are missing.
Install Homebrew with the official command:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
The script shows what it will do and pauses for confirmation. It may ask for your Mac login password (to set up folders), and it installs the Xcode Command Line Tools if they are missing, which can take several minutes. When it finishes, it displays a short "Next steps" section.
On Apple Silicon (M-series), Homebrew installs to /opt/homebrew, and the installer tells you to add Homebrew to your PATH. Run the lines the installer shows. They look like this:
$ echo >> ~/.zprofile
$ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
$ eval "$(/opt/homebrew/bin/brew shellenv)"
Then confirm Homebrew works:
$ brew --version
A version line such as Homebrew 4.x.x appears. On Intel Macs, Homebrew installs to /usr/local and is on your PATH without the shellenv step, though running the lines the installer shows does no harm.
To install the Command Line Tools on their own, without Homebrew (for example, if you only need git and compilers), run the standalone command:
$ xcode-select --install
A dialog offers to install the Command Line Tools. Click Install and accept the license. This is the same toolchain Homebrew triggers for you.
Confirm git is installed
You almost certainly have git already, because the Xcode Command Line Tools include it. Claude Code works directly with git, staging changes, writing commit messages, creating branches, and opening pull requests, so a working git is part of the environment. Confirm it is present:
$ git --version
A version line appears. The Apple-bundled git is fine to start with. You can update git from Homebrew for a newer version:
$ brew install git
Open a new terminal window afterward, and git --version reports the newer Homebrew version. If you have not used git on this Mac before, set your identity once, which git writes to commits:
$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"
These write to ~/.gitconfig and produce no output on success.
Install a code editor
You need somewhere to read and edit the code Claude Code writes. If you already have a favorite editor, keep it. Otherwise, I recommend Zed, which is fast and modern, and installs through Homebrew:
$ brew install --cask zed
VS Code is a slower, more widely used option, and Claude Code ships a VS Code extension (anthropic.claude-code, with inline diffs, @-mentions, and plan review).
$ brew install --cask visual-studio-code
After installing VS Code, add the Claude Code extension from the Extensions view (search for "Claude Code").
If you use a JetBrains editor, there is a plugin for IntelliJ, PyCharm, and WebStorm. The JetBrains plugin installs from the JetBrains Marketplace. Both the VS Code extension and the JetBrains plugin need the Claude Code CLI installed separately, because they drive the same engine.
Get a paid Claude plan
Claude Code is not free. Running it, in the terminal CLI or the Desktop app's Code tab, requires a paid Claude plan (Pro, Max, Team, or Enterprise) or an Anthropic Console or API account. The free Claude.ai plan does not include Claude Code, so a free account is prompted to upgrade when it opens a Claude Code session.
There is nothing to install for this step, because it is an account, not software. You sign in through your browser the first time you launch Claude Code, so no password is typed into the terminal. Before you install, make sure you have an eligible plan. Check or upgrade your plan at claude.com/pricing. Console and API users need the Claude Code or Developer role on their account.
Create a workspace folder
Claude Code needs to work with files in a project folder. You can point it at any folder, but adding a CLAUDE.md file makes it noticeably better. CLAUDE.md is a Markdown file Claude Code reads at the start of every session, where you put coding standards, architecture notes, and project conventions. Create a workspace folder and move into it:
$ mkdir -p ~/Projects/my-first-project
$ cd ~/Projects/my-first-project
Create a minimal starter CLAUDE.md, which you edit later to describe your actual project:
$ printf '# Project notes for Claude Code\n\n- What this project is:\n- Conventions to follow:\n- Things to avoid:\n' > CLAUDE.md
This writes a CLAUDE.md file in the folder. Open it in your editor and fill it in. This step is optional, because Claude Code runs without it, but it is recommended.
Install Claude Code
With your development environment in place, your Mac is ready for Claude Code. Install Claude Code itself next. Use Homebrew:
$ brew install --cask claude-code
Then verify it runs, in a fresh terminal window:
$ claude --version
A version string appears. If you get zsh: command not found: claude, your PATH needs a fix. See command not found: claude for details. For more on release channels, auto-update, and uninstalling, see Brew Install Claude Code.
Alternative installation methods
You may see tutorials that suggest installing Claude Code with npm install -g @anthropic-ai/claude-code. It works, but I do not recommend it, because it adds a Node.js dependency and supply-chain risk you do not need.
Continue setting up your Mac
Don't miss the full visual roadmap and checklist that shows how to set up a Mac for software development, with all the essential tools and settings you might not yet know about.