To install Claude Code, open a terminal and run Anthropic's one-line install script: there is one command for macOS, Linux and WSL, and one for Windows, both shown below. Then go to your project folder, type claude, and log in with a paid Claude plan (Pro, Max, Team or Enterprise) or a Claude Console account. The free Claude plan does not include Claude Code. This guide walks through every step, as of October 2026, using Anthropic's own documentation.
What is Claude Code?
Claude Code is Anthropic's AI coding tool. Anthropic describes it as "an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools."
In plain words: you describe a task, and Claude Code finds the right files, writes the change, runs commands, and shows you what it did. It works in several places:
| Where | What it is |
|---|---|
| Terminal (CLI) | The full-featured version. This guide focuses on it. |
| VS Code extension | Inline diffs, @-mentions and plan review inside the editor. Also installs in Cursor. |
| JetBrains plugin | For IntelliJ IDEA, PyCharm, WebStorm and others. Needs the CLI installed too. |
| Desktop app | A standalone app for macOS, Windows and Linux (beta on Ubuntu and Debian). No terminal needed. |
| Web | Runs in your browser at claude.ai/code with no local setup. |
All of these use the same engine. Your project settings and instruction files work in each one.
What do I need before I install Claude Code?
Check three things first.
1. A supported system. Anthropic lists these requirements:
| Requirement | Minimum |
|---|---|
| macOS | 13.0 or newer |
| Windows | Windows 10 1809+ or Windows Server 2019+ |
| Linux | Ubuntu 20.04+, Debian 10+, or Alpine Linux 3.19+ |
| Hardware | 4 GB+ RAM, x64 or ARM64 processor |
| Network | Internet connection required |
| Shell | Bash, Zsh, PowerShell or CMD |
You also need to be in one of Anthropic's supported countries.
2. A paid account. Claude Code needs a Pro, Max, Team, Enterprise or Console account. You can also connect it through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry. For plan prices, see our guide on how much Claude Code costs.
3. A project folder. Any code project works. Even an empty folder is fine for a first test.
You do not need Node.js for the recommended installer. Node.js 22 or later is only needed if you choose the npm method.
How do I install Claude Code on Mac or Linux?
The native installer is the method Anthropic recommends. It also updates itself in the background.
- Open the Terminal app.
- Paste this command and press Enter:
curl -fsSL https://claude.ai/install.sh | bash
- Wait. The installer shows no progress bar while it downloads.
- Open a new terminal window and check the install:
claude --version
A working install prints a version number followed by (Claude Code).
If you prefer Homebrew on a Mac, use this instead:
brew install --cask claude-code
Homebrew has two casks. claude-code follows the stable channel, which is usually about a week behind and skips releases with major problems. claude-code@latest gets every release right away. Homebrew installs do not update on their own, so run brew upgrade claude-code from time to time.
How do I install Claude Code on Windows?
You have two choices: run it natively on Windows, or run it inside WSL (Windows Subsystem for Linux). You do not need to run as Administrator.
Option A: native Windows with PowerShell
- Open PowerShell. Your prompt starts with
PS C:\. - Run:
irm https://claude.ai/install.ps1 | iex
- Open a new PowerShell window and run
claude --version.
Option B: native Windows with CMD
- Open Command Prompt. Your prompt starts with
C:\and noPS. - Run:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Option C: WinGet
winget install Anthropic.ClaudeCode
WinGet installs do not auto-update. Run winget upgrade Anthropic.ClaudeCode now and then.
Option D: WSL
Open your WSL distribution and run the Mac and Linux command from the section above. You install and launch claude inside the WSL terminal, not from PowerShell.
Which should you pick? Anthropic's docs say native Windows suits Windows-native projects. WSL 2 suits Linux toolchains and is the only Windows option that supports sandboxing.
One tip: install Git for Windows. It gives Claude Code a Bash shell to work with. Without it, Claude Code uses PowerShell instead.
Common Windows error: if you see The token '&&' is not a valid statement separator, you pasted the CMD command into PowerShell. If you see 'irm' is not recognized, you pasted the PowerShell command into CMD. Swap them.
Can I install Claude Code with npm?
Yes. It still works, but it is no longer the main method. The npm package needs Node.js 22 or later.
npm install -g @anthropic-ai/claude-code
Do not use sudo npm install -g. Anthropic warns that it can cause permission issues and security risks. To upgrade an npm install later, run npm install -g @anthropic-ai/claude-code@latest.
On Debian, Ubuntu, Fedora, RHEL and Alpine you can also install from Anthropic's signed apt, dnf and apk repositories. The setup page has the exact commands.
How do I log in to Claude Code for the first time?
- Go to your project folder and start Claude Code:
cd /path/to/your/project
claude
- Claude Code asks you to log in. Pick your account type and finish the login in your browser.
- Your credentials are saved. You will not need to log in again on this machine.
You can log in with:
- A Claude Pro, Max, Team or Enterprise subscription (Anthropic's recommended option)
- A Claude Console account, which uses prepaid API credits. On first login, Claude Code creates a workspace called "Claude Code" in the Console for cost tracking.
- Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry
To switch accounts later, type /login inside a session.
Watch out for API keys. If the ANTHROPIC_API_KEY environment variable is set, Claude Code can use that key instead of your subscription. Anthropic's support page warns that this bills you at API rates instead of using your plan. If you pay for Pro or Max, make sure you did not leave an old key set.
What should I do in my first Claude Code session?
Start by asking questions. Claude Code reads your files as needed, so you do not have to paste code in. Try these prompts from Anthropic's quickstart:
what does this project do?
explain the folder structure
Then try a small change:
add a hello world function to the main file
Claude Code shows you the change. If it asks for permission, select Yes to approve. Press Shift+Tab at any time to switch the permission mode, which controls what Claude can do without asking first.
Next, create a project memory file. Type:
/init
This makes a CLAUDE.md file with your build commands and project conventions. Claude reads it at the start of every session. Our CLAUDE.md guide explains what to put in it.
Which Claude Code commands should a beginner know?
Here are the essentials from Anthropic's quickstart and command reference.
In your terminal:
| Command | What it does |
|---|---|
claude |
Start an interactive session |
claude "task" |
Start with a first prompt, for example claude "fix the build error" |
claude -p "query" |
Run one query, print the answer, then exit |
claude -c |
Continue the most recent conversation in this folder |
claude -r |
Pick a previous conversation to resume |
claude update |
Install the latest version now |
claude doctor |
Check your install and settings for problems |
Inside a session:
| Command | What it does |
|---|---|
/help |
Show available commands |
/init |
Create a starting CLAUDE.md for the project |
/clear |
Start a fresh conversation with empty context |
/compact |
Summarize the conversation to free up space |
/model |
Switch the AI model |
/usage |
Show session cost and plan usage limits |
/exit |
Quit (or press Ctrl+D twice) |
Type / on its own to see every command and skill available to you. Want to build your own commands? See our guide to Claude Code skills, hooks and slash commands.
How do I update or uninstall Claude Code?
Native installs update automatically in the background. The update takes effect the next time you start Claude Code. To update right now:
claude update
You can also pick a release channel in /config. The default, latest, gets new features right away. stable uses a version that is about one week old and skips releases with major regressions.
To uninstall a native install on Mac, Linux or WSL:
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
For Homebrew, run brew uninstall --cask claude-code. For WinGet, run winget uninstall Anthropic.ClaudeCode. For npm, run npm uninstall -g @anthropic-ai/claude-code.
Your settings live in ~/.claude and ~/.claude.json. Delete them only if you want to remove all settings and session history too.
Frequently asked questions
Is Claude Code free? No. The free Claude plan does not include Claude Code. You need Pro, Max, Team, Enterprise or a Console (API) account. Compare options in our Claude Code cost guide.
Do I need Node.js to install Claude Code? Not for the recommended native installer, Homebrew or WinGet. Only the npm method needs Node.js, version 22 or later.
Why does my terminal say "claude: command not found" after installing?
The install folder is not on your PATH yet. First, open a brand new terminal window and try again. If it still fails, follow the "Fix your PATH" steps in Anthropic's troubleshooting guide, or run claude doctor once the command works.
Should I use WSL or native Windows? Use native Windows for Windows-native projects. Use WSL 2 if your tools are Linux-based or you want sandboxed command execution, which native Windows does not support.
Can I use Claude Code without the terminal? Yes. The Desktop app includes Claude Code, so you do not need to install the CLI separately. The Desktop app needs a paid subscription. You can also run Claude Code in your browser at claude.ai/code.
How is Claude Code different from Cursor or GitHub Copilot? Claude Code started as a terminal agent and now also runs in editors, a desktop app and the web. Cursor is an AI code editor and Copilot is built into GitHub and many IDEs. Read our fair Claude Code vs Cursor vs GitHub Copilot comparison.
Learn Claude Code step by step, for free
Installing is the easy part. Getting real work done takes a few habits: clear prompts, a good CLAUDE.md, and knowing when to clear context. Our free course Claude Code from Zero takes you from your first session to confident daily use, one short lesson at a time.
Sources
Did this land? Leave a reaction.
Discussion
0 commentsMembers can join the discussion
Become a member to comment and reply to other members.
Become a MemberNo comments yet
Be the first to start the discussion.