How to install Claude Code on a Mac, and how it differs from Codex

Install Claude Code with one command, which Claude plans you can sign in with, what to do if the claude command is missing, and how it compares with Codex.

Updated Dec 2, 2026

How to install Claude Code on a Mac, and how it differs from Codex

01What Claude Code is

Claude Code is a coding agent made by Anthropic that runs in Terminal. You tell it what to do in plain language, and it reads your code, edits files and runs commands on its own, then tells you what it did.

  • Requirements: macOS 13 or later, and 4 GB of memory or more.
  • Account: Claude Pro, Max, Ultra, Team and Enterprise plans all include Claude Code. You can also use an API account from the Claude Console. The free plan doesn’t include it.
  • Anthropic requires you to use it in a country or region it supports.

02Install it with one command

Open Terminal and run the recommended install command:

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

It installs claude into your own ~/.local/bin folder. When it finishes, close Terminal, open a new window and run claude --version. If you see a version number, it’s installed.

  • You can also install it with Homebrew: brew install --cask claude-code. This version is about a week behind the latest one and doesn’t update itself.
  • To install with npm you need Node 22 or later: npm install -g @anthropic-ai/claude-code@latest. Anthropic says not to add sudo.

Homebrew is already installed on NexMini Macs. All of the methods above install into your own account, so a standard account is enough and you don’t need to contact us.

03Sign in

  1. Run claude in Terminal.
  2. Follow the prompt to sign in to your Claude account in the browser. Once you approve it, go back to Terminal and you’re ready.
  3. If you use the API: set a key created in the Claude Console as the environment variable ANTHROPIC_API_KEY. The first time you run Claude Code, it asks whether to use it.

04What if the claude command isn’t found

If you see command not found: claude, ~/.local/bin is usually missing from the system’s search path (PATH). macOS uses zsh by default; run these two commands to add it:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc

source ~/.zshrc

For other problems, run claude doctor. It only checks and changes nothing; it lists problems with the install and settings and suggests how to fix them.

05How to update

  • Installed with the official command: it updates automatically in the background. To update right away, run claude update.
  • Installed with Homebrew: it doesn’t update automatically. Run brew upgrade claude-code.
  • Installed with npm: run npm install -g @anthropic-ai/claude-code@latest again.

06Keep it running on a remote Mac

  • Run Claude Code inside a tmux session. It keeps working after you close the window or disconnect, and you can reattach next time you connect. For details, see the guide “How to keep an AI agent running 24/7 on a Mac”.
  • To use it in a script or a scheduled job, add the -p flag: claude -p "your prompt". It does the task once and exits, without opening the interactive screen.

07How it differs from Codex

Codex is a coding agent made by OpenAI. It also runs in Terminal and can read code, edit code and run commands. The two work in a very similar way; the main differences are the models behind them and whose account you need:

Based on both companies’ official docs as of December 2026. Plan coverage changes quickly, so check the official sources.
Claude CodeCodex
Made byAnthropicOpenAI
AccountClaude Pro / Max / Ultra / Team / Enterprise, or Console APIChatGPT account (see the OpenAI Help Center for which plans work), or an OpenAI API key
Runs inTerminalTerminal

The official install command for Codex:

curl -fsSL https://chatgpt.com/codex/install.sh | sh

Start with whichever one you already pay for. You can install both on the same Mac without them getting in each other’s way. Try each on the same project and see which suits you better.