Install Claude Code on Mac
Install Claude Code on Mac. Install with Homebrew if you're a software developer. Use the native installer if you do not use Homebrew. Then sign in and verify the claude command.
Here's how to install Claude Code CLI, an AI coding tool. It runs in your terminal with the claude command. It reads your codebase, edits files (with your permission), and runs commands so you can develop software with AI assistance.
Claude Code CLI is not the Claude Desktop app, which is a separate desktop application with its own AI Chat, Cowork (business agent), and Code tabs. The Claude Desktop app's Code tab is Claude Code with a graphical interface, so the real difference is whether you prefer to work in the terminal or a graphical app. See Claude Code vs Claude Desktop.
I recommend using our free app to install Claude Code on your Mac. It is a FREE Mac app that installs Claude Code, 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:
Installing Claude Code is one step in setting up your Mac for development. See the full roadmap to set up a Mac for software development.
Set up your Mac first
Claude Code needs a working development environment first with macOS 13.0 or newer (on Apple Silicon or Intel), a terminal application, Homebrew, the Xcode Command Line Tools, git, and a paid Claude plan. See What's Needed to Run Claude Code for details on what you need and how to check what you already have. With that in place, install Claude Code below.
Install Claude Code with Homebrew (recommended)
For most developers, Homebrew is the cleanest way to install Claude Code. It installs and manages the tool alongside everything else on your Mac, so you upgrade and remove it with the same brew commands you already use for other tools. If you do not have Homebrew yet, install Homebrew first.
Brew Install Claude Code gives you the details: the brew cask command, choosing a release channel, turning on auto-update, and uninstalling.
Install Claude Code without Homebrew (the native installer)
If you do not use Homebrew, the native installer is the simplest alternative. It is Anthropic's default, needs no package manager, and auto-updates in the background. The command downloads a short script and runs it, which installs the claude binary:
$ curl -fsSL https://claude.ai/install.sh | bash
This installs the claude binary to ~/.local/bin/claude and adds that folder to your PATH. When the script finishes, open a new terminal window so your shell picks up the PATH change.
The npm alternative
Claude Code can also be installed with an npm method (npm install -g @anthropic-ai/claude-code). It works, but I do not recommend it: npm requires Node.js and pulls the tool through the npm registry, which adds a dependency and supply-chain risk you do not need. Use the Homebrew cask or the native installer instead.
Start Claude Code and sign in
After installing Claude Code, move into a project folder so Claude Code has something to work on:
$ cd your-project
Start Claude Code:
$ claude
On the first launch, Claude Code opens your browser so you can sign in with your Claude account. Follow the prompt to authenticate. If the browser does not open on its own, copy the sign-in URL, then paste it into your browser. Your subscription must be active, and Anthropic Console users need the Claude Code or Developer role on their account.
Verify the installation
Confirm the claude command is on your PATH:
$ claude --version
This displays a version string. The exact number changes often, because Claude Code ships updates continuously. If you instead see zsh: command not found: claude, go to the troubleshooting section below.
For a fuller check of your installation and configuration health, run the built-in diagnostic:
$ claude doctor
This reports on your install and configuration, the result of the last update, and Keychain access. Use it as your "is everything working" check.
Troubleshooting
Fix command not found: claude
If you've installed Claude Code using the native installer, this message means ~/.local/bin, the folder the native installer uses, is not on your PATH. First check whether it is already there:
$ echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin"
This shows the line /Users/you/.local/bin if the folder is on your PATH, or nothing if it is missing. If nothing appears, add the folder to your PATH.
See Shell Configuration for instructions on how to edit the Mac Path. Append this line to ~/.zprofile (see .zshrc vs .zprofile for why .zprofile):
$ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zprofile
Reload the shell so the change takes effect:
$ source ~/.zprofile
Then run claude --version again. This step edits a shell startup file, so make the change carefully. For the full walkthrough, see command not found: claude.
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.