# 使用 CC-Switch 将 DeepSeek V4 接入 Claude Code 的保姆级教程

使用 CC-Switch 将 DeepSeek V4 接入 Claude Code 的安装、配置与验证教程。

# 使用 CC-Switch 将 DeepSeek V4 接入 Claude Code 的保姆级教程

本文档适用于 **Windows** 环境，说明如何使用 **CC-Switch** 将 **DeepSeek V4** 接入 **Claude Code**，并完成 API Key 准备、Node.js 与 Claude Code 安装、Provider 配置和连通性验证。整体目标是让没有命令行基础的用户也能按步骤完成部署。

## 1. 方案概览

这套方案的核心思路是：保留 Claude Code 的命令行工作流和工具调用能力，通过 DeepSeek 提供的 Anthropic 兼容接口，把 DeepSeek V4 接入 Claude Code。这样可以在不改变主要使用方式的前提下，获得更低的使用成本和更长的上下文能力。

<table id="bkmrk-%E7%BB%84%E6%88%90%E4%BD%9C%E7%94%A8claude-codeanthr" style="width:100%;border-collapse:collapse;margin:14px 0;"><thead><tr><th style="border:1px solid rgb(208,215,222);padding:8px;text-align:left;background:rgb(246,248,250);">组成</th><th style="border:1px solid rgb(208,215,222);padding:8px;text-align:left;background:rgb(246,248,250);">作用</th></tr></thead><tbody><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">Claude Code</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">Anthropic 提供的 AI 编程命令行工具，可在终端中执行代码生成、修改、分析与项目操作</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">DeepSeek V4</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">DeepSeek 当前旗舰模型系列，可通过兼容接口接入 Claude Code；如需高复杂度任务能力，推荐使用 `deepseek-v4-pro`，并在 CC-Switch 中为 Sonnet / Opus 勾选 **1M**</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">CC-Switch</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">开源图形化配置工具，用于管理 Claude Code 背后的模型与接口配置</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">Anthropic 兼容接口</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">DeepSeek 提供的兼容层，让 Claude Code 可以直接向 DeepSeek 发送请求</td></tr></tbody></table>

## 2. 准备工作：申请 DeepSeek API Key

开始安装前，先在 DeepSeek 开放平台申请 API Key，并确认账户内有可用余额。

1. 打开 [DeepSeek API Keys 页面](https://platform.deepseek.com/api_keys)
2. 注册或登录账号
3. 进入 **API Keys** 页面后点击创建
4. 为 Key 命名，例如 `claude-code`
5. 创建后立即复制并妥善保存，API Key 通常只显示一次
6. 如无可用额度，可在平台中充值

<figure id="bkmrk-%E5%9B%BE-1%EF%BC%9A%E5%9C%A8-deepseek-%E5%B9%B3%E5%8F%B0%E5%88%9B%E5%BB%BA%E5%B9%B6" style="margin:14px auto 22px auto;text-align:center;">[![图 1：在 DeepSeek 平台创建并保存 API Key](https://docs.20020519.xyz/uploads/images/gallery/2026-05/deepseek-v4-guide/img_001.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/deepseek-v4-guide/img_001.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 1：在 DeepSeek 平台创建并保存 API Key</figcaption></figure>## 3. 安装 Node.js

Claude Code 基于 Node.js 运行，因此需要先安装 Node.js。

打开 [Node.js 官网](https://nodejs.org/)，下载左侧 **LTS** 版本。安装时建议勾选加入 PATH，并允许安装必要工具。

<figure id="bkmrk-%E5%9B%BE-2%EF%BC%9A%E5%9C%A8-node.js-%E5%AE%98%E7%BD%91%E4%B8%8B%E8%BD%BD-l" style="margin:14px auto 22px auto;text-align:center;">[![图 2：在 Node.js 官网下载 LTS 版本](https://docs.20020519.xyz/uploads/images/gallery/2026-05/deepseek-v4-guide/img_002.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/deepseek-v4-guide/img_002.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 2：在 Node.js 官网下载 LTS 版本</figcaption></figure>安装完成后，在 PowerShell 或 CMD 中执行以下命令验证。

```bash
node -v
npm -v
```

<figure id="bkmrk-%E5%9B%BE-3%EF%BC%9A%E9%80%9A%E8%BF%87-node--v-%E4%B8%8E-npm" style="margin:14px auto 22px auto;text-align:center;">[![图 3：通过 node -v 与 npm -v 验证安装结果](https://docs.20020519.xyz/uploads/images/gallery/2026-05/deepseek-v4-guide/img_003.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/deepseek-v4-guide/img_003.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 3：通过 node -v 与 npm -v 验证安装结果</figcaption></figure>## 4. 安装 Claude Code

Node.js 就绪后，可通过 npm 全局安装 Claude Code。

```bash
npm install -g @anthropic-ai/claude-code
claude --version
```

<figure id="bkmrk-%E5%9B%BE-4%EF%BC%9A%E4%BD%BF%E7%94%A8-claude---vers" style="margin:14px auto 22px auto;text-align:center;">[![图 4：使用 claude --version 验证 Claude Code 安装结果](https://docs.20020519.xyz/uploads/images/gallery/2026-05/deepseek-v4-guide/img_004.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/deepseek-v4-guide/img_004.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 4：使用 claude --version 验证 Claude Code 安装结果</figcaption></figure>> **Windows 常见问题：**如果 PowerShell 提示禁止运行脚本，可在管理员 PowerShell 中执行 `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser`，然后重新安装。

## 5. 下载并安装 CC-Switch

截至 **2026-05-25**，本文步骤基于当前最新可获取版本：**CC Switch v3.15.0** 与 **Claude Code v2.1.150**。Windows 用户通常会看到 `CC-Switch-v3.15.0-Windows.msi` 和 `CC-Switch-v3.15.0-Windows-Portable.zip` 两种形式，推荐优先使用安装版 `.msi`。下载页：[CC-Switch Releases](https://github.com/farion1231/cc-switch/releases)

<figure id="bkmrk-%E5%9B%BE-5%EF%BC%9Areleases-%E9%A1%B5%E9%9D%A2%E4%B8%AD%E7%9A%84-wi" style="margin:14px auto 22px auto;text-align:center;">[![图 5：Releases 页面中的 Windows.msi 与 Windows-Portable.zip](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/1.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/1.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 5：Releases 页面中的 Windows.msi 与 Windows-Portable.zip</figcaption></figure>### 5.1 运行安装程序

双击下载得到的 `.msi` 后，会进入标准安装向导。第一步是欢迎页，直接点击 **Next** 即可。

<figure id="bkmrk-%E5%9B%BE-6%EF%BC%9Acc-switch-%E5%AE%89%E8%A3%85%E5%90%91%E5%AF%BC%E6%AC%A2%E8%BF%8E" style="margin:14px auto 22px auto;text-align:center;">[![图 6：CC-Switch 安装向导欢迎页](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/2.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/2.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 6：CC-Switch 安装向导欢迎页</figcaption></figure>随后会进入安装目录确认页面。默认目录通常已经可以直接使用，如无特殊要求不需要修改。

<figure id="bkmrk-%E5%9B%BE-7%EF%BC%9A%E7%A1%AE%E8%AE%A4%E5%AE%89%E8%A3%85%E7%9B%AE%E5%BD%95%E5%B9%B6%E7%BB%A7%E7%BB%AD%E4%B8%8B%E4%B8%80%E6%AD%A5" style="margin:14px auto 22px auto;text-align:center;">[![图 7：确认安装目录并继续下一步](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/3.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/3.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 7：确认安装目录并继续下一步</figcaption></figure>在 **Ready to install** 页面点击 **Install** 开始安装。

<figure id="bkmrk-%E5%9B%BE-8%EF%BC%9A%E7%A1%AE%E8%AE%A4%E5%AE%89%E8%A3%85%E5%B9%B6%E5%BC%80%E5%A7%8B%E5%86%99%E5%85%A5%E6%96%87%E4%BB%B6" style="margin:14px auto 22px auto;text-align:center;">[![图 8：确认安装并开始写入文件](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/4.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/4.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 8：确认安装并开始写入文件</figcaption></figure>安装完成后，建议保留 **Launch CC Switch** 选项并点击 **Finish**，方便直接进入配置流程。

<figure id="bkmrk-%E5%9B%BE-9%EF%BC%9A%E5%AE%89%E8%A3%85%E5%AE%8C%E6%88%90%E5%90%8E%E5%8F%AF%E7%9B%B4%E6%8E%A5%E5%90%AF%E5%8A%A8-cc-sw" style="margin:14px auto 22px auto;text-align:center;">[![图 9：安装完成后可直接启动 CC-Switch](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/5.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/5.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 9：安装完成后可直接启动 CC-Switch</figcaption></figure>## 6. 在 CC-Switch 中配置 DeepSeek V4

下面按当前界面顺序完成配置。

### 6.1 首次打开时先处理旧环境变量冲突

如果你的系统之前用过手动环境变量方式接入 Claude Code，CC-Switch 可能会在顶部直接提示 **检测到系统环境变量冲突**。这类变量会覆盖 CC-Switch 写入的配置，导致后续切换不生效。

<figure id="bkmrk-%E5%9B%BE-10%EF%BC%9A%E9%A1%B6%E9%83%A8%E6%8F%90%E7%A4%BA%E6%A3%80%E6%B5%8B%E5%88%B0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E5%86%B2%E7%AA%81" style="margin:14px auto 22px auto;text-align:center;">[![图 10：顶部提示检测到环境变量冲突](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/6.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/6.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 10：顶部提示检测到环境变量冲突</figcaption></figure>点开详情后，建议删除这些旧变量，避免在后续使用中造成冲突。

<figure id="bkmrk-%E5%9B%BE-11%EF%BC%9A%E5%B1%95%E5%BC%80%E5%86%B2%E7%AA%81%E8%AF%A6%E6%83%85%E5%B9%B6%E5%88%A0%E9%99%A4%E6%97%A7%E7%9A%84-ant" style="margin:14px auto 22px auto;text-align:center;">[![图 11：展开冲突详情并删除旧的 ANTHROPIC 环境变量](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/7.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/7.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 11：展开冲突详情并删除旧的 ANTHROPIC 环境变量</figcaption></figure>### 6.2 新增 DeepSeek 供应商

回到主界面后，确认顶部当前选中的是 **Claude Code**，然后点击右上角橙色 **+** 按钮新增供应商。

<figure id="bkmrk-%E5%9B%BE-12%EF%BC%9A%E5%9C%A8-claude-code-%E8%A7%86" style="margin:14px auto 22px auto;text-align:center;">[![图 12：在 Claude Code 视图中点击右上角加号](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/8.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/8.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 12：在 Claude Code 视图中点击右上角加号</figcaption></figure>新增页面默认停留在 **Claude 供应商** 标签。直接选择内置的 **DeepSeek** 预设即可。

<figure id="bkmrk-%E5%9B%BE-13%EF%BC%9A%E5%9C%A8%E9%A2%84%E8%AE%BE%E4%BE%9B%E5%BA%94%E5%95%86%E5%88%97%E8%A1%A8%E4%B8%AD%E6%89%BE%E5%88%B0-dee" style="margin:14px auto 22px auto;text-align:center;">[![图 13：在预设供应商列表中找到 DeepSeek](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/9.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/9.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 13：在预设供应商列表中找到 DeepSeek</figcaption></figure>选中 **DeepSeek** 后点击右下角 **添加**。这一步只是把预设加入列表，后续仍需要补充 API Key 和模型映射。

<figure id="bkmrk-%E5%9B%BE-14%EF%BC%9A%E9%80%89%E4%B8%AD-deepseek-%E5%B9%B6%E6%B7%BB%E5%8A%A0" style="margin:14px auto 22px auto;text-align:center;">[![图 14：选中 DeepSeek 并添加到供应商列表](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/10.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/10.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 14：选中 DeepSeek 并添加到供应商列表</figcaption></figure>如果在尚未填写 API Key 的情况下直接尝试保存，程序会弹出“配置存在以下问题”的提示。这说明还需要回到编辑页补全 API Key。

<figure id="bkmrk-%E5%9B%BE-15%EF%BC%9A%E6%9C%AA%E5%A1%AB%E5%86%99-api-key-%E6%97%B6%E4%BC%9A%E5%BC%B9" style="margin:14px auto 22px auto;text-align:center;">[![图 15：未填写 API Key 时会弹出配置问题提示](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/11.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/11.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 15：未填写 API Key 时会弹出配置问题提示</figcaption></figure>### 6.3 填写 API Key 并检查自动生成配置

回到供应商列表后，点击 DeepSeek 右侧的铅笔按钮进入编辑页面。

<figure id="bkmrk-%E5%9B%BE-16%EF%BC%9A%E9%80%9A%E8%BF%87%E7%BC%96%E8%BE%91%E6%8C%89%E9%92%AE%E8%BF%9B%E5%85%A5-deepse" style="margin:14px auto 22px auto;text-align:center;">[![图 16：通过编辑按钮进入 DeepSeek 配置页](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/12.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/12.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 16：通过编辑按钮进入 DeepSeek 配置页</figcaption></figure>当前界面已经把很多字段自动化了。对大多数用户来说，真正需要手工填写的核心内容只有 **API Key**。截图中的提示也明确写着“只需要填这里，下方配置会自动填充”。

<figure id="bkmrk-%E5%9B%BE-17%EF%BC%9A%E5%9C%A8%E7%BC%96%E8%BE%91%E9%A1%B5%E4%B8%AD%E5%A1%AB%E5%86%99-deepsee" style="margin:14px auto 22px auto;text-align:center;">[![图 17：在编辑页中填写 DeepSeek API Key](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/13.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/13.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 17：在编辑页中填写 DeepSeek API Key</figcaption></figure>### 6.4 配置模型映射与 1M 选项

在当前界面中，**显示名称** 和 **实际请求模型** 直接填写 `deepseek-v4-pro` 即可；1M 上下文能力通过右侧的 **1M** 勾选项声明。

<figure id="bkmrk-%E5%9B%BE-18%EF%BC%9A%E9%80%9A%E8%BF%87-1m-%E5%8B%BE%E9%80%89%E9%A1%B9%E5%A3%B0%E6%98%8E-son" style="margin:14px auto 22px auto;text-align:center;">[![图 18：通过 1M 勾选项声明 Sonnet 与 Opus 的超长上下文能力](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/14.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/14.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 18：通过 1M 勾选项声明 Sonnet 与 Opus 的超长上下文能力</figcaption></figure>推荐把 **Sonnet** 和 **Opus** 都映射到 `deepseek-v4-pro` 并勾选 **1M**；**Haiku** 映射到 `deepseek-v4-flash` 即可。底部 **默认兜底模型** 一般保留为 `deepseek-v4-pro`。

### 6.5 保存并启用 DeepSeek

确认 API Key、模型映射和 1M 勾选都无误后点击 **保存**。如需核对写入结果，可以向下查看配置 JSON。

<figure id="bkmrk-%E5%9B%BE-19%EF%BC%9A%E4%B8%8B%E6%96%B9-json-%E4%BC%9A%E9%9A%8F%E4%B8%8A%E6%96%B9%E9%85%8D%E7%BD%AE%E8%87%AA" style="margin:14px auto 22px auto;text-align:center;">[![图 19：下方 JSON 会随上方配置自动生成](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/15.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/15.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 19：下方 JSON 会随上方配置自动生成</figcaption></figure>回到供应商列表后，再点击 **启用** 让 DeepSeek 成为当前 Claude Code 使用的供应商。<figure id="bkmrk-%E5%9B%BE-20%EF%BC%9A%E4%BF%9D%E5%AD%98%E5%90%8E%E5%9C%A8%E5%88%97%E8%A1%A8%E4%B8%AD%E5%90%AF%E7%94%A8-deeps" style="margin:14px auto 22px auto;text-align:center;">[![图 20：保存后在列表中启用 DeepSeek](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/16.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/16.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 20：保存后在列表中启用 DeepSeek</figcaption></figure>启用后，CC-Switch 会把兼容 Anthropic 接口所需的配置写入 Claude Code。后续如果只是在同一套配置下日常使用 Claude Code，不需要一直开着 CC-Switch；只有切换供应商、修改 API Key 或重新调整模型映射时，才需要再打开。

## 7. 启动 Claude Code

配置完成后，建议先进入具体项目目录，再启动 Claude Code，避免长期在 `C:\Users\用户名` 这类主目录直接运行。

```bash
cd 你的项目目录
claude
```

<figure id="bkmrk-%E5%9B%BE-21%EF%BC%9Aclaude-code-%E5%90%AF%E5%8A%A8%E5%90%8E%E7%9A%84%E6%AC%A2%E8%BF%8E%E7%95%8C%E9%9D%A2" style="margin:14px auto 22px auto;text-align:center;">[![图 21：Claude Code 启动后的欢迎界面](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/17.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/17.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 21：Claude Code 启动后的欢迎界面</figcaption></figure>## 8. 基本操作

第一次使用时，先掌握三项：**/model** 切模型，**/effort** 调强度，**Shift+Tab** 切权限模式。

### 8.1 先记住这几个命令

<table style="width:100%;border-collapse:collapse;margin:14px 0;"><thead><tr><th style="border:1px solid rgb(208,215,222);padding:8px;text-align:left;background:rgb(246,248,250);">命令</th><th style="border:1px solid rgb(208,215,222);padding:8px;text-align:left;background:rgb(246,248,250);">作用</th><th style="border:1px solid rgb(208,215,222);padding:8px;text-align:left;background:rgb(246,248,250);">什么时候最常用</th></tr></thead><tbody><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`/help`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">查看当前可用命令</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">第一次上手或忘记命令时</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`/model`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">切换当前模型</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">在不同任务复杂度之间切换时</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`/effort`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">调整当前会话的思考强度</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">需要在速度、成本和推理深度之间取舍时</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`/permissions`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">查看当前权限设置</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">确认为什么会频繁弹确认框时</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`/clear`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">清空当前会话历史</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">想重新开始一个干净会话时</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`/compact`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">压缩当前对话上下文</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">长会话后减少上下文占用时</td></tr></tbody></table>

完整命令列表见 Claude Code 官方文档：[Commands](https://code.claude.com/docs/en/commands)。

### 8.2 /effort：最常用的强度调节命令

`/effort` 用于调整当前会话的思考强度，只影响当前会话。可直接输入 `/effort low`、`/effort medium`、`/effort high`、`/effort xhigh`、`/effort max`，也可输入 `/effort auto` 恢复默认；不带参数时会打开交互式滑杆。相关说明见 [Commands](https://code.claude.com/docs/en/commands) 与 [Model configuration](https://code.claude.com/docs/en/model-config)。

<figure style="margin:14px auto 22px auto;text-align:center;">[![图 22：在 Claude Code 中打开 /effort 交互式滑杆](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/18.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/18.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 22：在 Claude Code 中打开 /effort 交互式滑杆</figcaption></figure>新手可以先这样理解：

<table style="width:100%;border-collapse:collapse;margin:14px 0;"><thead><tr><th style="border:1px solid rgb(208,215,222);padding:8px;text-align:left;background:rgb(246,248,250);">档位</th><th style="border:1px solid rgb(208,215,222);padding:8px;text-align:left;background:rgb(246,248,250);">建议理解</th></tr></thead><tbody><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`low` / `medium`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">更快、更省，适合轻量任务</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`high`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">日常开发默认起点</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`xhigh` / `max`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">更重推理，适合复杂调试、复杂重构、长链任务</td></tr></tbody></table>

如果你接入的是 **DeepSeek V4**，界面中虽然仍显示 Claude Code 的五档 `/effort`，但 DeepSeek 侧实际只有 `high` 和 `max` 两档。根据 DeepSeek 官方 [Thinking Mode](https://api-docs.deepseek.com/guides/thinking_mode) 文档，映射关系可以简化理解为：

<table style="width:100%;border-collapse:collapse;margin:14px 0;"><thead><tr><th style="border:1px solid rgb(208,215,222);padding:8px;text-align:left;background:rgb(246,248,250);">Claude Code 中选择的 /effort</th><th style="border:1px solid rgb(208,215,222);padding:8px;text-align:left;background:rgb(246,248,250);">DeepSeek 侧实际档位</th></tr></thead><tbody><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`low` / `medium` / `high`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`high`</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`xhigh` / `max`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`max`</td></tr></tbody></table>

> **新人建议**  
> 日常开发任务通常从 `/effort high` 开始即可；当任务明显更难、需要多步工具调用或长链推理时，再切到 `xhigh` 或 `max`。

#### /effort 被锁定时怎么处理

如果界面中出现类似 `CLAUDE_CODE_EFFORT_LEVEL=max overrides this session — clear it and high takes over` 的提示，说明当前会话的 `/effort` 被环境变量或配置文件强制覆盖了。此时先清理覆盖源，再重新设置。

<figure style="margin:14px auto 22px auto;text-align:center;">[![图 23：CLAUDE_CODE_EFFORT_LEVEL 覆盖当前会话时的提示](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/19.png)](https://docs.20020519.xyz/uploads/images/gallery/2026-05/claude-code-refresh/19.png)<figcaption style="text-align:center;color:#57606a;font-size:0.9em;margin-top:6px;">图 23：CLAUDE\_CODE\_EFFORT\_LEVEL 覆盖当前会话时的提示</figcaption></figure>1. 在 PowerShell 中执行 `echo $env:CLAUDE_CODE_EFFORT_LEVEL`
2. 如果有输出，先清掉当前 shell 变量：`Remove-Item Env:CLAUDE_CODE_EFFORT_LEVEL -ErrorAction SilentlyContinue`
3. 同时删除 Windows 中持久化的同名环境变量。可在“系统属性 → 高级 → 环境变量”中删除，也可用 PowerShell 执行：`[Environment]::SetEnvironmentVariable("CLAUDE_CODE_EFFORT_LEVEL", $null, "User")`
4. 如果 `echo` 没有输出，但 Claude Code 仍提示 override，则继续检查 `%USERPROFILE%\.claude\settings.json`
5. 如果文件中的 `env` 段包含 `CLAUDE_CODE_EFFORT_LEVEL`，将这一项删除后保存
6. 完全退出并重新启动 Claude Code
7. 重新执行 `/effort` 验证是否已经恢复可调

### 8.3 Shift+Tab 切换权限模式

按 **Shift+Tab** 可循环切换权限模式。第一次上手先记住这三档即可：

<table style="width:100%;border-collapse:collapse;margin:14px 0;"><thead><tr><th style="border:1px solid rgb(208,215,222);padding:8px;text-align:left;background:rgb(246,248,250);">模式</th><th style="border:1px solid rgb(208,215,222);padding:8px;text-align:left;background:rgb(246,248,250);">适合场景</th></tr></thead><tbody><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`default`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">新手上手、敏感项目、希望逐步确认时</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`acceptEdits`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">已经明确任务方向，希望加快改代码节奏时</td></tr><tr><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">`plan`</td><td style="border:1px solid rgb(208,215,222);padding:8px;vertical-align:top;">只想先让 Claude 分析和列方案时</td></tr></tbody></table>

熟悉之后，再去了解 `auto` 和 `bypassPermissions`。相关说明见官方文档：[Permission Modes](https://code.claude.com/docs/en/permission-modes)、[交互模式](https://docs.anthropic.com/zh-CN/docs/claude-code/interactive-mode)。

### 8.4 关于 claude --dangerously-skip-permissions

如果确实需要让 Claude 在启动后直接进入更高自主权模式，可以在命令行中使用：

```bash
claude --dangerously-skip-permissions
```

这个命令会直接以 **Bypass permissions** 方式启动，适合可回滚、无敏感文件、且你能准确评估任务影响范围的工作目录。

<table style="width:100%;border-collapse:collapse;margin:14px 0;"><tbody><tr><td style="border-left:4px solid #cf222e;background:#ffebe9;padding:12px 14px;">**风险提醒**

它会跳过大部分人工确认，只建议在你能把控任务边界与改动后果时使用。

</td></tr></tbody></table>

## 9. 参考资源

- [CC-Switch Releases](https://github.com/farion1231/cc-switch/releases)
- [DeepSeek API Key 申请页面](https://platform.deepseek.com/api_keys)
- [DeepSeek 官方接入文档](https://api-docs.deepseek.com/guides/coding_agents)
- [DeepSeek Thinking Mode](https://api-docs.deepseek.com/guides/thinking_mode)
- [Claude Code Model Configuration](https://code.claude.com/docs/en/model-config)
- [Claude Code Commands](https://code.claude.com/docs/en/commands)
- [Claude Code Permission Modes](https://code.claude.com/docs/en/permission-modes)
- [Claude Code 交互模式](https://docs.anthropic.com/zh-CN/docs/claude-code/interactive-mode)
- [Claude Code CLI Reference](https://code.claude.com/docs/en/cli-usage)
- [Claude Code Development Containers](https://docs.anthropic.com/en/docs/claude-code/devcontainer)

---

本文档允许非商业转载与分享，但需注明来源并保留作者署名。

```
来源：https://docs.20020519.xyz/books/cc-switch-deepseek-v4-claude-code
作者：zhiangxu1093@gmail.com
```