How to Install Claude Code on macOS
Install the Claude Code CLI on a Mac, authenticate it, and confirm the install works before you point it at a real project.
Claude Code is a command line tool that runs Anthropic's coding agent inside your terminal, against the files in your project. Before you can use it you need it installed and signed in. This guide covers a clean install on macOS using the native installer, plus a fallback through npm if you prefer to manage it that way.
What you need
- A Mac running macOS 13 or newer
- Terminal access (the built-in Terminal app or iTerm)
- An Anthropic account, or a Claude Pro / Max subscription, or an API key
- About 5 minutes
Step 1: Run the native installer
The simplest path is the official install script, which downloads a self-contained binary and does not require you to manage Node yourself. Open Terminal and paste the command below.
Step 2: (Alternative) install with npm
If you already manage tools with Node, you can install the package globally instead. This works on any platform that has Node 18 or newer.
node --version # should print v18 or higher
npm install -g @anthropic-ai/claude-codeStep 3: Authenticate
Run claude once to start the login flow. It opens a browser where you sign in with your Anthropic account or paste an API key. After that, the token is cached so you stay signed in.
Step 4: Verify the install
Check the version and run the built-in diagnostics. If both succeed, you are ready to open a project.
Result: typing claude in any folder now launches the agent. In the next guide you will point it at an actual project and run your first task.
Watch related tutorials
6:41
14:00
12:00
09:00
10:00
9:47