Home

Install Claude Code on Mac

Claude Code is an AI assistant that lives in your Terminal and helps you write, debug, and understand code. Think of it as having a knowledgeable coding partner available whenever you need help. Whether you’re a complete beginner or an experienced developer, Claude Code can accelerate your workflow and help you learn.

This guide walks you through installation step by step, with detailed instructions for beginners.

Overview

Key Concepts

What You’ll Need

Step 1: Download Node.js

Claude Code requires Node.js version 18 or higher.

First, check if Node.js is already installed:

To download Node.js:

Step 2: Install Node.js

Step 3: Verify Node.js Installation

If you see “command not found”:

Tip: Keep Terminal open for the next steps.

Step 4: Install Claude Code

Step 5: Connect to Your Anthropic Account

Option A. Use your Claude Pro or Max subscription

Option B. Use Anthropic API key

If you have an Anthropic API key instead of a Claude subscription:

Note: If you’re using an older Mac with bash instead of zsh, replace ~/.zshrc with ~/.bash_profile in the command above.

Option C. Use Anthropic API via Azure Foundry

This option is for organizations using Azure-hosted Claude models. In the Terminal window, paste this code to define environment variables (before starting Claude):

# Enable Microsoft Foundry integration
export CLAUDE_CODE_USE_FOUNDRY=1
# Azure resource name
export ANTHROPIC_FOUNDRY_RESOURCE=xxxx-eastus2
# Set models to your resource's deployment names
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-5
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-5
export ANTHROPIC_FOUNDRY_API_KEY=your_api_key

Note: Replace xxxx-eastus2 with your Foundry Resource name (do not use the entire base URL). Replace your_api_key with your complete API key from your Azure portal.

Step 6: Start Using Claude Code

You’re all set! Here’s how to use Claude Code:

Step 7: Navigate to Your Project

Note: Claude operates inside a project folder. It define writing permissions in the folder and saves settings in that folder. It’s Claude’s workspace.

Next Steps

How to Open Terminal Again

After closing Terminal, here’s how to open it again:

Troubleshooting

Node.js installer won’t open

“node: command not found” after installation

npm installation fails with permission errors

Claude Code commands not found

“Cannot find module” errors

Tips for Mac Users

Finding Project Paths

To find the path to a folder:

Using Different Terminal Apps

You can also use other terminal apps like:

Claude Code works with all of them!

Need Help?


Last updated: December 2025