直连安装

连接 Anthropic 官方服务安装 Claude Code

操作3 分钟

推荐使用原生安装,安装后自动在后台保持更新,不需要提前安装 Node.js。

安装 Claude Code

打开终端,粘贴这行命令,按回车:

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

备选安装方式:

方式命令自动更新
Homebrew (macOS)brew install --cask claude-code否,需手动 brew upgrade
WinGet (Windows)winget install Anthropic.ClaudeCode否,需手动 winget upgrade
npm (旧方式)npm install -g @anthropic-ai/claude-code否,需 Node.js 18+

已有 npm 旧版本的用户可以迁移:运行 claude install 切换到原生安装,再运行 npm uninstall -g @anthropic-ai/claude-code 清理旧版本。

账号准备

使用 Claude Code 需要一个 Anthropic 账号。费用来自 API 按量付费额度,或 Claude Pro($20/月)/ Max($100/月起)订阅。

其他使用方式

除了终端,Claude Code 也可以通过 VS Code 扩展JetBrains 插件桌面应用网页版使用。本课程以终端为主,其他方式的操作逻辑相同。


下一步:验证安装 →

安装 Claude Code2/3