系統需求
- 作業系統:macOS 13.0+、Ubuntu 20.04+/Debian 10+ 或 Windows 10+(搭配 WSL 1、WSL 2 或 Git for Windows)
- 硬體:4 GB+ RAM
- 網路:需要網際網路連線(請參閱網路設定)
- Shell:在 Bash 或 Zsh 中效果最佳
- 位置:Anthropic 支援的國家
其他依賴項
- ripgrep:通常包含在 Claude Code 中。如果搜尋失敗,請參閱搜尋疑難排解。
- Node.js 18+:僅在已棄用的 npm 安裝時需要
安裝
To install Claude Code, use one of the following methods:- Native Install (Recommended)
- Homebrew
- WinGet
macOS, Linux, WSL:Windows PowerShell:Windows CMD:
Native installations automatically update in the background to keep you on the latest version.
Alpine Linux 和其他 musl/uClibc 型發行版:原生安裝程式需要
libgcc、libstdc++ 和 ripgrep。對於 Alpine:apk add libgcc libstdc++ ripgrep。設定 USE_BUILTIN_RIPGREP=0。驗證
針對個人
- Claude Pro 或 Max 方案(建議):訂閱 Claude 的 Pro 或 Max 方案,以取得包含 Claude Code 和網頁版 Claude 的統一訂閱。在一個地方管理您的帳戶,並使用您的 Claude.ai 帳戶登入。
- Claude Console:透過 Claude Console 連線並完成 OAuth 程序。需要在 Anthropic Console 中有效的帳單。系統會自動為使用情況追蹤和成本管理建立「Claude Code」工作區。您無法為 Claude Code 工作區建立 API 金鑰;它專門用於 Claude Code 使用。
針對團隊和組織
- Claude for Teams 或 Enterprise(建議):訂閱 Claude for Teams 或 Claude for Enterprise,以進行集中帳單、團隊管理,以及存取 Claude Code 和網頁版 Claude。團隊成員使用其 Claude.ai 帳戶登入。
- Claude Console 搭配團隊帳單:設定共用的 Claude Console 組織搭配團隊帳單。邀請團隊成員並指派角色以進行使用情況追蹤。
- 雲端提供者:設定 Claude Code 以使用 Amazon Bedrock、Google Vertex AI 或 Microsoft Foundry,以便與您現有的雲端基礎結構進行部署。
安裝特定版本
原生安裝程式接受特定版本號或發行通道(latest 或 stable)。您在安裝時選擇的通道將成為自動更新的預設值。如需詳細資訊,請參閱設定發行通道。
若要安裝最新版本(預設):
- macOS、Linux、WSL
- Windows PowerShell
- Windows CMD
- macOS、Linux、WSL
- Windows PowerShell
- Windows CMD
- macOS、Linux、WSL
- Windows PowerShell
- Windows CMD
二進位完整性和程式碼簽署
- 所有平台的 SHA256 校驗和都發佈在發行資訊清單中,目前位於
https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/{VERSION}/manifest.json(範例:將{VERSION}替換為2.0.30) - 簽署的二進位檔案分佈在以下平台上:
- macOS:由「Anthropic PBC」簽署並由 Apple 公證
- Windows:由「Anthropic, PBC」簽署
NPM 安裝(已棄用)
NPM 安裝已棄用。盡可能使用原生安裝方法。若要將現有的 npm 安裝遷移至原生,請執行claude install。
全域 npm 安裝
Windows 設定
選項 1:WSL 中的 Claude Code- 支援 WSL 1 和 WSL 2
- 需要 Git for Windows
- 對於可攜式 Git 安裝,請指定您的
bash.exe路徑:
更新 Claude Code
自動更新
Claude Code 會自動保持最新狀態,以確保您擁有最新的功能和安全修正。- 更新檢查:在啟動時和執行時定期執行
- 更新程序:在背景自動下載並安裝
- 通知:安裝更新時您會看到通知
- 套用更新:更新在您下次啟動 Claude Code 時生效
Homebrew 和 WinGet 安裝不會自動更新。使用
brew upgrade claude-code 或 winget upgrade Anthropic.ClaudeCode 手動更新。已知問題:Claude Code 可能會在新版本在這些套件管理器中可用之前通知您有更新。如果升級失敗,請稍候並稍後重試。設定發行通道
使用autoUpdatesChannel 設定來設定 Claude Code 針對自動更新和 claude update 遵循的發行通道:
"latest"(預設):在新功能發佈時立即接收"stable":使用通常約一週舊的版本,跳過有重大迴歸的發行版本
/config → 自動更新通道進行設定,或將其新增至您的 settings.json 檔案:
停用自動更新
在您的 shell 或 settings.json 檔案中設定DISABLE_AUTOUPDATER 環境變數: