How to install Claude Code (Windows, Mac, Linux): login, pricing, and the free-plan trap
Step by step for installing Claude Code on Windows, Mac, and Linux, signing in with the right account, understanding pricing, and confirming with claude doctor.
- how to install claude code
- install claude code windows

Contents
Installing Claude Code stays easy when you run one command at a time, in the right terminal. Plenty of people mix two methods in one afternoon and end up unsure which one worked. This guide takes the other road, calm and in order.
You will see what to check before starting, which command matches your system, how to sign in with the right account, and how to confirm everything is ready. If the overview map sent you here, return to it anytime at Claude Code from zero. The commands, memory requirements, login options, and diagnostics are in the official quickstart guide.
What to check before installing
Check memory first, because it sets how pleasant the tool feels. Minimum 4GB of RAM, recommended 8GB, per the official quickstart guide. On a machine sitting exactly at the minimum, close heavy apps during the install to avoid slowness.
Check Node only if you plan to install through npm. The rule is Node 22 or newer, also in the official quickstart guide. Run the command below to see the current version before picking a method.
node --versionOn Windows, check the terminal and Git before running anything. Native Windows wants Git for Windows installed plus PowerShell for the main method, with details in the official quickstart guide. On Mac and Linux the stock terminal does the job, with WSL covering Linux inside Windows.
Which command fits your system
Pick one method and stay with it to the end. Mixing curl with npm or winget with npm in one attempt creates two failure points and muddies the diagnosis. Every path below is listed in the official quickstart guide.
| System | Command | Note |
|---|---|---|
| macOS, Linux, or WSL | curl -fsSL https://claude.ai/install.sh | bash | Native Unix-terminal path, run once, then open a new terminal |
| Windows in PowerShell | irm https://claude.ai/install.ps1 | iex | Run in PowerShell, not in CMD |
| macOS with Homebrew | brew install --cask claude-code | For existing brew users, upgrades are manual |
| Windows with winget | winget install Anthropic.ClaudeCode | For existing winget users, upgrades are manual |
| Any system with Node 22 or newer | npm install -g @anthropic-ai/claude-code | Requires node --version at 22 or higher first |
That table compresses the decision into one read. On Windows, start with irm or winget. On Mac, start with curl or brew. On Linux or WSL, use curl. Keep npm as plan B for when you already maintain Node.
Most install failures are mixing failures, not command failures. One channel per attempt plus the right plan before blaming the terminal fixes nearly everything. The rest is opening a fresh terminal.
How to install on Windows without tripping on the terminal
Use PowerShell for the main Windows method. The official command pipes irm into iex, and that flow belongs to PowerShell, per the official quickstart guide. Open PowerShell, paste one command, and wait for it to finish before closing the window.
irm https://claude.ai/install.ps1 | iexRun irm in PowerShell step by step
Open Start, type PowerShell, and open Windows PowerShell. Paste the irm command exactly as shown above and press Enter. Wait for the progress bar to finish, then open a new terminal before testing, because the system path only refreshes in the new session.
The CMD-versus-PowerShell gotcha
CMD and PowerShell look alike and run different commands. The irm pipe into iex does not work in CMD, so pasting it there errors out immediately. The fix is simple. Close CMD, open PowerShell, and run again through one channel.
The other common trap is the execution policy blocking scripts in PowerShell. On a blocked-script warning, open a normal PowerShell, confirm you copied the full command, and retry before changing settings. Note the exact error message, because it tells whether the problem is the command, the network, or permissions.
Install Git for Windows and commit to one channel
Install Git for Windows on native Windows, because it guarantees Git plus a more predictable place to open projects. Verify with the command below in a fresh terminal after installing.
git --versionUse winget as the tidy alternative if you already install software through it. Install and upgrade look like this, with the full channel list in the official quickstart guide.
winget install Anthropic.ClaudeCode
winget upgrade Anthropic.ClaudeCodeHow to install on Mac and Linux
Use curl as the default path on Mac, Linux, and WSL. It downloads the official script and runs it straight through, with no Node or extra manager involved. The exact command is in the official quickstart guide.
curl -fsSL https://claude.ai/install.sh | bashRun curl, then open a new terminal
Copy the curl command into the terminal, press Enter, and wait for the end. Close the terminal and open another before testing, because the old session cannot see the new path. That fresh-terminal step resolves a good share of command-not-found cases.
Use brew cask on Mac, with manual upgrades
Reach for brew only if you already keep Homebrew current on Mac. Installation uses a cask, and upgrades stay manual when a new version ships, per the official quickstart guide.
brew install --cask claude-code
brew upgrade --cask claude-codeUse npm once Node 22 is ready
Use npm when you already tend Node and prefer managing the tool alongside other global packages. The condition is blunt, Node 22 or newer before installing, with the requirement documented in the official quickstart guide. The native-channel versus npm comparison, with each side's trade-offs, sits in the getting-started guide, published Apr 8, 2026.
node --version
npm install -g @anthropic-ai/claude-codeHow to sign in and make sense of pricing
Sign in with an account that carries usage rights. The options are Pro, Max, Team, or Enterprise subscriptions, or Console and Bedrock access for company and cloud setups, per the official quickstart guide. The flow opens a browser to confirm the account, so finish that browser step and return to the terminal.
The most common failure is signing in on the free plan. Free leaves out Claude Code, so a block there signals no install failure, per the roundup published Jul 14, 2026 in the guide to what Claude Code is. If the message mentions plan or permission, check which account is signed in before reinstalling.
Match the account to your setting to avoid mid-day switches. Pro or Max for solo use, Team or Enterprise for teams, Console or Bedrock for company integrations and cloud. After switching machines or an expired session, sign in again and run the next section's diagnostic.
How to confirm it worked and open it in the right place
Confirm with two commands in a fresh terminal. The first prints the installed version, the second checks the environment and names what is missing, both documented in the official quickstart guide and the getting-started guide from Apr 8, 2026.
claude --version
claude doctorAlways open inside the project folder, never home. Move there with cd first, because opening in the wrong place widens the agent's reach for no reason. The pattern below holds on every system.
cd path/to/your/project
claudeIf the terminal says the command is missing, close it, open another, and repeat the test. If the error persists, check which method you used and repeat the install through one channel only, without alternating curl, brew, winget, and npm. Noting the method makes asking for help much easier.
To turn this install into guided practice, take the cluster's next step: first-30-minutes walkthrough.
Frequently asked questions
Does the free plan include Claude Code?
It does not. Access requires Pro, Max, Team, Enterprise, Console, or Bedrock, per the roundup published Jul 14, 2026 in the guide to what Claude Code is. On the free plan with a block, the correct move is upgrading to an entitled plan or using company access, not reinstalling.
Do I need Node 22 to install?
Only if you pick the npm channel. The curl, irm, brew cask, and winget channels ask nothing of Node, per the official quickstart guide. If node --version prints below 22, upgrade Node or switch to your system's native channel.
Native channel or npm, what changes?
The native channel uses the system installer and follows each platform's standard flow. Npm installs a global package and suits people who already keep Node current. That native-versus-npm comparison sits in the getting-started guide from Apr 8, 2026. When in doubt, take the native channel and keep npm as plan B.
The terminal says claude is missing. What now?
Close the terminal and open another before anything else, because the new path only shows up in the fresh session. Then run claude --version and claude doctor to confirm, both covered in the official quickstart guide and the getting-started guide from Apr 8, 2026. If the error stays, reinstall through one channel and note the exact message.
Conclusion
A calm install comes down to three decisions in order. Pick your system's channel, sign in with an entitled account, and confirm with version plus diagnostics inside the project folder. That order dodges method mixing, the free-plan trap, and opening in the wrong folder.
Continue with the guided drill in first-30-minutes walkthrough. Then lock safety in CLAUDE.md and safe permissions.
Sources
Read next
Motion •
Motion Design for the Web: The Complete Guide
Scroll, text, images and video: the complete catalog of motion techniques for the web, with implementation in Next.js and the cases where each one pays off.
- motion
- scroll
The definitive guide — a Next.js site built around motion and scroll
The scroll foundation that, when missing, keeps the animations from working at all: Lenis, GSAP and Next.js wired in the right order and the mistakes to avoid.
- next.js
- lenis
Infra •
Documentation: deploying a Next.js application with GitHub + Hostinger
Every push becomes a live site with no hosting panel involved: connecting GitHub to Hostinger, the build settings that break and the checks after each deploy.
- deploy
- github


