Installing Claude Code on Mac: One Command Is All It Takes
claude-code

Installing Claude Code on Mac: One Command Is All It Takes

(updated 2026-09-07) · 11 min read · Habni

Search "install Claude Code" and you get a mix of answers. One post tells you to use npm, another says install Homebrew first, a third points you to the official script. Here is the short version for a Mac: one line in the terminal is all it takes.

curl -fsSL https://claude.ai/install.sh | bash

But before you type that command, there is one thing worth confirming. Claude Code is not available on the free plan. The install itself will go through, but you will get stuck at sign-in. Let's cover that first, then move on to installing.

If you have never opened a terminal before, that's fine. This guide is built to be followed step by step: opening the terminal, running the install command, confirming it worked, signing in, and giving Claude its first task. Each step tells you what success looks like, so you can compare it against your own screen as you go. Install commands can go stale quickly, so if you get stuck, check the official docs as a second reference.

Claude Code

Claude Code is Anthropic's AI tool that takes instructions in plain language from your terminal. It reads, organizes, and edits files directly on your computer.

Pricing: the free plan will not work, you need Pro or higher

Let's get this out of the way first, since it trips up a lot of people.

The official documentation is explicit: Claude Code requires a Pro, Max, Team, Enterprise, or Console account, and the free Claude.ai plan does not include access. That is a different arrangement from the free chat you might already use in your browser at claude.ai.

Here is the part that confuses people. The install itself works fine on a free account. The command runs, and claude --version reports a version number just like it should. The wall shows up one step later, when you try to sign in and actually hand it work. So a successful install does not mean you are ready to use it.

The same story plays out with a comparable tool, Codex CLI, though not identically. Codex itself is included on every ChatGPT plan, including the free one. But the terminal-based Codex CLI is only listed in the official feature table starting from the Plus plan, and the Free and Go cards do not list the CLI at all.

If you would rather get a feel for a terminal AI agent before spending anything, Antigravity CLI offers free usage and has a lower barrier to entry. My suggestion: spend a few days there to get a sense of the workflow, then decide whether a Claude Code subscription is worth it. That order at least saves you from subscribing and then finding out it is not for you.

What you need: a paid subscription and macOS 13 or later

Three things to check before you start. If any one of them is off, the install will not go through.

RequirementHow to check
A paid Claude subscriptionPro, Max, Team, Enterprise, or Console all work. If you're on your own, Pro is the usual starting point
macOS 13 or laterOpen "About This Mac" from the Apple menu. If your Mac is from 2022 or later, you almost certainly clear this bar
4GB of memory or moreNot something you need to worry about on a recent Mac

If you're on Windows, the install command is different. That gets its own guide.

Step 1: open the terminal

Press Command and the space bar together to open Spotlight search. Type "Terminal" and hit Enter. You can also find Terminal inside the Utilities folder within Applications.

Success looks like this: a white (or black) window appears with a blinking cursor. That window is your workspace for the rest of this guide. If you're curious about what a terminal actually is, you can set that aside for now: this guide only asks you to open the window and paste commands into it. If you want to build up terminal basics from scratch, there is a separate terminal setup lesson for that.

Step 2: run the install command

Copy the line below exactly, paste it into the terminal window, and hit Enter.

curl -fsSL https://claude.ai/install.sh | bash

Don't put sudo in front of it. If you've followed other install guides before, adding sudo out of habit is an easy trap, but here it actually causes a problem. Claude Code installs inside your own home folder, so it doesn't need administrator privileges. Add sudo and it ends up installed under the administrator account's home folder instead, which means the claude command won't work in your regular window. The install script knows about this and refuses to run if it detects sudo, explaining why.

Here's what that one line is doing. It downloads and runs Anthropic's official install script. The script figures out what kind of Mac you have (Intel or Apple Silicon), pulls the matching file, and checks it against a checksum to confirm it's genuinely what Anthropic published. Only after that check passes does it proceed with the install (the same idea as checking a tracking number against a package before you open it).

Once the install finishes, the script also updates your shell configuration so that claude works from any window going forward. The program itself lives in ~/.local/share/claude, with a shortcut pointing to it at ~/.local/bin/claude.

Success looks like this: a line reading Setting up Claude Code... scrolls by, followed by:

✅ Installation complete!

There's no progress bar, so it's normal for the screen to go quiet for a moment. No icon appears in the Dock or Launchpad either, and that's expected, not a bug.

Step 3: confirm the install in a new window

Close the terminal window you have open, then open a fresh one the same way as Step 1. The shell configuration you just set up only takes effect in windows opened after the install. In the new window, type:

claude --version

Success looks like this:

2.1.238 (Claude Code)

That output is from my own Mac, checked while writing this guide. The version number will differ depending on when you install. That's fine: as long as you see Claude Code in parentheses, the install worked.

Since we're on the subject of versions: you don't need to manage updates yourself. Installing through the official script means Claude Code quietly updates itself in the background. When I checked my own install folder, six past versions had piled up over time, and I never once ran an update command myself.

Step 4: sign in with your Claude account

In the same window, type just this:

claude

Your browser opens automatically. Sign in with your usual Claude account, and the flow hands control back to the terminal window. You only need to sign in once. After that, the session is remembered on your machine.

This is the fork in the road mentioned earlier. If you sign in with a free account, this is where it stops working. If you don't have a subscription, go to claude.ai, upgrade to Pro or higher, and try again.

Success looks like this: Claude Code's chat prompt appears inside the terminal.

Step 5: give it one task

Type plain language into the prompt, not code. Try something like:

List the files in this folder for me

If Claude reads the folder and gives you an organized answer, you're done for today. If you want to build up your terminal fundamentals from the ground up, the AI CLI track covers it across six lessons.

Fixing "command not found" and sign-in rejections

You typed claude and got "command not found." This is almost always a window issue. The shell configuration only takes effect in windows opened after the install, so the window you used during install won't recognize it. Close the terminal completely and open a new one. If you're in a hurry, you can also run this in your current window to fix it immediately:

export PATH="$HOME/.local/bin:$PATH"
claude

You're seeing "do not run this installer with sudo" during install. That means you added sudo in front of the command. The script is blocking this on purpose, so drop sudo and run it again as-is.

Sign-in fails or your account gets rejected. This is most likely a free plan. Claude Code requires a Pro subscription or higher.

Not sure what's wrong? Run claude doctor to check your install status. It doesn't start a session, just prints a diagnostic, so it's safe to run any time. It reports your install method, version, auto-update status, and if there's a problem, what's causing it and how to fix it.

In 30 seconds
  • Claude Code doesn't work on the free plan. You need Pro, Max, Team, Enterprise, or Console. The install itself succeeds, but sign-in is where it stops.
  • Installing on Mac takes one line in the terminal: curl -fsSL https://claude.ai/install.sh | bash. Don't add sudo.
  • Five steps: open the terminal, run the install command, confirm with claude --version in a new window, run claude and sign in, then give it a first task.
  • You need macOS 13 or later and at least 4GB of memory.
  • Installing through the official script means updates happen automatically in the background. Nothing to manage yourself.
  • If you see "command not found" right after installing, opening a fresh terminal window is the first fix. If you're not sure what's wrong, run claude doctor to diagnose it.

Frequently asked questions

Can I use Claude Code for free?

No. According to the official documentation, Claude Code requires a Pro, Max, Team, Enterprise, or Console account, and it is not included with the free Claude.ai plan. The install itself works on a free account, but you'll be blocked at sign-in. If you want to try a terminal AI agent without paying, Antigravity CLI offers free usage as a starting point.

I installed claude but I'm getting command not found. Why?

The install succeeded, but the terminal window you currently have open doesn't yet know where the program is. Shell configuration only takes effect in windows opened after the install. Close the terminal completely and try again in a new window. If that doesn't fix it, add ~/.local/bin to your PATH directly with an export command.

Other guides say to use npm or Homebrew instead. Why?

You can install via npm (npm install -g @anthropic-ai/claude-code) or Homebrew (brew install --cask claude-code) as well. But npm requires Node.js 22 or later installed separately, and Homebrew requires Homebrew itself first. On top of that, Homebrew installs don't auto-update, so you'd need to run brew upgrade yourself. For a first install, the one-line official script is the easier path.

How do I update Claude Code?

If you installed via the official script, there's nothing to do. It updates automatically in the background. To update immediately, run claude update. If you installed via Homebrew or npm, auto-update doesn't apply, so you'll need to run brew upgrade or npm install -g @anthropic-ai/claude-code@latest yourself.

The terminal seems intimidating. Do I really need to use it?

No, there's also a desktop app that doesn't require a terminal. That said, to get the full benefit of the automation Claude Code offers, the terminal version is more capable. The five steps in this guide are just copy-and-paste, so it's manageable even if you've never opened a terminal before.

How do I install Claude Code on Windows?

On Windows, run irm https://claude.ai/install.ps1 | iex from PowerShell. The command is different from Command Prompt (CMD) too. Since the commands differ from Mac, Windows users should follow a Windows-specific guide.

Sources (4)Expand to see all sources
#install Claude Code mac#Claude Code mac install#Claude Code setup#Claude Code installation#claude code terminal#Claude Code#terminal

Related Posts