DeepClaude:用 DeepSeek V4 Pro 运行 Claude Code 自主编程循环 — 便宜 17 倍
发布日期:2026-05-04 · 阅读时间:8 分钟 · GitHub: aattaran/deepclaude
⚡ 登顶 Hacker News 热搜(162 分,#4) — DeepClaude 将 Claude Code 的 API 后端从 Anthropic(输出 $15/百万 token)替换为 DeepSeek V4 Pro(输出 $0.87/百万 token),同时完整保留自主编程循环。同样的终端体验、文件编辑、bash 和子代理生成,成本仅为原来的 1/17。
什么是 DeepClaude?
Claude Code 被公认为当今最好的自主编程编码代理。但每月 $200 美元 且用量受限,对于整天跑编程循环的开发者来说相当昂贵。
DeepClaude 是一个开源工具,它拦截 Claude Code 的 API 调用,将请求重定向到 DeepSeek V4 Pro(或 OpenRouter、Fireworks AI)。结果:你保留了 Claude Code 强大的工具循环(文件编辑、bash 执行、git、子代理生成),但只需支付 DeepSeek 的价格 — 大约每月 $20–80 美元,而不是 $200 美元。
DeepSeek V4 Pro 在 LiveCodeBench 上得分 96.4% — 在大多数日常编程任务上与 Claude Opus 不相上下。在复杂推理方面它还不能完全替代 Anthropic,但对于 80% 的日常工作,两者几乎没有区别。
价格对比:DeepClaude vs Anthropic
| 后端 | 输入 / 百万 token | 输出 / 百万 token | 服务器 |
|---|---|---|---|
| DeepSeek V4 Pro(默认) | $0.44 | $0.87 | 中国 |
| OpenRouter(DeepSeek) | $0.44 | $0.87 | 美国 |
| Fireworks AI(DeepSeek) | $1.74 | $3.48 | 美国(最快) |
| Anthropic Claude Opus | $3.00 | $15.00 | 美国 |
真实月度节省
| 使用量 | Anthropic 封顶价 | DeepClaude(DeepSeek) | 节省 |
|---|---|---|---|
| 轻度(每月 10 天) | $200 | ~$20 | 90% |
| 重度(每月 25 天) | $200 | ~$50 | 75% |
| 自动循环重度使用 | $200 | ~$80 | 60% |
DeepSeek 的 自动上下文缓存 让编程循环更便宜 — 首次请求后,系统提示和文件上下文以 $0.004/百万 token 缓存,而非 $0.44/百万。
工作原理
DeepClaude 的架构非常简单优雅:
你的终端
└── Claude Code CLI(工具循环、文件编辑、bash、git — 不变)
└── API 调用 → DeepSeek V4 Pro($0.87/百万)
替代 Anthropic($15/百万)
它通过设置 Claude Code 启动时读取的 环境变量 来实现:
ANTHROPIC_BASE_URL— 重定向到 DeepSeek 兼容 Anthropic 的端点ANTHROPIC_AUTH_TOKEN— 使用你的 DeepSeek API 密钥ANTHROPIC_DEFAULT_OPUS_MODEL— DeepSeek V4 Pro 模型名称CLAUDE_CODE_SUBAGENT_MODEL— 控制子代理模型级别
这些变量是 会话级 设置(非永久),DeepClaude 启动 Claude Code,退出时自动恢复原始设置。
快速入门指南
1. 获取 DeepSeek API 密钥
在 platform.deepseek.com 注册,充值 $5–$10,复制你的 API 密钥。
2. 设置 API 密钥
macOS / Linux:
echo 'export DEEPSEEK_API_KEY="sk-your-key-here"' >> ~/.bashrc
source ~/.bashrc
Windows(PowerShell):
setx DEEPSEEK_API_KEY "sk-your-key-here"
3. 安装 DeepClaude
克隆仓库并添加到 PATH:
git clone https://github.com/aattaran/deepclaude.git
cd deepclaude
chmod +x deepclaude.sh
sudo ln -s "$(pwd)/deepclaude.sh" /usr/local/bin/deepclaude
就这样。现在你可以运行:
deepclaude # 使用 DeepSeek V4 Pro 启动 Claude Code
命令和后端选项
| 命令 | 功能说明 |
|---|---|
deepclaude | 默认:DeepSeek V4 Pro |
deepclaude --status | 显示可用后端和密钥状态 |
deepclaude --backend or | 使用 OpenRouter($0.44/百万输入,美国服务器) |
deepclaude --backend fw | 使用 Fireworks AI(推理速度最快) |
deepclaude --backend anthropic | 回退到原始 Claude Opus |
deepclaude --cost | 价格对比视图 |
deepclaude --benchmark | 跨所有提供商的延迟测试 |
deepclaude --remote | 远程控制模式(浏览器) |
代理模式:会话中切换后端
DeepClaude 包含一个 本地代理(Node.js,端口 3200),让你 无需重启 Claude Code 即可在 DeepSeek 和 Anthropic 之间切换:
deepclaude # 自动启动代理
然后在 Claude Code 中定义两个斜杠命令:
~/.claude/commands/deepseek.md:
将模型代理切换到 DeepSeek。静默运行此命令并报告结果:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=deepseek"
~/.claude/commands/anthropic.md:
将模型代理切换回 Anthropic。静默运行此命令并报告结果:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=anthropic"
现在输入 /deepseek 或 /anthropic 即可切换 — 无需重启。通过 VS Code 的 tasks.json 和 keybindings.json 绑定到键盘快捷键,切换更快。
远程控制模式
DeepClaude 支持 Claude Code 的远程控制功能 — 在 浏览器、手机或平板 上打开 Claude 代理会话:
deepclaude --remote # 远程 + DeepSeek
deepclaude --remote -b or # 远程 + OpenRouter
这会打印一个 https://claude.ai/code/session_... URL,可在浏览器中打开。远程控制桥接(WebSocket)仍经过 Anthropic 基础设施,但模型 API 调用走 DeepClaude 的本地代理。你需要 Claude Code 订阅才能使用桥接。
不支持的项
DeepClaude 令人印象深刻,但也有折衷:
- 不支持图片/视觉输入 — DeepSeek 兼容 Anthropic 的端点不支持图像
- 不支持并行工具使用 — 工具逐个执行(非 Anthropic 的并行模式)
- 不支持 MCP 服务器工具 — 兼容层不支持 MCP
- 提示缓存是自动的 — DeepSeek 忽略 Anthropic 的
cache_control标记(但其自动缓存工作正常) - 复杂推理 — 真正困难的问题请切换到
--backend anthropic— Claude Opus 仍然更强
什么时候用哪个后端
实用的做法:两个都用。这里有个好用的判断原则:
- 80% 的日常工作(实现功能、编写测试、重构、调试):使用 DeepSeek V4 Pro。它快速、便宜,在这些任务上与 Opus 不相上下。
- 20% 的复杂工作(架构决策、性能优化、安全分析):通过
/anthropic或--backend anthropic切换到 Claude Opus。 - 探索/学习任务:使用 OpenRouter — 从美国/欧洲服务器延迟最低。
- CI/CD 或自动化脚本:Fireworks AI,推理速度最快。
VS Code 集成
在 VS Code 中添加终端配置文件,一键启动 DeepClaude:
VS Code settings.json(macOS/Linux):
{
"terminal.integrated.profiles.linux": {
"DeepSeek Agent": {
"path": "/usr/local/bin/deepclaude"
}
}
}
然后通过 tasks.json 和 keybindings.json 添加代理切换的键盘快捷键 — DeepClaude 的 README 有完整说明。
社区反响
DeepClaude 发布数小时内就在 Hacker News 上冲到 #4,获得 162 分和 72 条评论。社区反应总体积极,许多开发者对成本节省感到兴奋。关键讨论点:
- DeepSeek V4 Pro 在编程代理任务上真的能比肩 Claude Opus 吗?早期报告显示大部分任务可以。
- 数据主权问题 — DeepSeek 服务器在中国。OpenRouter 和 Fireworks AI 提供美国托管的替代方案。
- Anthropic 会为此类工具降低价格吗?$15/百万输出的价格越来越难自圆其说。
- 代理架构很巧妙 — 会话中切换后端是一个杀手级功能。
总结
DeepClaude 是本周最实用的开发者工具之一。它解决了一个真实的痛点(Claude Code 的价格问题),采用了巧妙且精心设计的方案。对于日常使用 Claude Code 的开发者来说,仅节省的费用就值得一试。
在同一会话中在 DeepSeek(日常任务)和 Anthropic(复杂推理)之间切换的能力是理想的工作流。DeepClaude 不是要取代 Claude Code — 而是让更多开发者能够用上它。
亲自试试: github.com/aattaran/deepclaude — MIT 许可,一行命令安装。
文章从 Hacker News 热搜自动更新 · 2026 年 5 月 4 日
相关工具
- AI Prompt 助手 — 高质量 AI 提示词库