# deepclaude

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

- Category: Evaluation & Production Ops / Gateways & Routing
- Language: JavaScript
- Licence: MIT
- Repository: https://github.com/aattaran/deepclaude
- Canonical page: https://ai-tldr.dev/tools/deepclaude/
- Updated: 2026-05-03

## In short

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 sits in the Gateways & Routing category of the Evaluation & Production Ops tools and is open-source, written in JavaScript and licensed MIT.

## 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.

1. 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.

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

2. Install the launcher

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

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

3. Launch Claude Code on another backend

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

```bash
deepclaude                      # DeepSeek
deepclaude --backend or         # OpenRouter
deepclaude --backend anthropic  # back to Claude
```

4. 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.

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

## 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

## Version history

- 2026-05-03: 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.
