Back to feed

aattaran/deepclaude

aattaran/deepclaude
1.4k
+54/day
65
JavaScript

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

From the README

deepclaude

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

What this does

Claude Code is the best autonomous coding agent — but it costs $200/month with usage caps. DeepSeek V4 Pro scores 96.4% on LiveCodeBench and costs $0.87/M output tokens.

deepclaude swaps the brain while keeping the body:

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)

Everything works: file reading, editing, bash execution, subagent spawning, autonomous multi-step coding loops. The only difference is which model thinks.

Quick start (2 minutes)

1. Get a DeepSeek API key

Sign up at platform.deepseek.com, add $5 credit, copy your API key.

2. Set environment variables

Windows (PowerShell):

setx DEEPSEEK_API_KEY "sk-your-key-here"

macOS/Linux:

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

3. Install

Windows:

# Copy the script to a directory in your PATH
Copy-Item deepclaude.ps1 "$env:USERPROFILE\.local\bin\deepclaude.ps1"

# Or add the repo directory to PATH
setx PATH "$env:PATH;C:\path\to\deepclaude"

macOS/Linux:

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

4. Use it

deepclaude                  # Launch Claude Code with DeepSeek V4 Pro
deepclaude --status         # Show available backends and keys
deepclaude --backend or     # Use OpenRouter (cheapest, $0.44/M input)
deepclaude --backend fw     # Use Fireworks AI (fastest, US servers)
deepclaude --backend anthropic  # Normal Claude Code (when you need Opus)
deepclaude --cost           # Show pricing comparison
deepclaude --benchmark      # Latency test across all providers
deepclaude --switch ds      # Switch backend mid-session (no restart)

How it works

Claude Code reads these environment variables to determine where to send API calls:

| Variable | What it does | |---|---| | ANTHROPIC_BASE_URL | API endpoint (default: api.anthropic.com) | | ANTHROPIC_AUTH_TOKEN | API key for the backend | | ANTHROPIC_DEFAULT_OPUS_MODEL | Model name for Opus-tier tasks | | ANTHROPIC_DEFAULT_SONNET_MODEL | Model name for Sonnet-tier tasks | | ANTHROPIC_DEFAULT_HAIKU_MODEL | Model name for Haiku-tier (subagents) | | CLAUDE_CODE_SUBAGENT_MODEL | Model for spawned subagents |

deepclaude sets these per-session (not permanently), launches Claude Code, then restores your original settings on exit.

Supported backends

| Backend | Flag | Input/M | Output/M | Servers | Notes | |---|---|---|---|---|---| | DeepSeek (default) | --backend ds | $0.44 | $0.87 | China | Auto context caching (120x cheaper on repeat turns) | | OpenRouter | --backend or | $0.44 | $0.87 | US | Cheapest, lowest latency from U