vibe-coding-课程-干货集训
02 如何安装&配置Claude Code
Claude Code在哪使用
插件(首推)
- 在编程工具中使用Claude Code插件
Claude Code for Cursor
Claude Code for VSCode

- 新手推荐指数
- 🌟🌟🌟🌟🌟
- 优势
- 和工具对话进行编程,对小白很友好
- 可以同时多开很多个窗口,像浏览器多开N个页面,让Claude Code在不同窗口帮你完成不同任务
- 可以同步使用其他的工具或插件功能,灵活度高
- 劣势
Claude Code插件更新可能没那么快,一些新能力或新模型会最新应用在Claude Code CLI上
CLI
- 在电脑本地终端使用Claude Code

- 新手推荐指数
- 🌟🌟🌟🌟
- 优势
- 编码速度快
- 功能完整,更新最快
- 劣势
需要熟悉一些基础命令行,对纯小白有一定学习成本
Web
- 在浏览器使用Claude Code

- 传送门:https://claude.ai/code
- 新手推荐指数
- 🌟🌟🌟
- 优势
- 无需安装
- 清晰的使用界面,0上手门槛
- 劣势
无法操作本地文件,扩展性弱
安装Claude Code插件(以Cursor为例)
Step 1 · 下载Cursor
- 下载并安装
- Cursor:https://cursor.com/
- VScode(Visual Studio Code):https://code.visualstudio.com/download
Step 2 · 下载Claude Code插件
- 打开Cursor,进入「插件」面板,搜索“Claude Code”并下载


Step 3 · 登录Claude Code
- 安装完成后,点击"..." - 「」

- 进入Claude Code对话页面


- 点击「Claude.ai Subscription」,打开网页进行授权


- 授权成功,回到Cursor就能开始使用Claude Code了

安装Claude Code CLI
MacOS
Step 1 · 安装Node.js
- 打开终端:Command + 空格 ➡️ 输入“Terminal”(即终端) ➡️ 打开终端

- 在终端里输入指令,检测是否安装Node.js
- 已安装Node.js,会出现

- 未安装Node.js,先前往官网下载

1. 下载地址:https://nodejs.org
1. 下载并安装成功后,打开终端,输入命令,验证安装成功
```
node -v # 应该显示 v20.x.x 或 v22.x.x npm -v # 应该显示 10.x.x
node -v
##### Step 2 · 安装Claude Code
1. 在终端输入以下命令
1. 如果你的网络很慢,关掉vpn,在终端内先用键盘的“Control + C”停掉进程,再输入以下指令,使用国内镜像安装
npm install -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com
2. 如果安装成功,会出现这样的结果
changed 16 packages in 4s2 packages are looking for funding run npm fund for details
##### Step 3 · 登录Claude Code
1. 验证当前安装是否成功,在终端输入指令,看到版本号就说明安装成功
claude --version
2. 确定安装成功后,输入指令
1. 应该可以看到,Claude让你做授权的选项,点击回车键
2. 我们就能看到,启动Claude Code CLI成功的画面。即可开始使用
claude
#### Windows
##### Step 1 · 确认系统自带Powershell
1. Windows 10(版本1903及以上)自带Powershell,更早的系统版本请先更新Windows系统
##### Step 2 · 打开Powershell
1. 右键点击开始菜单 → 选择"Windows PowerShell"
##### Step 3 · 使用winget方式安装Node.js
1. 输入指令
winget install OpenJS.NodeJS.LTS
2. 出现如下结果
Found Node.js LTS [OpenJS.NodeJS.LTS] Version x.x.x Starting package install... Successfully installed
3. 验证Node.js安装结果,输入指令
node -v**预期结果**v20.x.x 或 v22.x.x
##### Step 4 · 安装Claude Code
1. 在Powershell中输入指令
1. 如果速度很慢,请使用国内镜像
npm install -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com```**预期结果**```added 16 packages in 4s
2. 安装成功后,验证一下,在Powershell中输入
claude --version**预期结果**claude version x.x.x(如 1.0.40)
##### Step5 · 启动Claude Code
1. 在Powershell中输入指令
1. 打开对应页面进行授权即可
2. 完成授权后,回到Powershell,如果显示如下👇,则启动成功。即可开始使用
claude **预期结果** 终端显示: To authenticate, visit: https://console.anthropic.com/...
Successfully authenticated as: xxx@xxx.com