Giới thiệu
Claude Code là agent coding tốt nhất hiện tại — nhưng giá $200/mo và có usage cap. DeepSeek V4 Pro đạt 96.4% trên LiveCodeBench với cost $0.87/M output tokens.
deepclaude swap bộ não nhưng giữ nguyên cơ thể:
Terminal của bạn
└── Claude Code CLI (tool loop, file edit, bash, git — không đổi)
└── API call → DeepSeek V4 Pro ($0.87/M) thay vì Anthropic ($15/M)
Mọi thứ vẫn chạy: file read, edit, bash, subagent spawn, autonomous multi-step coding loop. Khác biệt duy nhất là model nào đang “think”.
Cách dùng (2 phút)
1. Lấy DeepSeek API key
Đăng ký tại platform.deepseek.com, nạp $5 credit, copy API key.
2. Set env var
macOS/Linux:
echo 'export DEEPSEEK_API_KEY="sk-your-key-here"' >> ~/.bashrc
source ~/.bashrc
3. Cài đặt
chmod +x deepclaude.sh
sudo ln -s "$(pwd)/deepclaude.sh" /usr/local/bin/deepclaude
4. Chạy
deepclaude # Launch Claude Code với DeepSeek V4 Pro
deepclaude --status # Show backend và key đang có
deepclaude --backend or # Dùng OpenRouter (rẻ nhất, $0.44/M input)
deepclaude --backend fw # Dùng Fireworks AI (nhanh nhất, server US)
deepclaude --backend anthropic # Claude Code bình thường (khi cần Opus)
deepclaude --cost # So pricing
deepclaude --benchmark # Latency test các provider
Cách hoạt động
Claude Code đọc các env var sau để quyết định gửi API call đi đâu:
| Variable | Tác dụng |
|---|---|
ANTHROPIC_BASE_URL | API endpoint (default: api.anthropic.com) |
ANTHROPIC_AUTH_TOKEN | API key cho backend |
ANTHROPIC_DEFAULT_OPUS_MODEL | Model name cho task tier Opus |
ANTHROPIC_DEFAULT_SONNET_MODEL | Model name cho task tier Sonnet |
ANTHROPIC_DEFAULT_HAIKU_MODEL | Model name cho task tier Haiku (subagent) |
CLAUDE_CODE_SUBAGENT_MODEL | Model cho subagent spawn |
deepclaude set các var này per-session (không vĩnh viễn), launch Claude Code, restore setting cũ khi exit.
Backend hỗ trợ
| Backend | Flag | Input/M | Output/M | Server | Note |
|---|---|---|---|---|---|
| DeepSeek (default) | --backend ds | $0.44 | $0.87 | China | Auto context cache (rẻ hơn 120x cho turn lặp) |
| OpenRouter | --backend or | $0.44 | $0.87 | US | Rẻ nhất, latency thấp nhất từ US/EU |
| Fireworks AI | --backend fw | $1.74 | $3.48 | US | Inference nhanh nhất |
| Anthropic | --backend anthropic | $3.00 | $15.00 | US | Claude Opus gốc (cho problem khó) |
DeepSeek có automatic context caching — agent loop cực rẻ vì sau request đầu, system prompt và file context được cache ở $0.004/M (so $0.44/M nếu uncached).
So sánh cost
| Mức dùng | Anthropic Max | deepclaude (DeepSeek) | Tiết kiệm |
|---|---|---|---|
| Light (10 ngày/tháng) | $200/mo (cap) | ~$20/mo | 90% |
| Heavy (25 ngày/tháng) | $200/mo (cap) | ~$50/mo | 75% |
| Có auto loop | $200/mo (cap) | ~$80/mo | 60% |
Cái gì work, cái gì không
Work
- File read, write, edit (Read/Write/Edit tools)
- Bash/PowerShell execution
- Glob và Grep search
- Multi-step autonomous tool loop
- Subagent spawning
- Git operations
- Project init (
/init) - Thinking mode (mặc định bật)
Không work hoặc giảm chất lượng
| Feature | Lý do |
|---|---|
| Image/vision input | Anthropic endpoint của DeepSeek không support image |
| Parallel tool use | Disabled — tool execute tuần tự |
| MCP server tools | Không support qua compatibility layer |
| Prompt caching savings | DeepSeek có cache riêng (auto), nhưng cache_control của Anthropic bị ignore |
Khác biệt intelligence
- Task routine (80% công việc): DeepSeek V4 Pro tương đương Claude Opus
- Reasoning phức tạp (20%): Claude Opus mạnh hơn — switch bằng
--backend anthropic
Tích hợp VS Code / Cursor
Thêm terminal profile vào IDE:
{
"terminal.integrated.profiles.linux": {
"DeepSeek Agent": {
"path": "/usr/local/bin/deepclaude"
}
}
}
Remote control (--remote)
Mở Claude Code session trên browser bất kỳ — vẫn dùng DeepSeek làm bộ não:
deepclaude --remote # Remote control + DeepSeek
deepclaude --remote -b or # Remote control + OpenRouter
deepclaude --remote -b anthropic # Remote control + Anthropic (bình thường)
Lệnh này print URL https://claude.ai/code/session_... mở được trên phone, tablet, browser bất kỳ.
Cách work
Remote control cần bridge WebSocket của Anthropic, nhưng model call đi đâu cũng được. deepclaude khởi local proxy split traffic:
claude remote-control
├── Bridge WebSocket → wss://bridge.claudeusercontent.com (Anthropic, hardcoded)
└── Model API call → http://localhost:3200 (proxy)
├── /v1/messages → DeepSeek ($0.87/M)
└── còn lại → Anthropic (passthrough)
Yêu cầu
- Phải login Claude Code:
claude auth login - Cần subscription claude.ai (bridge là hạ tầng Anthropic)
- Node.js 18+ (cho proxy)
Proxy auto-start khi chạy và stop khi session end.
License
MIT.