Install Claude Code in 30 seconds
Open a terminal, paste the command for your system, open a new terminal and type claude in your project folder. Your browser opens so you can sign in to your Claude account.
- Mac, Linux, WSL:
curl -fsSL https://claude.ai/install.sh | bash - Windows PowerShell:
irm https://claude.ai/install.ps1 | iex - Check:
claude --version
- Pasting the Mac command into PowerShell, or the other way around
- Installing with
sudo npm install -g
Free to install, paid Claude account required macOS 13+, Windows 10 (1809)+, Ubuntu 20.04+, Debian 10+
Key takeaways
- Claude Code is Anthropic's coding agent: it reads, edits and checks the files in a project from the terminal, an editor or the desktop app.
- The native installer is the recommended method: one command, no Node.js needed, automatic updates.
- Homebrew, WinGet, apt, dnf and npm also work, but you update them manually.
- Installing is free; using it requires a Pro, Max, Team, Enterprise or Console account. Claude's free plan does not include Claude Code.
- On Windows, Claude Code runs without WSL, from PowerShell or CMD. Git for Windows is still recommended.
- If your terminal says "command not found", open a new terminal; if the error persists, add
~/.local/binto your PATH.
I regularly train marketing people to use Claude Code. The hard part is never the agent itself: it's the installation, and the blank black screen of the terminal. This guide follows the steps in the order you'll actually hit them, with the commands exactly as Anthropic's documentation gives them as of October 7, 2026. Copy the one for your system, or generate your full cheat sheet with the tool below.
What is Claude Code?
Claude Code is Anthropic's coding agent: it reads the files in a project, edits them, runs commands and checks its own work. Unlike a chatbot that suggests code for you to copy and paste, it works directly in your folder, with your approval depending on the permission mode you pick.
It comes in several forms that share the same engine:
- Claude Code CLI: the command-line tool, started with
claudein a terminal. This is what this guide installs first. - The VS Code extension and the JetBrains plugin: Claude Code inside your editor, with changes shown as diffs.
- Claude Code desktop: the Code tab of the Claude desktop app, no terminal involved.
- Claude Code on the web: sessions that run in the cloud, from claude.ai/code.
I use it every day, and not only for development: sorting exports, checking redirects, generating reports. If this way of working is new to you, my article on vibe coding shows what it can and cannot do.
Requirements to install Claude Code
| Item | What you need |
|---|---|
| Operating system | macOS 13 or later; Windows 10 version 1809 or later, Windows 11, Windows Server 2019; Ubuntu 20.04, Debian 10 or Alpine 3.19 and later |
| Hardware | At least 4 GB of RAM, x64 or ARM64 processor |
| Terminal | Bash, Zsh, PowerShell or the CMD command prompt |
| Network | An internet connection, from a country Anthropic supports |
| Account | Claude Pro, Max, Team or Enterprise, or a Claude Console (API) account. The free plan is not enough. |
| Node.js | Not needed with the native installer. Version 22 or later only for the npm installation. |
The installation itself costs nothing. What you pay for is usage: included in your subscription, or billed per token with a Console account. The plans, and the question of whether Claude Code is free, are covered in a separate article.
How to install Claude Code: commands by operating system
Anthropic recommends the native installer: a standalone program, with no Node.js, that updates itself in the background. Package managers (Homebrew, WinGet, apt, dnf) are clean alternatives, but you update them by hand.
| System | Recommended command | Alternative |
|---|---|---|
| macOS | curl -fsSL https://claude.ai/install.sh | bash | brew install --cask claude-code |
| Linux | curl -fsSL https://claude.ai/install.sh | bash | apt, dnf or apk repositories |
| Windows PowerShell | irm https://claude.ai/install.ps1 | iex | winget install Anthropic.ClaudeCode |
| Windows CMD | curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd | winget install Anthropic.ClaudeCode |
| WSL | curl -fsSL https://claude.ai/install.sh | bash, in the Linux terminal | npm |
| All systems | npm install -g @anthropic-ai/claude-code, with Node.js 22 or later | |
Not sure which command is right? Pick your system and your method: the tool puts together the commands to install, check, update and uninstall, ready to copy or download.
Install Claude Code on Mac (macOS)
Open the Terminal app (Cmd + Space, type "Terminal") and paste:
curl -fsSL https://claude.ai/install.sh | bash
The program installs in your home folder, with no admin rights, on Intel Macs and Apple silicon alike. Then close the window, open a new one and check with claude --version.
If you manage your software with Homebrew:
brew install --cask claude-code
This cask follows the stable channel, usually one week behind the latest release and without the releases that caused problems. To get every new release as soon as it ships, install claude-code@latest. Either way, Homebrew does not update Claude Code on its own: remember to run brew upgrade.
Install Claude Code on Linux
Same command as on Mac, in your terminal:
curl -fsSL https://claude.ai/install.sh | bash
If you'd rather have updates go through your system's package manager, Anthropic publishes signed repositories for apt (Debian, Ubuntu), dnf (Fedora, RHEL) and apk (Alpine). For Ubuntu or Debian, on the stable channel:
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc -o /etc/apt/keyrings/claude-code.asc
echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" | sudo tee /etc/apt/sources.list.d/claude-code.list
sudo apt update
sudo apt install claude-code
On a fresh install, run sudo apt install curl gnupg first. Before you trust the key, check its fingerprint with gpg --show-keys /etc/apt/keyrings/claude-code.asc: it must end with BAA929FF1A7ECACE. Alpine needs a few extra packages (bash, curl, libgcc, libstdc++, ripgrep), listed in the official documentation.
Install Claude Code on Windows (PowerShell, CMD, WinGet)
Claude Code runs natively on Windows 10 (version 1809 and later) and Windows 11, with no WSL and no admin rights. Open PowerShell from the Start menu and paste:
irm https://claude.ai/install.ps1 | iex
In the classic command prompt (CMD), the command is different:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
To know where you are: the prompt shows PS C:\Users\YourName> in PowerShell, and C:\Users\YourName> without the "PS" in CMD. Using the wrong command is a common mistake on Windows. Another route, more standard on a managed workstation: winget install Anthropic.ClaudeCode, which you update with winget upgrade Anthropic.ClaudeCode.
Install Git for Windows as well. It is no longer mandatory: without it, Claude Code runs its commands with PowerShell. With it, the agent gets Git Bash, which some of its tools need.
Install Claude Code on WSL
WSL gives you a real Linux inside Windows. Choose it if your projects use Linux tools, or if you want command isolation (sandboxing), available with WSL 2 but not on native Windows. Open your distribution (Ubuntu, for example) and run the Linux command in that terminal, not in PowerShell:
curl -fsSL https://claude.ai/install.sh | bash
Claude Code then installs and runs on the Linux side. WSL does not need Git for Windows.
Install Claude Code with npm
The old method is still available on every system, with Node.js 22 or later:
npm install -g @anthropic-ai/claude-code
The npm package installs the same native program as the installer. Never use sudo npm install -g: it causes permission problems and is a security risk. To update, use npm install -g @anthropic-ai/claude-code@latest rather than npm update -g, which can leave you on an old version.
Check that Claude Code is installed correctly
Close the terminal you used for the installation and open a new one: the old one keeps the old PATH value. Then:
claude --version
A working installation shows a version number followed by "(Claude Code)". For a full diagnosis (installation status, invalid settings, last update), run:
claude doctor
With the native installer, the claude command lives in ~/.local/bin on Mac and Linux, and in %USERPROFILE%\.local\bin on Windows. Successive versions are stored in ~/.local/share/claude.
Sign in to your Claude account
Go to your project folder and start Claude Code:
cd path/to/your/project
claude
On first launch, your browser opens the sign-in page. Confirm, go back to the terminal: your credentials are saved and you won't have to sign in again. Three types of account work:
- A Claude Pro, Max, Team or Enterprise subscription: the simplest route, usage is included in the subscription.
- A Claude Console account: usage is billed per token from prepaid credits. On first sign-in, the Console creates a "Claude Code" workspace so you can track spending.
- Amazon Bedrock, Google Cloud or Microsoft Foundry, for companies that go through their cloud provider.
If the browser doesn't open, press c to copy the sign-in link and paste it yourself. From WSL, a server over SSH or a container, the page shows a code to paste back into the terminal; if pasting doesn't work, claude auth login reads that code directly. To switch accounts: /logout then /login. To see the active account: /status.
A forgotten API key takes priority over your subscription
If the ANTHROPIC_API_KEY variable is set in your terminal, Claude Code offers to use it instead of the browser sign-in. An old key from a past project then causes errors, or API billing you weren't expecting. Check with /status, and remove the export ANTHROPIC_API_KEY=… line from your ~/.zshrc or ~/.bashrc if you no longer need it.
Your first Claude Code commands
Once you're signed in, you talk to Claude Code in plain English, as you would to a colleague. Start by having it understand the project before you ask it to change anything:
what does this project do?
explain the folder structure to me
/init
The /init command creates a CLAUDE.md file at the root: the project context, which Claude Code rereads every time it starts (what the project is for, which commands to run, which rules to follow). It's the most valuable setting in the tool. Read it and fill it in: a project with a good context file gets results in a different league from the same project without one. That's the idea I develop in my article on prompt engineering: what you give the model to read matters more than how you phrase the request.
| Command | Where | What it does |
|---|---|---|
claude | Terminal | Opens a session in the current folder |
claude "task" | Terminal | Opens a session with a first request |
claude -p "question" | Terminal | Answers once then hands back control, handy in a script |
claude -c | Terminal | Resumes the last conversation in the folder |
claude -r | Terminal | Lets you pick a past conversation to resume |
/help | Session | Lists the available commands |
/init | Session | Creates the project's CLAUDE.md file |
/model | Session | Switches model |
/usage | Session | Shows your usage and your plan's limits |
/clear | Session | Starts over with an empty conversation |
/compact | Session | Summarizes the conversation to free up space |
/exit | Session | Quits Claude Code |
Permission modes: what Claude Code does without asking you
A permission mode sets what the agent can do without your approval. Shift + Tab cycles through the modes during a session.
- Manual: it asks before every file change or command; only reads go through without a question. The right choice when you're starting out or for sensitive work.
- Accept edits: it edits files and runs common file commands (create, copy, move) without asking.
- Plan: it analyzes and proposes a plan without changing anything, useful before a big change.
- Auto: a second model reviews actions on your behalf and blocks the risky ones.
Since version 2.1.283, an interactive session starts in auto mode unless you've set otherwise. If you're new to it, I recommend switching to Manual for the first few days and working on a copy of the folder: you see what the agent is about to do before it does it.
Install the Claude Code extension for VS Code
The extension is the most comfortable way to use Claude Code if the terminal puts you off: changes are shown as diffs, you review and adjust the plan before accepting it, and you reference a file with @. You need VS Code 1.94 or later.
- Open the Extensions view: Cmd + Shift + X on Mac, Ctrl + Shift + X on Windows and Linux.
- Search for "Claude Code", published by Anthropic, and click Install. From the command line:
code --install-extension anthropic.claude-code. - Open a file, then click the Spark icon at the top right of the editor, or "✻ Claude Code" in the status bar.
- Click Sign in and confirm the sign-in in your browser.
The extension also installs in Cursor and in other VS Code-based editors, from their marketplace or the Open VSX registry. Worth knowing: it ships its own copy of Claude Code and does not add the claude command to your terminal. To get it on the command line too, install the CLI separately. Conversely, running claude in VS Code's integrated terminal installs the extension automatically.
Claude Code in JetBrains (IntelliJ, PyCharm, WebStorm…)
The JetBrains plugin works with IntelliJ IDEA, PyCharm, WebStorm, PhpStorm, GoLand and Android Studio. Unlike the VS Code extension, it does not bundle Claude Code: it runs the claude command in the IDE's terminal.
- Install the CLI with one of the commands above and check
claude --version. - Install the plugin "Claude Code [Beta]" from the JetBrains Marketplace (Settings, then Plugins), and restart the IDE.
- Run
claudein the integrated terminal, or use Cmd + Esc on Mac, Ctrl + Esc on Windows and Linux.
From an external terminal, the /ide command connects the session to the open IDE. On WSL, set the command wsl -d Ubuntu -- bash -lic "claude" in the plugin settings, replacing Ubuntu with the name of your distribution.
Claude Code desktop: the desktop app
If you don't want a terminal at all, the Claude desktop app includes Claude Code in its Code tab. It installs like any other software, with no Node.js and no CLI.
- macOS: a universal build, for Intel Macs and Apple silicon alike.
- Windows: an x64 installer, and a separate installer for ARM64 processors.
- Linux: in beta, for Ubuntu 22.04 or Debian 12 and later, through Anthropic's apt repository (package
claude-desktop).
Launch the app, sign in, click the Code tab and then Select folder to choose your project. You can work locally, in the cloud (the session keeps running with the app closed), on a remote machine over SSH, or in WSL on Windows. The same app gives you access to chat and to Cowork, the background task agent I cover in Claude Cowork.
Like the CLI, the Code tab requires a paid subscription: if clicking Code prompts you to change plans, your account is on the free plan. The app does not accept a Console API key; in that case, use the CLI.
Update Claude Code
With the native installer, there's nothing to do: Claude Code checks for updates at startup and while you use it, downloads them in the background and applies them on the next launch. To force the update right away:
claude update
The other methods are updated by hand:
| Method | Update command |
|---|---|
| Homebrew | brew upgrade claude-code (or claude-code@latest) |
| WinGet | winget upgrade Anthropic.ClaudeCode |
| apt | sudo apt update && sudo apt upgrade claude-code |
| dnf | sudo dnf upgrade claude-code |
| npm | npm install -g @anthropic-ai/claude-code@latest |
You set the channel in /config, under Auto-update channel: latest, the default, gets every release as soon as it ships; stable stays about one week behind and skips the releases that caused problems. To turn off automatic updates, add "DISABLE_AUTOUPDATER": "1" to the env section of your settings.json file.
Uninstall Claude Code
Remove the program first. Native installer, on Mac, Linux and WSL:
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
Native installer on Windows, in PowerShell:
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force
For the other methods: brew uninstall --cask claude-code, winget uninstall Anthropic.ClaudeCode, sudo apt remove claude-code, sudo dnf remove claude-code or npm uninstall -g @anthropic-ai/claude-code.
Your settings, session history and MCP server configuration stay in ~/.claude and ~/.claude.json. Delete them only if you want to wipe everything, and uninstall the VS Code extension, the JetBrains plugin and the desktop app first, because they recreate that folder:
rm -rf ~/.claude
rm ~/.claude.json
If claude still responds after all that, a second installation is left somewhere, often an old npm version or an alias left behind by an old installer.
Common installation errors and how to fix them
| Message shown | Cause | Fix |
|---|---|---|
command not found: claude or 'claude' is not recognized | The terminal stayed open during the installation, or the folder is not in the PATH | Open a new terminal; otherwise add the folder to the PATH (below) |
'irm' is not recognized | You're in CMD, not PowerShell | Open PowerShell, or use the CMD command |
The token '&&' is not a valid statement separator | CMD command run in PowerShell | Use the PowerShell command |
A parameter cannot be found that matches parameter name 'fsSL' | Mac and Linux command run in PowerShell | Use the PowerShell command |
syntax error near unexpected token '<' or a 403 error | The server returns a web page instead of the script: unsupported country, corporate proxy or a temporary incident | Check that your country is supported, try again later, or use Homebrew or WinGet |
EACCES: permission denied | Installation folder not writable, often after an npm installation | Switch to the native installer, without sudo |
Cask 'claude-code' is unavailable | Homebrew is out of date | brew update, then run the installation again |
Killed during installation on Linux | Not enough memory on the machine | Free up memory or add swap space |
App unavailable in region | Claude Code is not offered in your country | No official workaround |
OAuth error: Invalid code | Sign-in code expired or cut off when copying and pasting | Start again quickly, or press c to copy the full link |
API Error: 403 after signing in | Inactive subscription, or missing role on a Console account | Check your subscription in your claude.ai settings |
This organization has been disabled | An old ANTHROPIC_API_KEY takes priority over the subscription | unset ANTHROPIC_API_KEY, then run claude again |
Add Claude Code to your PATH
On Mac, with Zsh, the default shell:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
On Linux and WSL, with Bash, use the same line and replace ~/.zshrc with ~/.bashrc. On Windows, in PowerShell:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
Then restart the terminal and run claude --version again.
The terminal is scary, and it's the only real obstacle
The hard part is never the agent, which talks in plain language and explains what it's doing. It's the black screen. Once you're past the first half hour, it stops being an issue. If that obstacle holds you back, start with the desktop app or the VS Code extension: the engine is the same.
What to do after you install Claude Code
Claude Code then grows in three ways:
- Skills: reusable know-how (an audit procedure, a publishing checklist) that the agent loads when it needs it. The how-to is in Claude Skills.
- MCP servers: the connection to your tools (Search Console, crawler, database). See what an MCP server is.
- Plugins: packages that bundle skills, agents and MCP servers, installed with
/pluginin a session.
Half of what I hand it has nothing to do with development: converting hundreds of images, cross-referencing two exports, checking a site before it goes live. When a task comes back every week, it becomes a program that runs on its own: that's the kind of project I take on in an AI automation engagement.
Frequently asked questions
How do I install Claude Code?
Open a terminal and paste the command for your system: curl -fsSL https://claude.ai/install.sh | bash on Mac, Linux and WSL, irm https://claude.ai/install.ps1 | iex in PowerShell on Windows. Then open a new terminal and check with claude --version. Finally, run claude in your project folder to sign in.
Is Claude Code free?
Installing it is free, using it is not. Claude Code requires a Claude Pro, Max, Team or Enterprise subscription, or a Console account billed per token. Claude's free plan does not give access to Claude Code, neither in the terminal nor in the desktop app.
Do I need Node.js to use Claude Code?
No. The native installer provides a standalone program that doesn't need Node.js. Node.js, version 22 or later, is only needed if you choose the npm installation, and even then the package installs the same native program.
Where does Claude Code get installed?
With the native installer, the claude command goes in ~/.local/bin on Mac and Linux, and in %USERPROFILE%\.local\bin on Windows. Versions are stored in ~/.local/share/claude. Your settings and history are in the ~/.claude folder and the ~/.claude.json file.
How do I get Claude Code in VS Code?
Open the VS Code Extensions view (Ctrl + Shift + X, or Cmd + Shift + X on Mac), search for "Claude Code" published by Anthropic and install it. Open a file, click the Spark icon at the top right of the editor, then sign in. You need VS Code 1.94 or later and a paid Claude account or a Console account.
Does Claude Code work on Windows without WSL?
Yes. With the native installer, Claude Code runs directly on Windows 10 (version 1809 and later) and Windows 11, from PowerShell or CMD, with no admin rights. Git for Windows is recommended so the agent has Git Bash. WSL 2 is still useful if your projects need Linux tools or command isolation.
How do I update Claude Code?
With the native installer, updates happen on their own in the background, and the claude update command forces the latest version. With Homebrew, WinGet, apt, dnf or npm, you update manually: brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode or npm install -g @anthropic-ai/claude-code@latest, for example.
How do I install a plugin in Claude Code?
In a session, type /plugin to browse the available plugins, or /plugin install followed by the plugin name and its marketplace, for example commit-commands@claude-plugins-official. Then choose the scope: for you in all your projects, for everyone working on the repository, or for you in this repository only.
What if your repetitive tasks just disappeared?
I build custom programs that run on their own: monitoring, reports, checks, publishing. The first call is free.
Reader reviews
Did this article help you? Say so, it helps the next reader.
What readers say
Be the first to leave a review.


