01-ClaudeCode学习和使用
参考资料:
1. 安装
1 | |
1 | |
1 | |
2. 启动
1 | |
报错:
Unable to connect to Anthropic services
Failed to connect to api.anthropic.com: ERR_BAD_REQUEST解决:
国内第一次使用claude code的新手,都遇到过这样的报错。而成为了使用claude code的第一道门槛。
解决办法:找到配置文件,在
C:\Users\用户名\.claude.json下面,打开加入一行(记得上一行的逗号不要落下):
1"hasCompletedOnboarding": true重新打开 powershell 进行启动
claude,启动成功。
接下来就是进入到自己的项目目录下,使用 claude 启动 ClaudeCode。
3. API配置与模型切换
参考步骤:https://www.runoob.com/claude-code/claude-code-setup.html
CC Switch下载:https://github.com/farion1231/cc-switch/releases
–> 重启命令行终端,powershell。
常用模型推荐:
- longcat: https://longcat.chat/platform/usage
- 阿里云百炼
切换模型:
- 在提示框输入
/model - 或启动时用
claude --model sonnet
- 确认模型配置无误:
/status
常见命令汇总
| 命令 | 说明 | 示例 |
|---|---|---|
/init |
在项目根目录生成 CLAUDE.md 文件,用于定义项目级指令和上下文 | /init |
/status |
查看当前模型、API Key、Base URL 等配置状态 | /status |
/model <模型名称> |
切换模型 | /model qwen3-coder-next |
/clear |
清除对话历史,开始全新对话 | /clear |
/plan |
进入规划模式,仅分析和讨论方案,不修改代码 | /plan |
/compact |
压缩对话历史,释放上下文窗口空间 | /compact |
/config |
打开配置菜单,可设置语言、主题等 | /config |
真正的重心还是:
模型质量、提示词工程、skills、个人认知综合能力。
01-ClaudeCode学习和使用
https://janycode.github.io/2026/01/22/22_AI/04_ClaudeCode/01-ClaudeCode学习和使用/