How to Install Claude Code CLI (2026 Complete Guide)

Author Avatar
Andrew
AI Perks Team
13,744•
How to Install Claude Code CLI (2026 Complete Guide)

Quick Summary: Claude Code CLI is installed via a single command that downloads and configures the tool automatically. On macOS and Linux, use the official shell script from Anthropic’s docs, while Windows users run PowerShell or WSL commands. After installation, authenticate with your API key to start using Claude’s AI coding assistant in your terminal.

Claude Code is an agentic coding tool that lives in your terminal and understands your entire codebase. According to the official Claude Code documentation, it can read files, execute commands, edit code, and integrate with development tools through natural language conversations.

But getting started requires proper installation. Here’s everything needed to install Claude Code CLI and configure it correctly.

System Requirements Before Installation

Before installing Claude Code, verify the system meets basic requirements. According to the official Advanced setup documentation, remove this sentence entirely.

Check Node.js installation by opening a terminal and running:

node –version

If Node.js isn’t installed or the version is below 18, download it from the official Node.js website. The Long-Term Support (LTS) version works perfectly for Claude Code.

Beyond Node.js, the system needs basic requirements: macOS 13.0 or higher for Mac users, Windows 10 or higher for Windows systems, and most modern Linux distributions work without issues. A Claude account from Anthropic is also required for authentication after installation.

Installing Claude Code on macOS and Linux

The installation process for macOS and Linux uses a single shell command that handles everything automatically. This method is documented in the official Claude Code quickstart guide.

Open Terminal and run the installation script:

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

The script downloads the Claude Code binary, places it in the correct directory, and configures the PATH automatically. The entire process typically completes in under a minute.

For macOS users who prefer Homebrew, an alternative installation method exists though it’s not officially documented in the primary sources. The curl method remains the recommended approach according to official documentation.

Verifying the Installation

After installation completes, verify Claude Code is accessible:

claude –version

This command should display the installed version number. If an error appears stating “command not found”, the PATH configuration needs adjustment.

According to the official troubleshooting documentation, PATH issues are the most common installation problem. The fix involves adding Claude’s installation directory to the shell configuration file.

Installing Claude Code on macOS and Linux

The installation process for macOS and Linux relies on npm (Node Package Manager). According to the official documentation, you must have Node.js 18+ installed on your system before proceeding. Unlike traditional CLI tools that use shell scripts, Claude Code is installed globally via your terminal to ensure all dependencies are handled correctly.

Open your Terminal and run the following command to install the package:

export CLAUDE_CODE_RELEASE_ALPHA=1 && npm install -g @anthropic-ai/claude-code

Note: The environment variable CLAUDE_CODE_RELEASE_ALPHA=1 is currently required during the public beta/alpha phase to acknowledge the preview status of the tool.

This command downloads the package from the official npm registry and links the claude executable to your system’s global bin directory. While some users may attempt to find Homebrew formulas, the npm method is the only officially supported and documented installation path.

Verifying the Installation

After the installation completes, verify that the CLI is correctly mapped to your environment by running:

claude –version

This command should display the current version number (e.g., 0.2.9). If you encounter a “command not found” error, it typically means your global npm directory is not in your system’s PATH.

According to the official troubleshooting documentation, you can fix this by identifying your npm prefix with npm config get prefix and ensuring the resulting /bin folder is added to your .zshrc or .bashrc file.

The four-step automated installation process for macOS and Linux systems

Installing Claude Code on Windows

Windows installation offers two main approaches: native PowerShell installation or using Windows Subsystem for Linux (WSL). The official documentation recommends PowerShell for most users.

PowerShell Installation Method

Open PowerShell as Administrator (right-click the Start menu and select “Windows PowerShell (Admin)”). Run this command:

irm claude.ai/install.ps1 | iex

The PowerShell script handles the download, installation, and PATH configuration automatically. After completion, close and reopen PowerShell to ensure the PATH updates take effect.

WSL Installation Method

Developers already using WSL can install Claude Code using the Linux method. Open the WSL terminal and run the same curl command used for Linux:

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

The WSL approach works identically to native Linux installations. One advantage: WSL provides a more Unix-like environment that matches production server configurations.

According to the official troubleshooting documentation, WSL users occasionally encounter network connectivity issues. If installation hangs, verify that WSL can access external networks and that firewall rules aren’t blocking traffic.

Find Claude and AI Tool Credits in One Place

Installing Claude Code CLI is one step. Paying for AI tools long term is another. Get AI Perks collects startup credits and software discounts for AI and cloud tools in one place. It gives founders access to 200+ perks, including offers from Anthropic, Claude, OpenAI, Gemini, ElevenLabs, Intercom, and others. The platform also shows perk conditions and guides for claiming each offer.

Looking for Claude or Anthropic Credits?

Check Get AI Perks to:

  • find AI tool credits and discounts in one place
  • review perk conditions before applying
  • access guides for claiming startup offers

👉 Visit Get AI Perks to browse available Claude, Anthropic, and other AI software perks.

Authentication and Initial Configuration

After installation, Claude Code requires authentication before it can function. The tool uses API keys from Anthropic to verify access.

Start the authentication process by running:

claude

The first time this command runs, Claude Code prompts for authentication. According to the official quickstart guide, this opens a browser window to log in to the Anthropic account.

After logging in through the browser, the CLI receives an authentication token automatically. This token is stored locally and persists across sessions, so repeated authentication isn’t necessary.

Configuring Project-Level Settings

Claude Code supports configuration at multiple levels according to the official settings documentation. The most common configuration levels are:

ScopeLocationUse Case
User~/.claude/ directoryPersonal preferences across all projects
Project.claude/ in repositoryShared team configuration
Local.claude/settings.local.jsonMachine-specific overrides

For first-time setup, the user-level configuration is sufficient. Project-level settings become important when working with teams that share coding standards.

Starting Your First Claude Code Session

With installation and authentication complete, launch Claude Code by running the command without arguments:

claude

This starts interactive mode where Claude responds to natural language requests. The official documentation describes interactive mode as the primary way to use Claude Code for development tasks.

Try a simple test command:

Show me the structure of this project

Claude Code analyzes the current directory and provides an overview of the codebase structure. This demonstrates that the installation is working correctly and Claude has access to read files.

Essential Commands for Daily Use

Beyond interactive mode, Claude Code supports several command patterns documented in the CLI reference:

Command PatternPurposeExample
claudeStart interactive sessionclaude
claude “task”Run one-time taskclaude “fix the linting errors”
claude -p “query”Quick query without sessionclaude -p “what does this function do”

The one-time task pattern is particularly useful for CI/CD pipelines and automation scripts where an interactive session isn’t appropriate.

Common Installation Troubleshooting

Even with automated installation scripts, issues occasionally occur. The official troubleshooting documentation covers the most frequent problems.

Command Not Found Errors

If the terminal displays “command not found: claude” after installation, the PATH configuration didn’t complete correctly. For macOS and Linux, add Claude’s binary location to the shell configuration file manually.

For bash users, edit ~/.bashrc or ~/.bash_profile and add:

export PATH=”$HOME/.local/bin:$PATH”

For zsh users (default on modern macOS), edit ~/.zshrc with the same line. After saving, reload the configuration with source ~/.zshrc or open a new terminal window.

Network and Firewall Issues

Corporate networks and restrictive firewalls sometimes block the installation script. According to the troubleshooting documentation, if the installation hangs or returns HTML instead of executing, network access to Anthropic’s servers may be blocked.

The workaround involves downloading the install script separately:

curl -fsSL code.anthropic.com/install.sh -o install.sh
chmod +x install.sh
./install.sh

This approach provides more visibility into what’s failing if errors occur during download or execution.

WSL-Specific Problems

Windows users running WSL sometimes encounter connectivity problems between the Linux subsystem and Windows. The official documentation mentions that firewall rules may need adjustment to allow WSL traffic.

If Claude Code installs successfully but can’t reach Anthropic’s servers for authentication, check that the Windows firewall allows WSL network access. The troubleshooting guide provides specific PowerShell commands for configuring firewall rules.

Updating Claude Code

Claude Code receives regular updates with new features and improvements. According to the official documentation, updates are installed using the same command as initial installation.

Run the install script again:

curl -fsSL code.anthropic.com/install.sh | sh

The script detects the existing installation and upgrades it to the latest version. No configuration or authentication is lost during the update process.

Check the current version before and after updating:

claude –version

The changelog in the official Claude Code documentation lists all changes between versions, which helps determine if an update introduces features relevant to specific workflows.

Next Steps After Installation

With Claude Code installed and working, exploration of advanced features becomes possible. The official documentation describes several areas worth investigating:

  • Skills and customization: According to the official skills documentation, Claude Code supports custom skills defined in Markdown files within the .claude/skills/ directory. These skills extend Claude’s capabilities with project-specific commands and workflows.
  • Model Context Protocol (MCP): The MCP integration allows Claude Code to connect with external tools and services. This turns Claude into a hub that can access databases, APIs, and other development resources.
  • Team collaboration: Project-level configuration files in the .claude/ directory can be committed to version control, sharing Claude Code settings across entire development teams.
  • The official documentation provides detailed guides for each of these areas, building on the basic installation covered here.

Frequently Asked Questions

Do I need a paid Claude subscription to use Claude Code CLI?

Claude Code requires a Claude account from Anthropic, but the specific subscription tier needed depends on usage. According to official documentation, authentication is necessary but pricing details should be verified on Anthropic’s official website as plans change over time.

Can I install Claude Code without administrator privileges?

On macOS and Linux, Claude Code installs to the user’s home directory by default and doesn’t require administrator access. Windows users may need administrator privileges for the PowerShell installation method, though WSL installations don’t require admin access.

Does Claude Code work offline?

No. Claude Code is an AI-powered tool that communicates with Anthropic’s servers to process requests. According to the official documentation, an active internet connection is required for Claude to analyze code and generate responses.

How do I uninstall Claude Code?

The official Advanced setup documentation explains that uninstallation involves removing the binary and configuration files. On macOS and Linux, delete the ~/.claude directory and remove the PATH modification from shell configuration files. Windows users should remove the installation directory and clear the PATH environment variable.

Can Claude Code access my entire filesystem?

By default, Claude Code operates within the current working directory and its subdirectories. According to the official permissions documentation, access can be restricted further using sandbox settings in the configuration files. Claude always asks for confirmation before executing potentially destructive operations.

What’s the difference between Claude Code CLI and Claude Desktop?

Claude Code CLI runs in the terminal and focuses on development workflows with direct file system access and command execution. Claude Desktop is a standalone application with a graphical interface. Both tools serve different use cases, with the CLI optimized for developers who prefer terminal-based workflows.

How often should I update Claude Code?

Updates can be installed whenever convenient. The official changelog documents new features and bug fixes. For teams, coordinating updates ensures everyone uses compatible versions, though Claude Code maintains backward compatibility with configuration files across versions.

Conclusion

Installing Claude Code CLI takes just a few minutes regardless of operating system. The automated installation scripts handle configuration, PATH setup, and binary placement without manual intervention.

After installation and authentication, Claude Code becomes a powerful AI coding assistant accessible from any terminal. Natural language commands let developers write code, fix bugs, and automate tasks without leaving the command line.

Ready to experience AI-assisted development? Run the installation command for your platform and start your first Claude Code session today. The official documentation at code.claude.com provides comprehensive guides for advanced features once basic setup is complete.

AI Perks

AI Perks tarjoaa pääsyn eksklusiivisiin alennuksiin, krediitteihin ja tarjouksiin AI-työkaluissa, pilvipalveluissa ja API-rajapinnoissa auttaakseen startup-yrityksiä ja kehittäjiä säästämään rahaa.

AI Perks Cards

This content is for informational purposes only and may contain inaccuracies. Credit programs, amounts, and eligibility requirements change frequently. Always verify details directly with the provider.