AI/TLDR

deepclaude

Point Claude Code's agent loop at DeepSeek, OpenRouter or Fireworks and switch backends mid-session

Gateways & RoutingOpen source
Updated
3 May 2026
Language
JavaScript
License
MIT
Coverage
1 story

What's new

3 May 2026

Covered by AI/TLDR: the shim swaps Claude Code's API endpoint for DeepSeek V4 Pro, OpenRouter or Fireworks while keeping file edits, bash, subagents and autonomous loops intact.

Latest news

Overview

deepclaude keeps the Claude Code CLI exactly as it is — the tool loop, file editing, bash execution, subagent spawning — and changes only where the model calls go. It works by setting the environment variables Claude Code reads to decide its endpoint (ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN and the per-tier model names), launching the CLI with them, and restoring your original settings when the session ends. Nothing is written permanently, so a normal `claude` run is unaffected.

Four backends ship out of the box: DeepSeek (the default), OpenRouter, Fireworks AI and Anthropic itself, each selected with a `--backend` flag. The project's own comparison table lists DeepSeek and OpenRouter at $0.44 per million input and $0.87 per million output tokens against Anthropic's $3.00 / $15.00, which is where the README's "17x cheaper" headline comes from.

A second mode runs a local proxy on port 3200 that intercepts `/v1/messages` and passes everything else through to Anthropic. Because the proxy exposes a control endpoint, you can flip the active backend from inside a running session — the README wires it to `/deepseek`, `/anthropic` and `/openrouter` slash commands — and read token usage and accumulated savings from `/_proxy/cost`. The README is explicit about the limits of the compatibility layer: image input, MCP server tools and Anthropic-style `cache_control` prompt caching do not carry over.

What it does

  • Per-session environment shim: launches Claude Code against a different backend without changing your permanent configuration
  • Four backends behind one flag — DeepSeek, OpenRouter, Fireworks AI and Anthropic — plus `--status`, `--cost` and `--benchmark` helpers
  • Local proxy on port 3200 with a control endpoint, so you can switch models mid-session from a slash command instead of restarting
  • Cost tracking: `/_proxy/cost` returns tokens, spend and the Anthropic-equivalent price for the same traffic
  • `--remote` splits traffic so Claude Code's browser remote-control bridge stays on Anthropic while model calls go to the cheap backend
  • Shell scripts for macOS/Linux and PowerShell for Windows, plus VS Code and Cursor terminal-profile snippets

Getting started

deepclaude wraps an existing Claude Code install, so set up the CLI first. The steps below follow the README's two-minute quick start on macOS/Linux; Windows uses `deepclaude.ps1` and `setx` instead.

Set a backend API key

Sign up at platform.deepseek.com and export the key. OPENROUTER_API_KEY and FIREWORKS_API_KEY are optional extras.

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

Install the launcher

Clone the repo, make the script executable and link it onto your PATH.

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

Launch Claude Code on another backend

With no flags you get DeepSeek. `--status` shows which backends have keys, `--cost` prints the pricing comparison.

bashbash
deepclaude                      # DeepSeek
deepclaude --backend or         # OpenRouter
deepclaude --backend anthropic  # back to Claude

Switch backends without restarting

Drop the README's command files into ~/.claude/commands/ and type /deepseek or /anthropic inside a session; each one POSTs to the local proxy.

bashbash
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=deepseek"
curl -s http://127.0.0.1:3200/_proxy/cost

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Run long autonomous coding loops on a cheap model and reserve the expensive one for the hard problems
  • Try a Claude Code workflow against several providers and compare latency with the built-in `--benchmark` mode
  • Keep an audit of what an agent session actually cost, and what the same traffic would have cost on Anthropic
  • Work from a phone or tablet with `--remote` while the model calls run on a lower-cost backend

How deepclaude compares

deepclaude alongside other open-source gateways & routing tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
OmniRoute★ 64.8kA local-first AI gateway that fronts hundreds of model providers with one OpenAI-compatible endpoint, quota-aware auto-fallback, many routing strategies and prompt compression.
LiteLLM★ 58.5kA Python SDK and proxy server that gives one OpenAI-compatible API to 100+ LLM providers, with cost tracking, budgets, fallbacks, rate limiting, and an admin UI.
Free Claude Code★ 54.5kA local proxy that points Claude Code, Codex, Pi, OpenCode, Cline and other agent CLIs at 50 free, paid, subscription or local model providers, with automatic failover and an admin UI.
Kong Gateway★ 44.1kA Lua/NGINX API gateway whose AI Gateway plugins put one universal endpoint in front of OpenAI, Anthropic, Gemini, Bedrock and other providers, with semantic routing, caching and MCP traffic governance.
Apache APISIX★ 17.1kA cloud-native API gateway whose AI plugins add multi-provider LLM proxying, load balancing, retries and fallbacks, token-based rate limiting, and content moderation.
Portkey AI Gateway★ 13kAn LLM gateway that routes calls to 100+ providers through one API and adds logging, tracing, caching, and fallbacks for production AI traffic.
Higress★ 9.4kAn AI-native API gateway built on Istio and Envoy that proxies and governs traffic to many LLM providers, with token rate limiting, caching, and MCP server hosting.
deepclaude★ 2.3kPoint Claude Code's agent loop at DeepSeek, OpenRouter or Fireworks and switch backends mid-session