Most setup guides make the Claude Code CLI install look more complicated than it is. I’ve done this across Mac, Windows, and Linux machines, and the truth is: if you have an Anthropic account with the right subscription tier, you’re usually running Claude in your terminal within five minutes.
The one thing that actually slows people down is the account requirement. Claude Code requires a Pro, Max, Teams, Enterprise, or Console account. The standard free plan for Claude.ai doesn’t include CLI access. Sort that out at console.anthropic.com before running any install commands, and the rest of the process will be clean and fast.
This guide walks through every platform, Mac, Linux, and Windows, using the native installer that Anthropic now recommends. The old npm method still technically works, but it is deprecated, and I’ll explain why you should avoid it.
[IMAGE: claude code cli install terminal command running step by step 2026]
What Claude Code CLI Actually Is
The Claude Code CLI is a terminal-based tool that lets you work with Claude AI directly inside your development environment. It’s not a chatbot window in a browser; it runs in your terminal, reads your actual project files, and can take multi-step actions across your codebase.
You give it a task “write unit tests for this module,” “refactor this file to use async/await,” “explain what this function does,” and it works through the steps itself. It’s designed around the idea that you describe what you want done, not how to do each step.
That’s what makes the CLI format important. It integrates with how developers already work. You’re in the terminal, in your project. Claude Code is just another tool in that environment.
System Requirements Before the Claude Code CLI Install
Claude Code CLI runs on the following operating systems:
| Platform | Minimum Version | Shell Support |
|---|---|---|
| macOS | 13.0 (Ventura) | Bash, Zsh |
| Windows | 10 version 1809+ | PowerShell, CMD, Git Bash |
| Ubuntu | 20.04+ | Bash, Zsh |
| Debian | 10+ | Bash, Zsh |
| Alpine Linux | 3.19+ | Bash |
You also need at least 4 GB of RAM and a working internet connection. On Windows, Git for Windows is required. Claude Code uses Git Bash internally, even when you launch it from PowerShell or CMD. If you’re on Windows and don’t have Git for Windows installed, grab it from git-scm.com first.
Hardware requirements are light. If your machine runs a modern browser without struggling, it’ll run Claude Code CLI without issues.
How to Complete the Claude Code CLI Install
The native installer is the right way to do this. Anthropic marked the npm package (npm install -g @anthropic-ai/claude-code) as deprecated. The native binary installs faster, doesn’t require Node.js, and updates itself automatically in the background.
Anthropic Claude Code CLI Install on Mac and Linux
If you’re on macOS or a supported Linux distro, setup is pretty simple it comes down to one curl command. Just open your terminal and run:
curl -fsSL https://claude.ai/install.sh | bash
This will download the binary, install it to ~/.local/bin/claude, and configure your PATH for you. Once it’s done, open a new terminal session and run claude –version to make sure everything installed correctly.
If you prefer using Homebrew on macOS, that’s an option as well:
brew install --cask claude-code
The main difference is updates. Homebrew won’t update it automatically you’ll need to run brew upgrade claude-code from time to time. The native installer, on the other hand, handles updates quietly in the background, which is why I usually stick with it on a new machine.
For the anthropic Claude code CLI install to succeed specifically on Alpine Linux, you’ll need to install libgcc, libstdc++, and ripgrep via apk first, then set USE_BUILTIN_RIPGREP=0 in your settings file. Every other Linux distribution runs the curl command directly with no extra steps..
[IMAGE: claude code cli install running authentication setup in terminal]
Claude Code CLI Install on Windows
Windows has three install paths. The simplest is PowerShell:
irm https://claude.ai/install.ps1 | iex
You do not need to run PowerShell as Administrator. If you’re on CMD rather than PowerShell, this version works instead:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
The third option is WinGet, which is Microsoft’s built-in package manager on Windows 10 and later:
winget install Anthropic.ClaudeCode
WinGet works well, but like Homebrew, it doesn’t auto-update. Run winget upgrade Anthropic.ClaudeCode, when you want the latest version.
One practical note for Windows users: if Claude Code can’t find your Git Bash installation after the install, you can manually point it to the correct path. Add this to your settings.json file:
{ "env": { "CLAUDE_CODE_GIT_BASH_PATH": "C:\Program Files\Git\bin\bash.exe" } }
Adjust the path if you installed Git for Windows in a non-standard location.
Logging In After the Install
The CLI install puts the binary on your machine. Authentication is a separate step that happens when you first run Claude.
Type claude in your terminal from any project directory. It opens a browser prompt and asks you to log in with your Anthropic account. Use the account with your paid subscription; the free plan will give you an error here, not a working session.
After you authenticate, Claude Code stores a local session token. You won’t be prompted again on subsequent sessions unless your token expires or you log out manually.
If you’re working on a headless server or a remote machine without browser access, Claude Code handles it pretty smoothly. It gives you a URL that you can open on another device to complete the login.
Once you’re done, the session carries over back to your terminal automatically.
Keeping the CLI Updated
Native installs auto-update silently. Claude Code checks for updates on startup and downloads them in the background. The new version takes effect the next time you open a session, no commands needed, no interruptions.
{
"autoUpdatesChannel": "stable"
}
To stay on a more stable release, set the update channel in your settings:
This channel trails the latest version by about a week and is ideal for maintaining consistency across teams.
To update immediately, run:
claude update
Getting Real Value Out of Your Claude Code CLI Install
Once you’ve installed the Claude Code CLI and logged in, one habit makes a big difference always launch it from your project root. Claude uses that directory to understand your codebase and without it, the responses can feel pretty generic.
For your first real session, start with a project you already know well. Ask something you can verify easily, like “What does this function return?” or “Where is this variable used?” That way, you can judge how accurate the output is before relying on it for more important tasks.
The Claude Code CLI becomes more useful the more you work with it. There’s no steep learning curve it’s mostly about learning how to phrase your tasks clearly. Start simple, review the results, and build trust gradually. That approach tends to work best.
Frequently Asked Questions
How to Install Claude Code CLI
To install the Claude Code CLI, use the native installer for your operating system.
On macOS and Linux, open your terminal and run:
curl -fsSL https://claude.ai/install.sh | bash
On Windows, open PowerShell and run:
irm https://claude.ai/install.ps1 | iex
Both methods install the binary directly no need for Node.js or npm. Once the installation is complete, run:
claude --version
to confirm everything is working.Then navigate to your project folder and run claude to start your first session.
You’ll need to sign in with an Anthropic Pro, Max, Teams, Enterprise, or Console account, since the free plan doesn’t include CLI access.
The full installation process usually takes less than five minutes from start to your first working session on a supported system.
