deepclaude Swaps Claude Opus for DeepSeek V4 Pro at 28x Lower Cost
A tiny shell wrapper reroutes Claude Code's API calls to DeepSeek V4 Pro or OpenRouter, keeping the agent loop while slashing token costs.
Takeaways
- deepclaude wraps Claude Code and reroutes API calls to DeepSeek V4 Pro, OpenRouter, or Fireworks, advertising up to 17x cost savings.
- It works by setting Anthropic-compatible env vars per-session, so the agent loop, tools, and subagents stay unchanged.
- DeepSeek V4 Pro lists at $0.435/M input and $0.87/M output with a 1M-token context window.
- A local proxy on port 3200 tracks cost and lets you switch backends mid-session via slash commands like
/deepseek. - Vision inputs, MCP tools, and Anthropic prompt caching are lost, but DeepSeek's own auto caching covers most agent loops.
- Repo is MIT-licensed at github.com/aattaran/deepclaude with PowerShell and bash launchers.
Claude Code has become the reference implementation for autonomous coding agents, but the $200/month cap and $15 per million output tokens for Opus have priced out a lot of hobbyist and heavy-usage workflows. deepclaude is a small open-source shell wrapper that keeps the entire Claude Code CLI, including its tool loop, file editing, and subagent spawning, and swaps only the model behind the API for a much cheaper Anthropic-compatible backend like DeepSeek V4 Pro, OpenRouter, or Fireworks AI.
The trick works because Claude Code already reads a handful of environment variables (ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and per-tier model name variables) to decide where API traffic goes. deepclaude sets those per-session, launches Claude Code as normal, and restores your original config on exit. Nothing about the agent loop is patched or forked.

The math behind the swap
The economic gap between Anthropic's flagship and open-weight Chinese models has grown large enough to change how you think about agent budgets. DeepSeek V4-Pro runs at $0.435 per million input tokens and $0.87 per million output tokens, while V4-Flash sits at $0.14 in and $0.28 out. Both default to a 1M-token context window with 384K max output.
On coding benchmarks the model is close enough that swapping it in for routine work is defensible. DeepSeek V4-Pro scores 93.5% on LiveCodeBench, 3206 on Codeforces, and 90.1% on GPQA Diamond, and DeepSeek-V4-Pro-Max scores 80.6% on SWE-bench Verified, the highest open-weights entry, tied with Gemini 3.1 Pro. Put those numbers next to Opus pricing and the pitch becomes obvious: per output token, V4-Pro is 28.7x cheaper than Claude Opus 4.8 and 34.5x cheaper than GPT-5.