AI Coding Tool Setup and Reference (1/7) — Claude Code Install: macOS, Linux, WSL, Windows

Every install path, system requirement, auth option, and first session — straight from the official docs


ํ•ต์‹ฌ ์š”์•ฝ

  • Audience: developers or non-developers installing Claude Code for the first time.
  • What you'll get: five install methods compared, verbatim per-platform commands, four auth options, and a working first session in under 10 minutes.
  • Prerequisite: a Claude Pro / Max / Team / Enterprise subscription, or an Anthropic Console API account. The free Claude.ai plan does not include Claude Code.

1. Install methods at a glance

The official docs list five install paths. Pick one based on your platform and workflow.

Method Platforms Auto-update When to use
Native Install (recommended) macOS, Linux, WSL, Windows ✅ background Most personal dev setups
Homebrew macOS, Linux ❌ manual When you already manage tools with Homebrew
WinGet Windows ❌ manual When corporate policy requires WinGet
Linux packages (apt/dnf/apk) Debian/Ubuntu, Fedora/RHEL, Alpine ❌ via system upgrade Server automation / deployment pipelines
npm (deprecated) All ❌ manual (npm update) Only if you already have a Node-based workflow

The official README marks npm install as deprecated. Existing npm users should migrate to the native installer.


2. System requirements

Per official docs as of 2026-04-24:

  • OS
  • macOS 13.0+
  • Windows 10 1809+ or Windows Server 2019+
  • Ubuntu 20.04+ / Debian 10+ / Alpine Linux 3.19+
  • Hardware: 4 GB+ RAM, x64 or ARM64
  • Shell: Bash, Zsh, PowerShell, or CMD
  • Native Windows requires Git for Windows
  • WSL does not need Git separately
  • Network: internet connection in an Anthropic-supported country
  • Dependency: ripgrep is bundled in the binary. Alpine and other musl distros need it installed separately (see 2.1)

2.1 Extra step for Alpine / musl distros

Alpine Linux and other musl/uClibc-based distros can't use the bundled ripgrep. Install the system packages instead.

apk add libgcc libstdc++ ripgrep

Then add this to ~/.claude/settings.json:

{
  "env": {
    "USE_BUILTIN_RIPGREP": "0"
  }
}

3. Install — verbatim commands per platform

3.1 macOS / Linux / WSL — Native Install

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

After install, re-open the shell or source ~/.bashrc (or ~/.zshrc) to reload PATH. The default location is ~/.local/bin/claude.

To pin a version:

curl -fsSL https://claude.ai/install.sh | bash -s stable

curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89

3.2 Windows — PowerShell

irm https://claude.ai/install.ps1 | iex

Your prompt shows PS C:\> in PowerShell. If you see 'irm' is not recognized, you're in CMD — use the CMD command instead.

3.3 Windows — CMD

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Your prompt shows C:\> (no PS) in CMD. If you see The token '&&' is not a valid statement separator, you're in PowerShell — switch to the PS command.

Native Windows requires Git for Windows to be installed first. Admin rights are not needed.

3.4 Homebrew (macOS / Linux)

Homebrew offers two casks.

brew install --cask claude-code          # stable (~1 week delayed, skips regressions)
brew install --cask claude-code@latest   # latest (new versions immediately)

Homebrew installations don't auto-update. Run brew upgrade claude-code (or @latest) periodically.

3.5 WinGet (Windows)

winget install Anthropic.ClaudeCode

Upgrade manually: winget upgrade Anthropic.ClaudeCode.

3.6 Linux package managers

Signed repositories are available for Debian/Ubuntu (apt), Fedora/RHEL (dnf), and Alpine (apk).

Debian / Ubuntu (apt)

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

Verify the GPG fingerprint before trusting:

gpg --show-keys /etc/apt/keyrings/claude-code.asc

Fedora / RHEL (dnf)

sudo tee /etc/yum.repos.d/claude-code.repo <<'EOF'
[claude-code]
name=Claude Code
baseurl=https://downloads.claude.ai/claude-code/rpm/stable
enabled=1
gpgcheck=1
gpgkey=https://downloads.claude.ai/keys/claude-code.asc
EOF
sudo dnf install claude-code

Alpine (apk)

wget -O /etc/apk/keys/claude-code.rsa.pub \
  https://downloads.claude.ai/keys/claude-code.rsa.pub
echo "https://downloads.claude.ai/claude-code/apk/stable" >> /etc/apk/repositories
apk add claude-code

3.7 npm (deprecated)

Requires Node.js 18+. Marked deprecated officially, but still works for existing workflows.

npm install -g @anthropic-ai/claude-code

Avoid sudo npm install -g — it creates permission and security issues.


4. Verify the install

Two commands:

claude --version
claude doctor

claude doctor checks Node version, PATH, permissions, and MCP accessibility. If anything shows up red, see the official troubleshooting page.


5. Auth — four options

Claude Code does not work with the free Claude.ai plan. You need one of:

Option For Billing How to set up
Claude Pro / Max / Team / Enterprise subscription Individuals / teams Flat subscription Run claude → browser login
Anthropic Console (API key) Pay-as-you-go credits Usage-based Console creates a "Claude Code" workspace on first login
Amazon Bedrock Enterprise AWS AWS billing Bedrock setup guide
Google Vertex AI Enterprise GCP GCP billing Vertex setup guide
Microsoft Foundry Enterprise Azure Azure billing Foundry setup guide

On first run, claude prompts you to log in through the browser. To switch accounts later, use /login.


6. First session

cd /path/to/your/project
claude

Run it inside a project directory. The welcome screen shows session info. Memorize these:

  • /help — list available commands
  • /login — switch accounts
  • /clear — reset conversation
  • exit or Ctrl+D — quit

Command cheatsheet

Command Effect
claude Start interactive session
claude "task" Run a one-time task and exit
claude -p "query" One-off query, non-interactive (script-friendly)
claude -c Continue the most recent conversation in the current directory
claude -r Resume a prior conversation by selection

Full reference: official CLI docs.


7. Auto-update & release channels

Native installs update in the background. Two channels:

  • latest (default) — new versions immediately
  • stable — about 1 week delayed, skips releases with major regressions

Switch via /config → Auto-update channel, or edit settings.json directly:

{
  "autoUpdatesChannel": "stable"
}

Disable auto-update entirely:

{
  "env": {
    "DISABLE_AUTOUPDATER": "1"
  }
}

Manual update: claude update.


8. Uninstall

8.1 Native

rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

8.2 Full cleanup including config

Deleting ~/.claude and per-project .claude removes all settings, allowed tools, MCP servers, and session history.

rm -rf ~/.claude
rm ~/.claude.json

rm -rf .claude
rm -f .mcp.json

If VS Code extension, JetBrains plugin, or Desktop app is installed, uninstall those first — they recreate ~/.claude when they run.


9. Counter-scenarios — when this guide doesn't fit

  • Corporate firewall blocks the claude.ai install script → Use the Linux package manager path (3.6). Signed repos often pass policy review.
  • You need an offline environment → Claude Code requires an internet connection. There is no fully offline mode in the official docs.
  • You already run a Node-based toolchain → npm install (3.7) still works but is deprecated; plan to migrate to native over time.
  • You're on macOS 12 or older → The minimum is macOS 13.0+. OS upgrade is a hard requirement.

10. What's next

Once installed, these three posts in order:

  1. Claude Code slash commands reference — practical commands beyond /help (coming soon)
  2. CLAUDE.md authoring — what to include, what to avoid — project instruction file design (coming soon)
  3. Claude Code hooks complete guide — 4 lifecycle events × real scripts — automation (coming soon)

References


This is post 1/15 in the "AI Coding CLI Entry Guide" series. Tools covered: Claude Code, Codex CLI, OpenClaw, Hermes Agent. last verified: 2026-04-24 (per official Claude Code docs).

Series overview: Series index

๋Œ“๊ธ€

์ด ๋ธ”๋กœ๊ทธ์˜ ์ธ๊ธฐ ๊ฒŒ์‹œ๋ฌผ

Agent Memory Engine (2/10) — Building an AI Agent Memory System with SQLite Alone

"ML Foundations (9/9) — PyTorch vs TensorFlow, and the Road to Local LLMs"

"RAG Core Study (14/26) — Evaluation Sets with RAGAS & DeepEval"

"ML Foundations (8/9) — Deep Learning Architectures: CNN, RNN, Attention"

"ML Foundations (7/9) — Deep Learning Training: Optimizers, Regularization, Initialization"

OpenClaw to Hermes Migration (2/13) — What to Preserve, Partially Port, or Discard

AI Agents I Built (5/7) — Building an Automated Blogger API Publishing System