Install Claude Code
Claude Code is an AI-powered coding assistant that can understand a project, edit multiple files, and use development tools. It works in the terminal and can be paired with IDE and desktop experiences.
This page covers the native installer, Homebrew, WinGet, and npm. After installation, connect the client with a LAYSO AI API key.
Requirements
- A valid LAYSO AI API key; no separate Claude subscription is required for the LAYSO AI connection.
- macOS 13+, Ubuntu 20.04+/Debian 10+, Windows 10 1809+, or a corresponding WSL environment.
- Git for Windows on Windows.
- Node.js 18 or newer only when using npm.
Terminal CLI
Native installer (recommended)
The native installer does not require Node.js and checks for updates automatically.
macOS / Linux / WSL:
curl -fsSL https://claude.ai/install.sh | bashWindows PowerShell:
irm https://claude.ai/install.ps1 | iexWindows CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdPowerShell and CMD use different commands
If you see The token '&&' is not a valid statement separator, you are in PowerShell. Use the PowerShell command above.
Homebrew
For macOS:
brew install --cask claude-codeHomebrew installations do not update automatically by default:
brew upgrade claude-codeWinGet
For Windows:
winget install Anthropic.ClaudeCodeWinGet installations do not update automatically by default:
winget upgrade Anthropic.ClaudeCodenpm
npm requires Node.js 18 or newer:
npm install -g @anthropic-ai/claude-codeDo not use sudo npm install -g; it can cause permission and security issues.
Choose a release
The native installer accepts latest, stable, or a specific version. The default is latest.
Stable release
macOS / Linux / WSL:
curl -fsSL https://claude.ai/install.sh | bash -s stableWindows PowerShell:
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stableWindows CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd stable && del install.cmdSpecific version
Replace <VERSION> with the required release:
curl -fsSL https://claude.ai/install.sh | bash -s <VERSION>& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) <VERSION>curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd <VERSION> && del install.cmdVerify the installation
Reopen the terminal, then run:
claude --version
claude doctorA version number confirms that installation succeeded.
Start your first session
cd /path/to/your-project
claudeReview directory and permission prompts carefully. Do not allow automatic execution in an untrusted directory.
Update and uninstall
Update
| Installation | Update command |
|---|---|
| Native | Automatic background updates, or claude update |
| Homebrew | brew upgrade claude-code |
| WinGet | winget upgrade Anthropic.ClaudeCode |
| npm | npm install -g @anthropic-ai/claude-code@latest |
Uninstall package-manager versions
brew uninstall --cask claude-code
npm uninstall -g @anthropic-ai/claude-codeWindows:
winget uninstall Anthropic.ClaudeCodeInstallation troubleshooting
Command not found
Reopen the terminal. If the command is still missing, verify that ~/.local/bin or npm's global executable directory is on PATH.
npm binary is missing
Make sure npm allows optional dependencies and that the platform and CPU architecture are supported:
npm list -g --depth=0Windows startup issues
Install Git for Windows and retry in a new PowerShell or CMD window. WSL users should run the Linux installation command inside WSL.
Next step
Continue to Claude Code model endpoint setup and connect LAYSO AI with the root address https://api.layso.ai.
