DeepClaude: Use Claude Code's Agent Loop with DeepSeek V4 Pro — 17x Cheaper
Published: 2026-05-04 · 8 min read · GitHub: aattaran/deepclaude
⚡ Trending on Hacker News (162 points, #4) — DeepClaude swaps Claude Code's API backend from Anthropic ($15/M output) to DeepSeek V4 Pro ($0.87/M output) while keeping the full autonomous agent loop intact. Same terminal experience, file editing, bash, and subagent spawning — at 17x lower cost.
What Is DeepClaude?
Claude Code is widely considered the best autonomous coding agent available today. But at $200/month with usage caps, it's expensive — especially for developers who run agent loops all day.
DeepClaude is an open-source tool that intercepts Claude Code's API calls and reroutes them to DeepSeek V4 Pro (or OpenRouter, or Fireworks AI). The result: you keep Claude Code's powerful tool loop (file editing, bash execution, git, subagent spawning) but pay DeepSeek's rates — roughly $20–80/month instead of $200.
DeepSeek V4 Pro scores 96.4% on LiveCodeBench — competitive with Claude Opus for most routine coding tasks. It's not a replacement for Anthropic on complex reasoning, but for 80% of daily work, it's indistinguishable.
Pricing Comparison: DeepClaude vs Anthropic
| Backend | Input / M tokens | Output / M tokens | Servers |
|---|---|---|---|
| DeepSeek V4 Pro (default) | $0.44 | $0.87 | China |
| OpenRouter (DeepSeek) | $0.44 | $0.87 | US |
| Fireworks AI (DeepSeek) | $1.74 | $3.48 | US (fastest) |
| Anthropic Claude Opus | $3.00 | $15.00 | US |
Real-World Monthly Savings
| Usage level | Anthropic Max | DeepClaude (DeepSeek) | Savings |
|---|---|---|---|
| Light (10 days/mo) | $200 | ~$20 | 90% |
| Heavy (25 days/mo) | $200 | ~$50 | 75% |
| Auto loops heavy | $200 | ~$80 | 60% |
DeepSeek's automatic context caching makes agent loops even cheaper — after the first request, system prompts and file context are cached at $0.004/M tokens instead of $0.44/M.
How It Works
DeepClaude's architecture is elegantly simple:
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)
It works by setting environment variables that Claude Code reads at startup:
ANTHROPIC_BASE_URL— rerouted to DeepSeek's Anthropic-compatible endpointANTHROPIC_AUTH_TOKEN— uses your DeepSeek API keyANTHROPIC_DEFAULT_OPUS_MODEL— DeepSeek V4 Pro model nameCLAUDE_CODE_SUBAGENT_MODEL— controls subagent model tier
These variables are set per-session (not permanently), DeepClaude launches Claude Code, and restores your original settings on exit.
Quick Start Guide
1. Get a DeepSeek API Key
Sign up at platform.deepseek.com, add $5–$10 credit, and copy your API key.
2. Set Your API Key
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. Install DeepClaude
Clone the repo and add it to your 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
That's it. Now you can run:
deepclaude # Launch Claude Code with DeepSeek V4 Pro
Commands and Backend Options
| Command | What it does |
|---|---|
deepclaude | Default: DeepSeek V4 Pro |
deepclaude --status | Show available backends and key status |
deepclaude --backend or | Use OpenRouter ($0.44/M input, US servers) |
deepclaude --backend fw | Use Fireworks AI (fastest inference) |
deepclaude --backend anthropic | Fall back to original Claude Opus |
deepclaude --cost | Pricing comparison view |
deepclaude --benchmark | Latency test across all providers |
deepclaude --remote | Remote control mode (browser) |
Proxy Mode: Switch Backends Mid-Session
DeepClaude includes a local proxy (Node.js, port 3200) that lets you switch between DeepSeek and Anthropic without restarting Claude Code:
deepclaude # starts proxy automatically
Then inside Claude Code, define two slash commands:
~/.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"
~/.claude/commands/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"
Now type /deepseek or /anthropic to switch — no restarts needed. Bind to keyboard shortcuts in VS Code via tasks.json and keybindings.json for even faster switching.
Remote Control Mode
DeepClaude supports Claude Code's remote control feature — open a Claude agent session in your browser, phone, or tablet:
deepclaude --remote # Remote + DeepSeek
deepclaude --remote -b or # Remote + OpenRouter
This prints a https://claude.ai/code/session_... URL you can share with your browser. The remote control bridge (WebSocket) still goes through Anthropic infrastructure, but model API calls go through DeepClaude's local proxy. You need a Claude Code subscription for the bridge.
What Doesn't Work
DeepClaude is impressive, but there are trade-offs:
- No image/vision input — DeepSeek's Anthropic-compatible endpoint doesn't support images
- No parallel tool use — tools execute one at a time (not parallel like Anthropic)
- No MCP server tools — the compatibility layer doesn't support MCP
- Prompt caching is automatic — DeepSeek ignores Anthropic's
cache_controlmarkers (but its auto-caching works fine) - Complex reasoning — for truly hard problems, switch to
--backend anthropic— Claude Opus is still stronger
When to Use Which Backend
The pragmatic approach: use both. Here's a good heuristic:
- 80% of daily work (implementing features, writing tests, refactoring, debugging): Use DeepSeek V4 Pro. It's fast, cheap, and comparable to Opus for these tasks.
- 20% of complex work (architecture decisions, performance optimization, security analysis): Switch to Claude Opus via
/anthropicor--backend anthropic. - Exploratory/learning tasks: Use OpenRouter — lowest latency from US/EU servers.
- CI/CD or automated scripts: Fireworks AI for fastest inference.
VS Code Integration
Add a terminal profile in VS Code so you can launch DeepClaude with one click:
VS Code settings.json (macOS/Linux):
{
"terminal.integrated.profiles.linux": {
"DeepSeek Agent": {
"path": "/usr/local/bin/deepclaude"
}
}
}
Then add keyboard shortcuts for proxy switching via tasks.json and keybindings.json — the DeepClaude README has full instructions.
Community Reaction
DeepClaude hit #4 on Hacker News with 162 points and 72 comments within hours of being posted. The community response has been largely positive, with many developers excited about the cost savings. Key discussion points:
- Is DeepSeek V4 Pro really comparable to Claude Opus for agentic coding? Early reports say yes for most tasks.
- Data sovereignty concerns — DeepSeek servers are in China. OpenRouter and Fireworks AI offer US-hosted alternatives.
- Would Anthropic lower prices in response to tools like this? The $15/M output price is increasingly hard to justify.
- The proxy architecture is clever — being able to switch backends mid-session is a killer feature.
Summary
DeepClaude is one of the most practical developer tools to emerge this week. It addresses a real pain point (Claude Code's pricing) with a clever, well-engineered solution. For developers who use Claude Code daily, the savings alone make it worth trying.
The ability to switch between DeepSeek (for routine work) and Anthropic (for complex reasoning) from within the same session is the ideal workflow. DeepClaude isn't about replacing Claude Code — it's about making it accessible to more developers.
Try it yourself: github.com/aattaran/deepclaude — MIT licensed, one-command setup.
Article automatically updated from Hacker News trending · May 4, 2026
相关工具
- AI Prompt 助手 — 高质量 AI 提示词库