10分钟安装claudeDesktop+ccSwitch+headroom
⚙️ 环境要求
| 项目 | 要求 |
|---|---|
| 操作系统 | Windows 10/11 64-bit |
| Node.js | v18+(cc-switch 依赖) |
| 网络 | 需能访问 GitHub Releases 下载安装包 |
🖥️ Step 1:安装 Claude Desktop
| 渠道 | 地址 |
|---|---|
| 🪞 镜像下载(推荐) | https://github.com/Wangnov/claude-app-mirror/releases |
| 🏠 官方下载 | https://claude.com/download |
⚠️ 官方下载地址在国内被屏蔽,建议使用 GitHub 镜像资源。
📋 操作步骤
- 进入镜像 Releases 页面,下载最新版本的
.exe安装包(如Claude-Setup-x.x.x.exe)。 - 双击运行安装程序,按向导完成安装。
- 安装完成后默认路径为:
C:\Users\<用户名>\AppData\Local\Programs\Claude\ - 💡 提示: 新版 Claude Desktop 安装包内已自带 Claude Code,通常无需单独安装。安装完成后可先跳到 ✅ Step 4 检查是否可用。
💻 Step 2:安装 Claude Code(按需)
📥 下载地址: https://github.com/alonw0/cc-versions/releases
⚠️ 仅当 Step 4 验证时提示找不到 Claude Code 相关命令时才需要执行此步骤。
📋 操作步骤
- 进入上述 Releases 页面,下载与你 Claude Desktop 版本匹配的 Claude Code 包(通常为
.zip或.tar.gz)。 - 解压下载的文件。
- 将解压后的内容复制到以下目录(对应版本文件夹下):
C:\Users\<用户名>\AppData\Local\Claude-3p\claude-code\<版本号>\ - 如果目录不存在,手动创建即可。
- 复制完成后重启 Claude Desktop。
🔄 Step 3:安装 cc-switch 并配置第三方模型
| 资源 | 地址 |
|---|---|
| 📂 仓库地址 | https://github.com/farion1231/cc-switch |
| 📥 Releases 下载 | https://github.com/farion1231/cc-switch/releases |
| 💳 推荐 API 提供商 | https://vip.auto-code.net/dashboard |
3.1 获取 API Key
- 访问 https://vip.auto-code.net/dashboard
- 注册/登录账号。
- 购买一张定量卡(按 token 计费,用完即止,性价比高)。
- 在控制台获取你的 API Key,格式类似
sk-xxxxxxxxxxxx。
3.2 安装 cc-switch
方式一:下载 Release 包
- 从 https://github.com/farion1231/cc-switch/releases 下载最新版本。
- 解压到任意目录。
- 在该目录下打开终端运行配置命令。
方式二:npm 全局安装
npm install -g cc-switch
🛠️ 3.3 配置第三方模型
运行 cc-switch 并按提示配置:
cc-switch
配置时需要填写:
| 配置项 | 示例值 |
|---|---|
| API Base URL | https://vip.auto-code.net/v1(或提供商给出的地址) |
| API Key | 你在 3.1 步获取的 Key |
| Model | 根据提供商支持的模型选择(如 claude-sonnet-4-20250514) |
配置完成后 cc-switch 会自动修改 Claude Code 的模型路由,使其通过第三方 API 调用。
✅ Step 4:验证安装
- 打开 Claude Desktop。
- 如果正常显示对话界面,说明 Claude Desktop 安装成功。
- 在 Claude Desktop 中尝试使用 Claude Code 功能(如终端命令执行):
- ✅ 正常工作 → 安装完成,可跳过 Step 2。
- ❌ 提示找不到命令/Claude Code 不可用 → 回到 💻 Step 2 手动安装。
- 配置了 cc-switch 后,发送任意消息确认模型能正常响应。

🌐 Step 5:汉化(可选)
📂 仓库地址: https://github.com/javaht/claude-desktop-zh-cn
📋 操作步骤
- 从仓库 Releases 或直接 clone 获取汉化补丁文件。
- 根据仓库 README 说明,将汉化文件覆盖到 Claude Desktop 安装目录中对应的资源文件位置,通常为:
C:\Users\<用户名>\AppData\Local\Programs\Claude\resources\ - 重启 Claude Desktop,界面将显示为中文。
⚠️ 注意: 每次 Claude Desktop 更新后可能需要重新应用汉化补丁。
📦 附录:Headroom 上下文压缩
📖 参考文章: https://blog.csdn.net/qq_56236582/details/162027004
Headroom 是一个 MCP Server 插件,用于在 Claude Code 会话中自动压缩长上下文,节省 token 用量。
💡 简要说明
- Headroom 通过压缩工具输出和文件内容来减少上下文窗口占用。
- 压缩后的内容可通过 hash 随时检索还原。
- 适合长时间开发会话,避免上下文溢出。
🏗️ 架构概览
┌─────────────────────────────────────┐
│ 应用层 (Agent / CLI) │
│ Claude Code, Cursor, Codex CLI │
└──────────────┬──────────────────────┘
│ 原始上下文
▼
┌─────────────────────────────────────┐
│ Headroom 压缩层 │
│ ┌─────────────┐ ┌───────────────┐ │
│ │ ContentRouter│ │ Compressor │ │
│ │ (内容分类) │ │ (六种算法) │ │
│ └─────────────┘ └───────────────┘ │
│ ┌─────────────┐ ┌───────────────┐ │
│ │ CacheAligner│ │ ReverseCache │ │
│ │ (缓存稳定) │ │ (可逆恢复) │ │
│ └─────────────┘ └───────────────┘ │
└──────────────┬──────────────────────┘
│ 压缩后上下文
▼
┌─────────────────────────────────────┐
│ LLM 层 │
│ Claude, GPT, Gemini, DeepSeek │
└─────────────────────────────────────┘
🚀 启动指令
headroom proxy --port 8181 --anthropic-api-url https://vip.auto-code.net --openai-api-url https://vip.auto-code.net/v1 --no-telemetry
// 带配置启动示例
headroom --config ./headroom.yaml
⚡ MCP 配置
// ~/.claude/settings.json
{
"mcpServers": {
"headroom": {
"command": "headroom",
"args": ["mcp", "--config", "./headroom.yaml"]
}
}
}
📄 配置文件
# headroom.yaml
version: "1.0"
# 全局设置
global:
default_strategy: auto # 自动检测内容类型
max_compression_ratio: 0.95 # 最高压缩95%
reverse_cache: true
cache_path: ".headroom/cache"
cache_ttl_hours: 24
# 各算法配置
compressors:
smart_crusher:
enabled: true
array_sample_size: 3
max_depth: 3
keep_fields: ["error", "status", "result", "data", "id", "name"]
drop_fields: ["metadata", "pagination", "debug_info", "trace"]
ast_aware:
enabled: true
languages: ["python", "javascript", "typescript", "go", "rust"]
keep_signatures: true
keep_imports: true
compress_bodies: true
max_body_lines: 3
error_first:
enabled: true
keep_levels: ["ERROR", "WARN", "CRITICAL"]
summarize_levels: ["INFO", "DEBUG"]
keep_stack_traces: true
time_window_seconds: 60
summary:
enabled: true
model: "local"
max_output_ratio: 0.3
keep_code_blocks: true
keep_numbers: true
column_prune:
enabled: true
sample_rows: 5
add_statistics: true
section_filter:
enabled: true
relevance_threshold: 0.3
keep_code_blocks: true
# CacheAligner 配置
cache_aligner:
enabled: true
stable_prefix_blocks: ["system_prompt", "skills", "project_rules"]
cache_hit_target: 0.8
# 模型路由配置
content_router:
routes:
json: "fast_model"
code: "fast_model"
natural_language: "smart_model"
log: "fast_model"
# 模型定义
models:
fast_model:
type: "local"
path: "~/.headroom/models/llama-q4.gguf"
max_tokens: 512
smart_model:
type: "api"
provider: "deepseek"
model: "deepseek-chat"
max_tokens: 1024
❓ 常见问题
🖥️ Q: 打开 Claude Desktop 报错或白屏?
- 检查系统是否为 Windows 10/11 64-bit。
- 尝试以管理员权限运行。
- 检查安装路径中是否有中文或特殊字符。
🔄 Q: cc-switch 配置后模型无响应?
- 确认 API Key 是否正确、余额是否充足。
- 确认 API Base URL 是否正确(注意结尾是否需要
/v1)。 - 检查网络是否能访问 API 提供商域名。
💻 Q: Claude Code 命令不可用?
- 确认 Claude Code 文件已正确放置到:
C:\Users\<用户名>\AppData\Local\Claude-3p\claude-code\<版本号>\ - 重启 Claude Desktop 后再试。
🌐 Q: 汉化后部分文字仍为英文?
- 可能汉化包版本与 Claude Desktop 版本不匹配,等待汉化包更新或降级 Desktop 版本。
🔗 资源汇总
| 资源 | 地址 |
|---|---|
| 🪞 Claude Desktop 镜像 | https://github.com/Wangnov/claude-app-mirror/releases |
| 💻 Claude Code 版本包 | https://github.com/alonw0/cc-versions/releases |
| 🔄 cc-switch 仓库 | https://github.com/farion1231/cc-switch |
| 📥 cc-switch Releases | https://github.com/farion1231/cc-switch/releases |
| 💳 推荐 API 提供商 | https://vip.auto-code.net/dashboard |
| 🌐 汉化补丁 | https://github.com/javaht/claude-desktop-zh-cn |
| 📦 Headroom 教程 | https://blog.csdn.net/qq_56236582/details/162027004 |

浙公网安备 33010602011771号