惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

好好学习的郝

ClawdBot(OpenClaw)试用记录 编程辅助工具 Codex 入门篇 LLM 接口管理和分发系统 New API Claude API 中转服务 Claude Relay Service 好好学Git:Git Submodule详解 编程辅助工具Cursor入门篇 好好学Golang:Golang问题记录 One API配置自定义渠道 FastAPI入门篇 好好学Docker:使用Docker安装配置AList 好好学Docker:容器指标查看工具ctop 好好学Docker:自建RustDesk Server 好好学Linux:Ubuntu18 升级到 Ubuntu22 好好学Docker:使用Docker安装配置FileBrowser 邮箱配置中的SPF、DKIM、DMARC记录 One API 开发环境配置 LLM 接口管理和分发系统 One API 好好学K8S:K8S中的Leader Election机制 好好学Golang:Viper库
编程辅助工具 Claude Code 入门篇
2025-08-23 · via 好好学习的郝

Claude Code 是一个辅助编程的命令行工具,借助Claude模型提高编码的速度和质量。
当前 Claude Code 风评远高于 Cursor。本文会对Claude Code的基础配置和用法进行说明,方便大家入手使用。

相关文档:

2. 安装Claude Code

2.1. 安装node.js 18+

  1. 安装nvm

    1
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
  2. 安装node.js 20

    1
    2
    3
    nvm install v20.19.4
    nvm use v20.19.4
    nvm alias default v20.19.4

2.2. 安装Claude Code

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

2.3. 初始化Claude Code

1
2
cd your-project
claude

这里不用再继续配置,直接 ctrl+C 退出。

3. 安装配置Claude API代理

Claude Code依赖Claude API,但是因为国内无法访问 Claude,所以我们需要一些访问Claude API的替代方案。

4. 配置Claude Code

创建claude code配置文件

1
vim ~/.claude/settings.json

假设使用的Claude API代理是NewAPI,那么填入如下内容:

1
2
3
4
5
6
7
{
"env": {
"ANTHROPIC_BASE_URL": "https://newapi.voidking.com",
"ANTHROPIC_AUTH_TOKEN": "sk-xxx",
"ANTHROPIC_MODEL": "claude-sonnet-4-20250514"
}
}

5. 命令行使用Claude Code

1
2
cd your-project
claude

6. VSCode/Cursor使用Claude Code

  1. 安装插件 Claude Code for VSCode
    插件安装完成,VSCode右上角会出现claude图标

  2. 点击VSCode右上角会claude图标,启动claude code

  3. 输入需求,辅助编程

7. Claude Code基础用法

参考文档: