Claude Code CLI installation: complete setup guide for Mac, Windows, and Linux (2026)

AI tools Updated 5 min read

Install Claude Code on Mac, Windows and Linux with the official commands: native installer, Homebrew, WinGet and npm, plus the login and first-run setup steps.

By Khubaib Riasat
Founder and CEO, AmazeTech

On this page
  1. What is Claude Code CLI? (Before you install)
  2. Prerequisites before installing Claude Code CLI
  3. Method 1: native installer (recommended)
  4. Method 2: install via Homebrew (macOS)
  5. Method 3: install via npm (cross-platform)
  6. Method 4: install in WSL (Windows)
  7. Method 5: install via winget (Windows)
  8. Post-installation setup
  9. Connecting Claude Code CLI to VS Code or Cursor
  10. How to update Claude Code CLI
  11. Troubleshooting common installation issues
  12. FAQs

What is Claude Code CLI? (Before you install)

Claude Code CLI by Anthropic is a terminal-based AI coding assistant that works directly inside your development environment. Instead of switching between browser tabs, you can run commands, edit files, debug code, and manage projects using natural language inside your terminal.

It is widely used in 2026 because it:

  • Reads your full codebase
  • Edits multiple files at once
  • Executes terminal commands
  • Integrates with Git workflows
  • Works across macOS, Windows, and Linux

If you are planning a Claude code CLI installation, this guide walks you through every method in a simple way.

Prerequisites before installing Claude Code CLI

Prerequisites before installing Claude Code CLI: Node.js, npm or npx, an Anthropic account and terminal access

Before starting your Claude code CLI setup, make sure you have:

Claude subscription

You need access to Claude via:

  • Pro plan
  • Max plan
  • Teams or Enterprise

Alternatively, use a Claude Console account (API billing), or a provider such as Amazon Bedrock, Google Cloud or Microsoft Foundry.

Terminal access

You need a working terminal:

  • macOS Terminal
  • Linux Shell
  • Windows PowerShell or Command Prompt
  • Or Windows Subsystem for Linux (WSL)

Node.js (only for npm method)

If you plan to install using npm:

  • Install Node.js
  • Make sure npm is working

This is the easiest and most reliable way for Claude’s code CLI installation.

MacOS and Linux installation

  • Open your terminal
  • Run the official install script using curl
  • The script automatically installs Claude Code and sets up your system

This method is preferred because:

  • It includes auto-updates
  • It configures your environment automatically
  • It avoids dependency issues

Windows installation (PowerShell)

  • Open PowerShell
  • Run the official installer command
  • Follow the on-screen prompts

Windows command prompt alternative

  • You can also install using the Command Prompt
  • The process is similar, but may require manual steps for PATH setup

Why native installer is best

Compared to npm or other methods:

  • Faster setup
  • Fewer errors
  • Built-in updates
  • Better compatibility

For most users, this is the best way to install Claude Code CLI.

Method 2: install via Homebrew (macOS)

If you use Homebrew:

  • Install Claude Code using the Homebrew cask
  • Wait for the installation to complete
  • Verify installation in the terminal

This method is clean and integrates well with macOS systems.

Method 3: install via npm (cross-platform)

This method is useful for developers.

Steps:

  • Install Node.js
  • Use npm to install the Claude Code package globally
  • Verify installation

Use this if:

  • You prefer package managers
  • You manage multiple dev tools via npm

Method 4: install in WSL (Windows)

Claude Code runs natively on Windows or inside WSL. Choose WSL 2 if your projects use Linux toolchains or you want sandboxed command execution, which native Windows does not support.

Step 1: install WSL

  • Enable Windows Subsystem for Linux
  • Install Ubuntu

Step 2: update packages

  • Open the Ubuntu terminal
  • Update system packages

Step 3: install Claude Code

  • Run the native installer inside WSL

Step 4: configure PATH

  • Ensure Claude’s command is accessible globally

WSL is recommended because:

  • Better compatibility
  • Fewer permission issues
  • Closer to a Linux/macOS environment

Method 5: install via winget (Windows)

You can also use Windows Package Manager:

  • Open PowerShell
  • Install Claude Code using winget
  • Verify installation

WinGet installs do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically.

Post-installation setup

After completing your Claude code CLI installation, follow these steps:

Verify installation

  • Run the version check command
  • Confirm that Claude CLI is installed correctly

First launch and authentication

When you run Claude for the first time:

  • A browser window opens
  • You log in to your account
  • Authentication completes automatically

Choose authentication method

You can use:

  • Subscription login (Pro, Max, Teams)
  • API key from Anthropic

Initialize your project

Run `/init` inside Claude Code to:

  • Create a CLAUDE.md file
  • Store project context
  • Enable better AI responses

Connecting Claude Code CLI to VS Code or Cursor

Connecting Claude Code CLI to VS Code or Cursor

Claude works well with:

  • VS Code
  • Cursor IDE

Benefits:

  • Edit files directly
  • Use AI inside your coding workflow
  • Faster development cycles

How to update Claude Code CLI

If you used the native installer:

  • Updates happen automatically

If using npm:

  • Update manually using npm

Keeping your CLI updated ensures:

  • Better performance
  • New features
  • Bug fixes

Troubleshooting common installation issues

Common Claude Code CLI installation errors, each resolved

“Claude not found” error

  • Your PATH is not set correctly
  • Restart the terminal or update the PATH manually

Permission denied errors

  • Run the terminal with proper permissions
  • Fix file access settings

WSL issues

  • Reconfigure PATH
  • Restart the WSL environment

Authentication problems

  • Log out and log back in
  • Clear the session and retry

Final thoughts

Setting up claude code CLI installation is straightforward if you follow the right method. For most users, the native installer is the best choice due to simplicity and reliability.

Once installed, Claude Code CLI becomes a powerful development tool that:

  • Saves time
  • Automates coding tasks
  • Improves workflow efficiency

FAQs

  1. How to install Claude Code CLI quickly?
    Use the native installer with a curl command for the fastest setup.
  2. Can I install Claude Code CLI on Windows?
    Yes. Install natively from PowerShell or Command Prompt, with WinGet, or inside WSL.
  3. Do I need Node.js for Claude Code CLI installation?
    Only if you choose the npm install method.
  4. How do I fix “Claude command not found”?
    Update your PATH environment variable and restart the terminal.
  5. Is Claude Code CLI free to use?
    It requires a Pro, Max, Ultra, Team or Enterprise plan, or a Claude Console account. The Free plan does not include Claude Code.

Ready to turn ideas into real growth? Partner with AmazeTech and let data-driven strategy, AI-powered execution, and proven marketing systems work for your business. Reach out today and start scaling smarter.

Read enough? Get a plan for your site.

Free website growth audit. We check your site speed, your Google Business Profile and how calls and forms are tracked, then email you what to fix first. You approve a written plan before work starts.

Book a Growth Call

Certified partners and accreditation

  • Google PartnerGoogle Ads
  • Meta PartnerFacebook and Instagram
  • HubSpot PartnerSolutions Partner
  • Shopify PartnerStores and themes
  • BBB Accredited Business
Free website growth audit

Get your free website growth audit.

Send us your website. A strategist scores it out of 100 on speed, Google Maps, search and lead tracking, then emails you the three fixes that would bring the most calls and bookings. Within 48 hours.

Enter your website, like yourbusiness.com.
Enter a work email so we can send the audit.
Free. No call needed, no newsletter.