GitHub Repos intermediate 2 min read May 4, 2026 · Updated May 5, 2026
Public Preview Sign in free for the full digest →

Claude Code's agent loop, 17× cheaper via DeepSeek

“Claude Code charges $15/M output tokens; DeepSeek charges $0.87/M — a 13-commit script exploiting that gap hit 200 HN points overnight.”

Claude Code's agent loop, 17× cheaper via DeepSeek
1 Views
0 Likes
0 Bookmarks
Source · github.com

“"swaps the brain while keeping the body" — aattaran, DeepClaude README (https://github.com/aattaran/deepclaude)”

You know that feeling when you check your Claude Code API bill and realize a single complex coding session burned through your usage cap, or you're paying $200/month but hitting rate limits mid-task? Claude Code charges $15.00 per million output tokens for Opus-tier calls, and its subscription is capped — not unlimited. Switching backends manually means re-exporting environment variables, losing the agent loop you've built muscle memory around, and breaking remote-control mode's split authentication between Anthropic's OAuth bridge and the model API key. You want lower costs without rebuilding your toolchain.

claude-codedeepseekllmdevtoolscost-optimizationcliopen-source

Claude Code checks three environment variables at startup to find its API endpoint. DeepClaude starts a small Node.js server on your computer (port 3200), overrides those variables per session, and acts as a middleman. When Claude Code sends a message, the middleman catches it and forwards it to DeepSeek instead — which speaks the same API format. The clever part is that Claude Code's remote-control feature needs Anthropic's WebSocket bridge for authentication, so DeepClaude passes that specific traffic through to Anthropic untouched while routing all model calls to DeepSeek. When you close the session, the variables reset to their original state.

01
Mid-session backend switching — type /deepseek, /anthropic, or /openrouter inside a running session without restarting, so you escalate to Opus only when a task actually requires it
02
Remote-control mode compatibility — splits Anthropic's OAuth bridge (WebSocket to wss://bridge.claudeusercontent.com) from model API calls, solving the dual-credential problem that breaks naïve env-var overrides
03
Live cost tracking — query http://127.0.0.1:3200/_proxy/cost at any point to get per-backend token counts and Anthropic-equivalent pricing, so you know exactly what you saved
04
Four backend options — DeepSeek V4 Pro ($0.44/M input, $0.87/M output, China-hosted), OpenRouter (same price, US-hosted, lower latency), Fireworks AI ($1.74/M input, $3.48/M output, fastest inference), or Anthropic passthrough
05
DeepSeek auto context caching — per the README, repeat turns cost 120× less through DeepSeek's proprietary caching, compounding savings on long multi-turn coding sessions
06
Zero persistent config change — env vars restore on session exit, leaving your base Claude Code installation and Anthropic credentials completely untouched
Who it’s for

If you use Claude Code daily for coding work and pay the ~$200/month subscription, DeepClaude targets the specific case where you want lower token costs on non-confidential text-only workloads without changing your workflow. Not suitable if your work involves confidential or regulated code (API calls route through China-hosted DeepSeek servers), if you rely on MCP server tools or image/vision input, or if your organization has data residency requirements.

Worth exploring

Worth a trial for personal or non-confidential projects where the cost gap is meaningful and you do not use vision input, MCP tools, or parallel tool calls. Not production-ready: 13 commits, no releases, no CI, one maintainer — a Claude Code update that changes env-var routing could break it silently with no guaranteed repair timeline.

Developer playbook
Tech stack, code snippet, sentiment, alternatives.
PM playbook
Adoption angles, user fit, positioning.
CEO playbook
Traction signals, ROI, build vs buy.
Deep-dive insight
Full long-form analysis, no fluff.
Easy mode
Core idea, fast — when you need the gist.
Pro mode
Technical nuance, edge cases, tradeoffs.
Read the full digest
Go beyond the preview

Deep-dive insight, Easy and Pro modes, plus action playbooks — the full breakdown is one tap away.

Underrated tools. Unfiltered takes.

Read the full digest in the Snaplyze app for deep-dive insight, Easy and Pro modes, and the playbooks you can actually use.

Install Snaplyze →