Installing Claude Code

Claude Code is a terminal-based AI coding assistant made by Anthropic. It requires Node.js (a software platform) to run.

Step 1: Install Node.js

Windows:

  1. Go to https://nodejs.org/
  2. Download the LTS (Long Term Support) version
  3. Open the downloaded file and follow the installer prompts
  4. Accept all default settings

Mac:

  1. Go to https://nodejs.org/
  2. Download the LTS version
  3. Open the downloaded .pkg file and follow the installer prompts

To verify, open a terminal and type node --version. You should see a version number (18 or higher).

Step 2: Install Claude Code

Open a terminal (Mac: Terminal app; Windows: Command Prompt or PowerShell) and type:

npm install -g @anthropic-ai/claude-code

This downloads and installs Claude Code globally on your computer.

Step 3: Set Up Your Account

  1. In the terminal, type claude to launch Claude Code
  2. Follow the on-screen prompts to sign in with your Anthropic account
  3. If you do not have an Anthropic account, create one at https://console.anthropic.com/
  4. Claude Code uses the Anthropic API, which requires a payment method on your account. Usage is billed per conversation. Check https://www.anthropic.com/pricing for current rates. Your instructor may provide API access for class use.

Step 4: Verify It Works

Navigate to any project folder in your terminal and type claude. You should see a prompt where you can type natural language instructions. Try typing: “What files are in this directory?” Claude Code will respond with a list of files.

Troubleshooting

  • “npm: command not found”: Node.js is not installed correctly. Reinstall Node.js and make sure to check “Add to PATH” during installation (Windows) or restart your terminal (Mac).
  • Permission errors on Mac: The recommended fix is to install Node.js using a version manager like nvm (https://github.com/nvm-sh/nvm), which avoids permission issues entirely. As a last resort, you can try sudo npm install -g @anthropic-ai/claude-code, but this may cause permission problems with future npm operations.
  • Claude Code does not start: Ensure you have an active internet connection and a valid Anthropic account.

For the most up-to-date installation instructions, visit https://github.com/anthropics/claude-code.