Hacker News 热门(buzzing.cc 中文翻译)
精选
72AI 编辑部评分,满分 100

DeepClaude - 搭载 DeepSeek V4 Pro 的 Claude Code 代理循环,价格仅为原价的 1/17

2026-05-04 08:13· 104天前· alattaran
AI 导读

DeepClaude项目在GitHub上发布,它是一个结合了DeepSeek V4 Pro模型的Claude代码代理循环工具。该工具的核心优势在于显著降低了使用成本,其价格仅为原Claude方案的1/17,即便宜了约17倍。这一开源方案为开发者提供了一个高性能且极具成本效益的代码生成与处理替代选择。

推荐理由

用 DeepSeek V4 Pro 跑 Claude Code 代理循环,成本直接打到一杯奶茶钱,虽说不一定每个任务都能媲美原版,但便宜成这样还要什么自行车?

正文 · AI 翻译

deepclaude

将 Claude Code 的自主智能体循环与 DeepSeek V4 Pro、OpenRouter 或任何兼容 Anthropic 的后端配合使用。相同的用户体验,成本降低 17 倍。

它的作用

Claude Code 是最好的自主编程智能体——但每月需花费 200 美元且有使用上限。DeepSeek V4 Pro 在 LiveCodeBench 上得分 96.4%,输出 token 成本为每百万个 0.87 美元。

deepclaude 在保留躯体的同时替换了大脑:

Your terminal
  +-- Claude Code CLI (tool loop, file editing, bash, git - unchanged)
        +-- API calls -> DeepSeek V4 Pro ($0.87/M) instead of Anthropic ($15/M)

一切功能正常:文件读取、编辑、bash 执行、子智能体生成、自主多步编程循环。唯一的区别是哪个模型在进行思考。

快速开始(2 分钟)

1. 获取 DeepSeek API 密钥

在 platform.deepseek.com 注册,充值 5 美元,复制你的 API 密钥。

2. 设置环境变量

Windows(PowerShell):

setx DEEPSEEK_API_KEY "sk-your-key-here"

macOS/Linux:

echo 'export DEEPSEEK_API_KEY="sk-your-key-here"' >> ~/.bashrc
source ~/.bashrc

3. 安装

Windows:

# Copy the script to a directory in your PATH
Copy-Item deepclaude.ps1 "$env:USERPROFILE\.local\bin\deepclaude.ps1"

# Or add the repo directory to PATH
setx PATH "$env:PATH;C:\path\to\deepclaude"

macOS/Linux:

chmod +x deepclaude.sh
sudo ln -s "$(pwd)/deepclaude.sh" /usr/local/bin/deepclaude

4. 使用它

deepclaude                  # Launch Claude Code with DeepSeek V4 Pro
deepclaude --status         # Show available backends and keys
deepclaude --backend or     # Use OpenRouter (cheapest, $0.44/M input)
deepclaude --backend fw     # Use Fireworks AI (fastest, US servers)
deepclaude --backend anthropic  # Normal Claude Code (when you need Opus)
deepclaude --cost           # Show pricing comparison
deepclaude --benchmark      # Latency test across all providers
deepclaude --switch ds      # Switch backend mid-session (no restart)

工作原理

Claude Code 读取这些环境变量以确定将 API 调用发送到哪里:

变量 作用
ANTHROPIC_BASE_URL API 端点(默认:api.anthropic.com)
ANTHROPIC_AUTH_TOKEN 后端的 API 密钥
ANTHROPIC_DEFAULT_OPUS_MODEL Opus 级别任务的模型名称
ANTHROPIC_DEFAULT_SONNET_MODEL Sonnet 级别任务的模型名称
ANTHROPIC_DEFAULT_HAIKU_MODEL Haiku 级别任务(子智能体)的模型名称
CLAUDE_CODE_SUBAGENT_MODEL 生成的子智能体所使用的模型

deepclaude 会按会话设置这些变量(非永久性),启动 Claude Code,然后在退出时恢复你的原始设置。

支持的后端

后端 标志 输入/M 输出/M 服务器 备注
DeepSeek(默认) --backend ds $0.44 $0.87 中国 自动上下文缓存(重复轮次成本降低 120 倍)
OpenRouter --backend or $0.44 $0.87 美国 最便宜,从美国/欧洲延迟最低
Fireworks AI --backend fw $1.74 $3.48 美国 最快的推理
Anthropic --backend anthropic $3.00 $15.00 美国 原始 Claude Opus(用于困难问题)

各后端设置

DeepSeek(默认——仅需 DEEPSEEK_API_KEY):

setx DEEPSEEK_API_KEY "sk-..."           # Windows
export DEEPSEEK_API_KEY="sk-..."         # macOS/Linux

OpenRouter(可选):

setx OPENROUTER_API_KEY "sk-or-..."      # Windows
export OPENROUTER_API_KEY="sk-or-..."    # macOS/Linux

Fireworks AI(可选):

setx FIREWORKS_API_KEY "fw_..."          # Windows
export FIREWORKS_API_KEY="fw_..."        # macOS/Linux

成本对比

使用级别 Anthropic Max deepclaude(DeepSeek) 节省
轻度(每月 10 天) $200/月(有上限) ~$20/月 90%
重度(每月 25 天) $200/月(有上限) ~$50/月 75%
使用自动循环 $200/月(有上限) ~$80/月 60%

DeepSeek 的自动上下文缓存使智能体循环变得极其便宜——在首次请求之后,系统提示词和文件上下文会被缓存,成本为每百万个 token $0.004(相比之下,未缓存时为 $0.44/M)。

哪些功能可用,哪些不可用

可用功能

  • 文件读取、写入、编辑(读/写/编辑工具)
  • Bash/PowerShell 执行
  • Glob 和 Grep 搜索
  • 多步骤自主工具循环
  • 子智能体生成
  • Git 操作
  • 项目初始化(/init)
  • 思考模式(默认开启)

无法工作或性能下降

功能 原因
图像/视觉输入 DeepSeek 的 Anthropic 端点不支持图像
并行工具使用 DeepSeek 支持(每次调用最多 128 个),但 Claude Code 默认按顺序发送工具
MCP 服务器工具 通过兼容层不支持
提示词缓存节省 DeepSeek 有自己的缓存(自动),但 Anthropic 的 cache_control 被忽略

智能水平差异

  • 常规任务(80% 的工作):DeepSeek V4 Pro 与 Claude Opus 相当
  • 复杂推理(20%):Claude Opus 更强——使用 --backend anthropic 切换

实时切换(无需重启)

在会话中实时切换 Anthropic 和 DeepSeek——从 Claude Code 内部即可完成。无需重启,无需终端命令。只需输入一个斜杠命令。

在 Claude Code 终端中:

在 Claude Code VS Code 扩展中:

工作原理

代理运行在 localhost:3200 上,拦截所有 API 调用。一个控制端点(/_proxy/mode)让您可以即时切换活跃的后端:

Claude Code -> localhost:3200 (proxy)
                 |
                 +-- /_proxy/mode POST -> switch backend
                 +-- /_proxy/status GET -> current backend + uptime
                 +-- /_proxy/cost GET -> token usage + cost savings
                 |
                 +-- /v1/messages -> active backend (DeepSeek/OpenRouter/Anthropic)
                 +-- everything else -> Anthropic (passthrough)

选项 1:斜杠命令(推荐)

将这些文件添加到 ~/.claude/commands/:

deepseek.md:

Switch the model proxy to DeepSeek. Run this command silently and report the result:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=deepseek"
If successful, say: "Switched to DeepSeek."

anthropic.md:

Switch the model proxy back to Anthropic. Run this command silently and report the result:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=anthropic"
If successful, say: "Switched to Anthropic."

openrouter.md:

Switch the model proxy to OpenRouter. Run this command silently and report the result:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=openrouter"
If successful, say: "Switched to OpenRouter."

然后在任意 Claude Code 会话中输入 /deepseek、/anthropic 或 /openrouter 即可即时切换。

选项 2:CLI 标志

deepclaude --switch deepseek    # or: ds, or, fw, anthropic
deepclaude -s anthropic

选项 3:VS Code 键盘快捷键

添加到 .vscode/tasks.json:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Proxy: Switch to DeepSeek",
      "type": "shell",
      "command": "Invoke-RestMethod -Uri http://127.0.0.1:3200/_proxy/mode -Method Post -Body 'backend=deepseek'",
      "presentation": { "reveal": "always" },
      "problemMatcher": []
    },
    {
      "label": "Proxy: Switch to Anthropic",
      "type": "shell",
      "command": "Invoke-RestMethod -Uri http://127.0.0.1:3200/_proxy/mode -Method Post -Body 'backend=anthropic'",
      "presentation": { "reveal": "always" },
      "problemMatcher": []
    }
  ]
}

然后在 keybindings.json 中绑定:

{ "key": "ctrl+alt+d", "command": "workbench.action.tasks.runTask", "args": "Proxy: Switch to DeepSeek" },
{ "key": "ctrl+alt+a", "command": "workbench.action.tasks.runTask", "args": "Proxy: Switch to Anthropic" }

成本追踪

代理追踪 token 使用量,并计算与 Anthropic 定价相比的节省:

curl -s http://127.0.0.1:3200/_proxy/cost

返回:

{
  "backends": {
    "deepseek": {
      "input_tokens": 125000,
      "output_tokens": 45000,
      "requests": 12,
      "cost": 0.0941,
      "anthropic_equivalent": 1.05
    }
  },
  "total_cost": 0.0941,
  "anthropic_equivalent": 1.05,
  "savings": 0.9559
}

VS Code / Cursor 集成

添加终端配置文件,以便您可以从 IDE 启动 deepclaude:

设置 > JSON:

{
  "terminal.integrated.profiles.windows": {
    "DeepSeek Agent": {
      "path": "powershell.exe",
      "args": ["-ExecutionPolicy", "Bypass", "-NoExit", "-File", "C:\\path\\to\\deepclaude.ps1"]
    }
  }
}

或在 macOS/Linux 上:

{
  "terminal.integrated.profiles.linux": {
    "DeepSeek Agent": {
      "path": "/usr/local/bin/deepclaude"
    }
  }
}

远程控制(--remote)

在任何浏览器中打开一个 Claude Code 会话——以 DeepSeek 作为大脑:

deepclaude --remote                # Remote control + DeepSeek
deepclaude --remote -b or          # Remote control + OpenRouter
deepclaude --remote -b anthropic   # Remote control + Anthropic (normal)

这会打印一个 https://claude.ai/code/session_... URL,您可以在手机、平板或任何浏览器上打开。

工作原理

远程控制需要 Anthropic 的桥接来建立 WebSocket 连接,但模型调用可以指向其他地方。deepclaude 启动一个本地代理来分流流量:

claude remote-control
  +-- Bridge WebSocket -> wss://bridge.claudeusercontent.com (Anthropic, hardcoded)
  +-- Model API calls  -> http://localhost:3200 (proxy)
                            +-- /v1/messages -> DeepSeek ($0.87/M)
                            +-- everything else -> Anthropic (passthrough)

前提条件

  • 必须登录到 Claude Code:claude auth login
  • 必须拥有 claude.ai 订阅(该桥接基于 Anthropic 基础设施)
  • Node.js 18+(用于代理)

代理会自动启动,并在会话结束时停止。技术细节请参见 proxy/README.md。

许可证

关于

将 Claude Code 的自主智能体循环与 DeepSeek V4 Pro、OpenRouter 或任何兼容 Anthropic 的后端配合使用。相同的用户体验,成本降低 17 倍。

资源

许可证

星标

2.1k

关注者

复刻

发布版本

软件包

贡献者

编程语言

  • JavaScript 50.9%
  • PowerShell 25.2%
  • Shell 23.9%

来源:Hacker News 热门(buzzing.cc 中文翻译) · github.com

DeepClaude - 搭载 DeepSeek V4 Pro 的 Claude Code 代理循环,价格仅为原价的 1/17

Hacker News 热门(buzzing.cc 中文翻译)·2026-05-04 08:13·104天前·alattaran
AI 导读

DeepClaude项目在GitHub上发布,它是一个结合了DeepSeek V4 Pro模型的Claude代码代理循环工具。该工具的核心优势在于显著降低了使用成本,其价格仅为原Claude方案的1/17,即便宜了约17倍。这一开源方案为开发者提供了一个高性能且极具成本效益的代码生成与处理替代选择。

正文 · AI 翻译

deepclaude

将 Claude Code 的自主智能体循环与 DeepSeek V4 Pro、OpenRouter 或任何兼容 Anthropic 的后端配合使用。相同的用户体验,成本降低 17 倍。

它的作用

Claude Code 是最好的自主编程智能体——但每月需花费 200 美元且有使用上限。DeepSeek V4 Pro 在 LiveCodeBench 上得分 96.4%,输出 token 成本为每百万个 0.87 美元。

deepclaude 在保留躯体的同时替换了大脑:

Your terminal
  +-- Claude Code CLI (tool loop, file editing, bash, git - unchanged)
        +-- API calls -> DeepSeek V4 Pro ($0.87/M) instead of Anthropic ($15/M)

一切功能正常:文件读取、编辑、bash 执行、子智能体生成、自主多步编程循环。唯一的区别是哪个模型在进行思考。

快速开始(2 分钟)

1. 获取 DeepSeek API 密钥

在 platform.deepseek.com 注册,充值 5 美元,复制你的 API 密钥。

2. 设置环境变量

Windows(PowerShell):

setx DEEPSEEK_API_KEY "sk-your-key-here"

macOS/Linux:

echo 'export DEEPSEEK_API_KEY="sk-your-key-here"' >> ~/.bashrc
source ~/.bashrc

3. 安装

Windows:

# Copy the script to a directory in your PATH
Copy-Item deepclaude.ps1 "$env:USERPROFILE\.local\bin\deepclaude.ps1"

# Or add the repo directory to PATH
setx PATH "$env:PATH;C:\path\to\deepclaude"

macOS/Linux:

chmod +x deepclaude.sh
sudo ln -s "$(pwd)/deepclaude.sh" /usr/local/bin/deepclaude

4. 使用它

deepclaude                  # Launch Claude Code with DeepSeek V4 Pro
deepclaude --status         # Show available backends and keys
deepclaude --backend or     # Use OpenRouter (cheapest, $0.44/M input)
deepclaude --backend fw     # Use Fireworks AI (fastest, US servers)
deepclaude --backend anthropic  # Normal Claude Code (when you need Opus)
deepclaude --cost           # Show pricing comparison
deepclaude --benchmark      # Latency test across all providers
deepclaude --switch ds      # Switch backend mid-session (no restart)

工作原理

Claude Code 读取这些环境变量以确定将 API 调用发送到哪里:

变量 作用
ANTHROPIC_BASE_URL API 端点(默认:api.anthropic.com)
ANTHROPIC_AUTH_TOKEN 后端的 API 密钥
ANTHROPIC_DEFAULT_OPUS_MODEL Opus 级别任务的模型名称
ANTHROPIC_DEFAULT_SONNET_MODEL Sonnet 级别任务的模型名称
ANTHROPIC_DEFAULT_HAIKU_MODEL Haiku 级别任务(子智能体)的模型名称
CLAUDE_CODE_SUBAGENT_MODEL 生成的子智能体所使用的模型

deepclaude 会按会话设置这些变量(非永久性),启动 Claude Code,然后在退出时恢复你的原始设置。

支持的后端

后端 标志 输入/M 输出/M 服务器 备注
DeepSeek(默认) --backend ds $0.44 $0.87 中国 自动上下文缓存(重复轮次成本降低 120 倍)
OpenRouter --backend or $0.44 $0.87 美国 最便宜,从美国/欧洲延迟最低
Fireworks AI --backend fw $1.74 $3.48 美国 最快的推理
Anthropic --backend anthropic $3.00 $15.00 美国 原始 Claude Opus(用于困难问题)

各后端设置

DeepSeek(默认——仅需 DEEPSEEK_API_KEY):

setx DEEPSEEK_API_KEY "sk-..."           # Windows
export DEEPSEEK_API_KEY="sk-..."         # macOS/Linux

OpenRouter(可选):

setx OPENROUTER_API_KEY "sk-or-..."      # Windows
export OPENROUTER_API_KEY="sk-or-..."    # macOS/Linux

Fireworks AI(可选):

setx FIREWORKS_API_KEY "fw_..."          # Windows
export FIREWORKS_API_KEY="fw_..."        # macOS/Linux

成本对比

使用级别 Anthropic Max deepclaude(DeepSeek) 节省
轻度(每月 10 天) $200/月(有上限) ~$20/月 90%
重度(每月 25 天) $200/月(有上限) ~$50/月 75%
使用自动循环 $200/月(有上限) ~$80/月 60%

DeepSeek 的自动上下文缓存使智能体循环变得极其便宜——在首次请求之后,系统提示词和文件上下文会被缓存,成本为每百万个 token $0.004(相比之下,未缓存时为 $0.44/M)。

哪些功能可用,哪些不可用

可用功能

  • 文件读取、写入、编辑(读/写/编辑工具)
  • Bash/PowerShell 执行
  • Glob 和 Grep 搜索
  • 多步骤自主工具循环
  • 子智能体生成
  • Git 操作
  • 项目初始化(/init)
  • 思考模式(默认开启)

无法工作或性能下降

功能 原因
图像/视觉输入 DeepSeek 的 Anthropic 端点不支持图像
并行工具使用 DeepSeek 支持(每次调用最多 128 个),但 Claude Code 默认按顺序发送工具
MCP 服务器工具 通过兼容层不支持
提示词缓存节省 DeepSeek 有自己的缓存(自动),但 Anthropic 的 cache_control 被忽略

智能水平差异

  • 常规任务(80% 的工作):DeepSeek V4 Pro 与 Claude Opus 相当
  • 复杂推理(20%):Claude Opus 更强——使用 --backend anthropic 切换

实时切换(无需重启)

在会话中实时切换 Anthropic 和 DeepSeek——从 Claude Code 内部即可完成。无需重启,无需终端命令。只需输入一个斜杠命令。

在 Claude Code 终端中:

在 Claude Code VS Code 扩展中:

工作原理

代理运行在 localhost:3200 上,拦截所有 API 调用。一个控制端点(/_proxy/mode)让您可以即时切换活跃的后端:

Claude Code -> localhost:3200 (proxy)
                 |
                 +-- /_proxy/mode POST -> switch backend
                 +-- /_proxy/status GET -> current backend + uptime
                 +-- /_proxy/cost GET -> token usage + cost savings
                 |
                 +-- /v1/messages -> active backend (DeepSeek/OpenRouter/Anthropic)
                 +-- everything else -> Anthropic (passthrough)

选项 1:斜杠命令(推荐)

将这些文件添加到 ~/.claude/commands/:

deepseek.md:

Switch the model proxy to DeepSeek. Run this command silently and report the result:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=deepseek"
If successful, say: "Switched to DeepSeek."

anthropic.md:

Switch the model proxy back to Anthropic. Run this command silently and report the result:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=anthropic"
If successful, say: "Switched to Anthropic."

openrouter.md:

Switch the model proxy to OpenRouter. Run this command silently and report the result:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=openrouter"
If successful, say: "Switched to OpenRouter."

然后在任意 Claude Code 会话中输入 /deepseek、/anthropic 或 /openrouter 即可即时切换。

选项 2:CLI 标志

deepclaude --switch deepseek    # or: ds, or, fw, anthropic
deepclaude -s anthropic

选项 3:VS Code 键盘快捷键

添加到 .vscode/tasks.json:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Proxy: Switch to DeepSeek",
      "type": "shell",
      "command": "Invoke-RestMethod -Uri http://127.0.0.1:3200/_proxy/mode -Method Post -Body 'backend=deepseek'",
      "presentation": { "reveal": "always" },
      "problemMatcher": []
    },
    {
      "label": "Proxy: Switch to Anthropic",
      "type": "shell",
      "command": "Invoke-RestMethod -Uri http://127.0.0.1:3200/_proxy/mode -Method Post -Body 'backend=anthropic'",
      "presentation": { "reveal": "always" },
      "problemMatcher": []
    }
  ]
}

然后在 keybindings.json 中绑定:

{ "key": "ctrl+alt+d", "command": "workbench.action.tasks.runTask", "args": "Proxy: Switch to DeepSeek" },
{ "key": "ctrl+alt+a", "command": "workbench.action.tasks.runTask", "args": "Proxy: Switch to Anthropic" }

成本追踪

代理追踪 token 使用量,并计算与 Anthropic 定价相比的节省:

curl -s http://127.0.0.1:3200/_proxy/cost

返回:

{
  "backends": {
    "deepseek": {
      "input_tokens": 125000,
      "output_tokens": 45000,
      "requests": 12,
      "cost": 0.0941,
      "anthropic_equivalent": 1.05
    }
  },
  "total_cost": 0.0941,
  "anthropic_equivalent": 1.05,
  "savings": 0.9559
}

VS Code / Cursor 集成

添加终端配置文件,以便您可以从 IDE 启动 deepclaude:

设置 > JSON:

{
  "terminal.integrated.profiles.windows": {
    "DeepSeek Agent": {
      "path": "powershell.exe",
      "args": ["-ExecutionPolicy", "Bypass", "-NoExit", "-File", "C:\\path\\to\\deepclaude.ps1"]
    }
  }
}

或在 macOS/Linux 上:

{
  "terminal.integrated.profiles.linux": {
    "DeepSeek Agent": {
      "path": "/usr/local/bin/deepclaude"
    }
  }
}

远程控制(--remote)

在任何浏览器中打开一个 Claude Code 会话——以 DeepSeek 作为大脑:

deepclaude --remote                # Remote control + DeepSeek
deepclaude --remote -b or          # Remote control + OpenRouter
deepclaude --remote -b anthropic   # Remote control + Anthropic (normal)

这会打印一个 https://claude.ai/code/session_... URL,您可以在手机、平板或任何浏览器上打开。

工作原理

远程控制需要 Anthropic 的桥接来建立 WebSocket 连接,但模型调用可以指向其他地方。deepclaude 启动一个本地代理来分流流量:

claude remote-control
  +-- Bridge WebSocket -> wss://bridge.claudeusercontent.com (Anthropic, hardcoded)
  +-- Model API calls  -> http://localhost:3200 (proxy)
                            +-- /v1/messages -> DeepSeek ($0.87/M)
                            +-- everything else -> Anthropic (passthrough)

前提条件

  • 必须登录到 Claude Code:claude auth login
  • 必须拥有 claude.ai 订阅(该桥接基于 Anthropic 基础设施)
  • Node.js 18+(用于代理)

代理会自动启动,并在会话结束时停止。技术细节请参见 proxy/README.md。

许可证

关于

将 Claude Code 的自主智能体循环与 DeepSeek V4 Pro、OpenRouter 或任何兼容 Anthropic 的后端配合使用。相同的用户体验,成本降低 17 倍。

资源

许可证

星标

2.1k

关注者

复刻

发布版本

软件包

贡献者

编程语言

  • JavaScript 50.9%
  • PowerShell 25.2%
  • Shell 23.9%

来源:Hacker News 热门(buzzing.cc 中文翻译)· github.com