Model or dataset
aattaran/deepclaude avatar
aattaran/deepclaude

deepclaude: running Claude Code's agent loop on DeepSeek V4 Pro

Use Claude Code's autonomous agent loop with DeepSeek V4 Pro, OpenRouter, or any Anthropic-compatible backend. Same UX, 17x cheaper.

2,256 stars158 forksJavaScriptMIT

At a glance

What is it?
The repository keeps Claude Code's tool loop and shell scripts intact and redirects the API calls underneath it. The trade is cost against vision, MCP and prompt caching.
Who is it for?
Adopt it if you already run Claude Code daily, your work is text-only editing, bash and git, and you want the same tool loop at DeepSeek's per-token rates. Do not adopt it if your sessions depend on image input, MCP server tools, or Anthropic's cache_control behaviour, because the README lists all three as degraded or absent.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 57 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 17, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The problem deepclaude solves, and for whom

The README frames the trade in one line: Claude Code is described as the best autonomous coding agent, but it costs $200 per month with usage caps. deepclaude exists to keep the agent and replace the model behind it. The repository's own diagram shows the split clearly. Your terminal runs the Claude Code CLI, which still owns the tool loop, file editing, bash and git. Only the API calls change destination, going to DeepSeek V4 Pro instead of Anthropic.

The intended reader is someone who already has Claude Code installed and is comfortable editing shell configuration. There is no package to install and no server to run in the cloud. The deliverable is two launcher scripts, deepclaude.sh and deepclaude.ps1, plus a proxy directory. If you have never set an environment variable or added a directory to PATH, the setup steps will be the hard part rather than the tool itself.

How the proxy on localhost:3200 redirects the model

Claude Code decides where to send requests by reading environment variables, and the README lists them: ANTHROPIC_BASE_URL for the endpoint, ANTHROPIC_AUTH_TOKEN for the key, and the three tier variables ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL, plus CLAUDE_CODE_SUBAGENT_MODEL for spawned subagents. deepclaude sets these for the session, launches Claude Code, and restores the previous values on exit. That restore step matters: it means the change does not survive the session unless you go through the launcher again.

The live switching feature uses a second layer. A proxy listens on localhost:3200 and intercepts API calls. Requests to /v1/messages go to the active backend, while everything else is passed through to Anthropic unchanged. Three control endpoints sit alongside: POST /_proxy/mode to change the backend, GET /_proxy/status for the current backend and uptime, and GET /_proxy/cost for token usage and cost savings. The README's recommended way to switch mid-session is a set of slash command files placed in ~/.claude/commands/, each of which curls the mode endpoint with a backend name. Because the switch is a plain HTTP POST, it works from the Claude Code terminal and from the VS Code extension.

The caching story is worth reading carefully, because it is where the cost model actually lives. DeepSeek applies its own automatic context caching, which the README says makes repeat turns roughly 120 times cheaper on cached context, at $0.004 per million tokens against $0.44 uncached. Anthropic's cache_control directive is ignored by the compatibility layer, so you get DeepSeek's caching instead of Anthropic's. The two are not interchangeable, and the README does not claim they are.

Installing deepclaude and running a first session

Start by getting a DeepSeek API key from platform.deepseek.com and adding credit. Then export it. The README gives separate commands for Windows and for macOS and Linux.

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

On Windows the equivalent is a PowerShell command that sets the variable persistently.

powershell
setx DEEPSEEK_API_KEY "sk-your-key-here"

Installation is a symlink on macOS and Linux, or a copy into a directory already on PATH on Windows. The macOS and Linux path is the shorter of the two.

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

Once the symlink exists, running deepclaude with no arguments launches Claude Code against DeepSeek V4 Pro. The README suggests checking the setup before trusting it, and --status is the command for that: it lists available backends and whether their keys are visible. Two other flags are useful on the first day. --cost prints the pricing comparison, and --benchmark runs a latency test across all providers, which is the only way to find out whether a given provider is fast enough from your network before you blame the model for slow edits.

bash
deepclaude --status
deepclaude --cost
deepclaude --benchmark
deepclaude --backend or

The fourth line switches to OpenRouter, which the README lists as the cheapest option with the lowest latency from the US and EU. Backend flags are ds for DeepSeek, or for OpenRouter, fw for Fireworks AI, and anthropic to go back to normal Claude Code. The --switch flag is documented as changing the backend mid-session without a restart, using the same proxy endpoint the slash commands call.

What degrades when the model changes

The README is unusually direct here, and the limitations are the most useful part of it. Image and vision input does not work, because DeepSeek's Anthropic endpoint does not support images. MCP server tools are not supported through the compatibility layer. Anthropic's prompt caching directive is ignored. Parallel tool use is a subtler case: DeepSeek supports up to 128 tools per call, but Claude Code sends tools sequentially by default, so the capability exists on one side of the wire and is not exercised on the other.

The README also draws a line on reasoning quality rather than pretending the models are equal. For routine tasks, which it estimates at 80 percent of work, DeepSeek V4 Pro is described as comparable to Claude Opus. For complex reasoning, the remaining 20 percent, Claude Opus is described as stronger, and the suggested remedy is to switch back with --backend anthropic. That is a real workflow constraint: the project assumes you will move between backends during the day, which is why the slash commands exist at all.

There is a cost trap in the same section. The savings table shows roughly $20 per month at light usage, $50 at heavy usage, and $80 when auto loops are running, against a capped $200 Anthropic plan. Those are the README's estimates, not measured results, and they assume the caching behaviour works as described. Long autonomous loops are exactly the case where a misconfigured key or a provider that ignores context caching would push the bill up, so the --cost endpoint is worth checking rather than assuming.

Where deepclaude sits against the alternatives

The most direct alternative is simply running Claude Code against Anthropic and paying the subscription, which the README treats as the correct answer for hard problems. The difference in approach is not a feature list, it is which layer you give up. Staying on Anthropic keeps vision input, MCP tools and cache_control; deepclaude trades all three for a per-token bill that starts at $0.44 per million input and $0.87 per million output on DeepSeek, against $3.00 and $15.00 for Anthropic in the same table.

A second alternative is using a different coding agent that speaks to OpenAI-compatible endpoints natively. That avoids the compatibility layer and its gaps, but it also means giving up the Claude Code tool loop, the file editing behaviour and the slash command surface that deepclaude is built to preserve. The project's whole premise is that the agent is worth keeping and the model is not, so an agent swap is a different decision rather than a cheaper version of the same one.

A third option is OpenRouter, which the README lists at the same per-token prices as DeepSeek but served from US infrastructure. Choosing it is a latency and jurisdiction decision, not a cost one, and switching between the two is a single flag or a slash command.

Maintenance, licence and what the repository does not document

The repository is not archived, and the last push was on 2026-07-23. The licence is MIT, which permits commercial use and modification, and the repository contains a LICENSE file at the top level alongside README.md, the two launcher scripts, the proxy directory and screenshots. Because the project is a set of shell scripts and a local proxy rather than a published package, upgrades mean pulling the repository again and re-running the symlink or copy step, not resolving a version in a lockfile. There are no retrieved releases, so there is no changelog to read before updating.

Several things the README does not cover are worth knowing before you depend on it. There is no documented rollback procedure if a session leaves environment variables in an unexpected state, beyond the statement that deepclaude restores your original settings on exit. The proxy's authentication model is not described, so it is unclear whether anything other than a local process can reach the control endpoints. There is no documented behaviour for concurrent Claude Code sessions sharing one proxy instance. Because the compatibility layer is Anthropic-shaped, anything Anthropic adds to the Messages API that the proxy does not implement will appear as a broken tool rather than a clear error. None of these are reasons to avoid the project, but each is a question to answer from the source before putting it in front of a team.

Editorial conclusion

Adopt it if you already run Claude Code daily, your work is text-only editing, bash and git, and you want the same tool loop at DeepSeek's per-token rates. Do not adopt it if your sessions depend on image input, MCP server tools, or Anthropic's cache_control behaviour, because the README lists all three as degraded or absent. Before committing, run deepclaude --status to confirm which keys are visible, then deepclaude --benchmark against your own repository to see whether the provider latency is acceptable for interactive editing.

Frequently asked questions

What is deepclaude?

It is a set of launcher scripts and a local proxy that point Claude Code's API calls at DeepSeek V4 Pro, OpenRouter, Fireworks AI or Anthropic while keeping the Claude Code tool loop unchanged. The repository describes it as swapping the brain while keeping the body.

How do I install deepclaude on macOS or Linux?

Export DEEPSEEK_API_KEY in your shell profile, make deepclaude.sh executable, and symlink it into a directory on your PATH such as /usr/local/bin/deepclaude. Running deepclaude with no arguments then launches Claude Code against DeepSeek V4 Pro.

Does deepclaude support image input or MCP server tools?

No. The README states that DeepSeek's Anthropic endpoint does not support images, and that MCP server tools are not supported through the compatibility layer. Anthropic's cache_control directive is also ignored in favour of DeepSeek's own automatic caching.

How do I switch between DeepSeek and Anthropic mid-session?

The proxy runs on localhost:3200 and exposes POST /_proxy/mode. The README recommends adding slash command files to ~/.claude/commands/ that curl that endpoint with a backend name, so the switch happens without restarting Claude Code.

How much does deepclaude cost compared with an Anthropic Max plan?

The README's own table estimates about $20 per month at light usage, $50 at heavy usage and $80 with auto loops, against a capped $200 Anthropic plan. DeepSeek's automatic context caching is what makes repeat turns cheap, at $0.004 per million tokens for cached context.

Official sources

  1. aattaran/deepclaude on GitHub
  2. Issues
  3. License: MIT
  4. README
Community notes

Community notes