deepclaude
Claude Code 의 자율 에이전트 루프를 DeepSeek V4 Pro, OpenRouter 또는 Anthropic 호환 백엔드로 사용하세요. 동일한 UX, 17 배 저렴.
이 것이 하는 일
Claude Code 는 가장 좋은 자율 코딩 에이전트이지만, 사용량 제한이 있고 월 $200 을 비용합니다. DeepSeek V4 Pro 는 LiveCodeBench 에서 96.4% 점수를 얻고 출력 토큰당 $0.87 입니다.
deepclaude 는 머리를 바꾼 채 몸을 유지합니다:
Your terminal
+-- Claude Code CLI (도구 루프, 파일 편집, bash, git - 변경 없음)
+-- API 호출 -> DeepSeek V4 Pro ($0.87/M) 대신 Anthropic ($15/M)
모든 것이 작동합니다: 파일 읽기, 편집, bash 실행, 서브 에이전트 생성, 자율 다단계 코딩 루프. 유일한 차이는 생각하는 모델이 다릅니다.
빠른 시작 (2 분)
1. DeepSeek API 키 받기
platform.deepseek.com 에서 가입하고 $5 크레딧 추가, API 키 복사.
2. 환경 변수 설정
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. 설치
Windows:
# PATH 의 디렉토리에 스크립트 복사
Copy-Item deepclaude.ps1 "$env:USERPROFILE\.local\bin\deepclaude.ps1"
...
macOS/Linux:
chmod +x deepclaude.sh
sudo ln -s "$(pwd)/deepclaude.sh" /usr/local/bin/deepclaude
4. 사용
deepclaude
deepclaude --status
deepclaude --backend or
...
작동 방식
Claude Code 는 API 호출을 어디로 보낼지 결정하기 위해 이 환경 변수를 읽습니다:
| Variable | What it does |
|---|
ANTHROPIC_BASE_URL | API 엔드포인트 (기본값: api.anthropic.com) |
| ... | |
| deepclaude 는 세션별로 이들을 설정합니다 (영구적 아님), Claude Code 를 시작하고 종료 시 원래 설정을 복원합니다. | |
지원되는 백엔드
| Backend | Flag | Input/M | Output/M | Servers | Notes |
|---|
| DeepSeek (기본값) | --backend ds | $0.44 | $0.87 | China | 자동 컨텍스트 캐싱 (반복 턴에서 120 배 저렴) |
| ... | | | | | |
백엔드별 설정
DeepSeek (기본값 - DEEPSEEK_API_KEY 만 필요):
setx DEEPSEEK_API_KEY "sk-..."
export DEEPSEEK_API_KEY="sk-..."
OpenRouter (선택적):
setx OPENROUTER_API_KEY "sk-or-..."
export OPENROUTER_API_KEY="sk-or-..."
Fireworks AI (선택적):
setx FIREWORKS_API_KEY "fw_..."
export FIREWORKS_API_KEY="fw_..."
비용 비교
| Usage level | Anthropic Max | deepclaude (DeepSeek) | Savings |
|---|
| Light (10 days/mo) | $200/mo (capped) | ~$20/mo | 90% |
| ... | | | |
DeepSeek 의 자동 컨텍스트 캐싱은 에이전트 루프를 매우 저렴하게 만듭니다 - 첫 요청 후 시스템 프롬프트와 파일 컨텍스트는 $0.004/M (캐시되지 않은 경우 $0.44/M) 로 캐시됩니다.
작동하는 것과 작동하지 않는 것
Works
- 파일 읽기, 작성, 편집 (Read/Write/Edit 도구)
- Bash/PowerShell 실행
- Glob 및 Grep 검색
- 다단계 자율 도구 루프
- 서브 에이전트 생성
- Git 작업
- 프로젝트 초기화 (
/init)
- Thinking 모드 (기본값으로 활성화됨)
작동하지 않거나 성능 저하
| 기능 | 원인 |
|---|
| 이미지/시각 입력 | DeepSeek 의 Anthropic 엔드포인트는 이미지를 지원하지 않습니다 |
| ... | |
지능 차이
- 루틴 작업 (작업의 80%): DeepSeek V4 Pro 는 Claude Opus 와 유사한 성능을 보입니다.
- 복잡한 추론 (20%): Claude Opus 가 더 강함 -
--backend anthropic 로 전환하세요.
실시간 전환 (재시작 없음)
Anthropic 과 DeepSeek 사이를 세션 중 (mid-session) 에서 전환합니다. Claude Code 내부에서 수행됩니다. 재시작, 터미널 명령어 불필요. 단순히 슬래시 명령어를 입력하면 됩니다.
Claude Code 터미널에서:
Claude Code VS Code 확장 프로그램에서:
작동 원리
프록시는 localhost:3200 에서 실행되며 모든 API 호출을 인터셉트합니다. 제어 엔드포인트 (/_proxy/mode) 를 통해 활성 백엔드를 즉시 전환할 수 있습니다:
Claude Code -> localhost:3200 (프록시)
|
+-- /_proxy/mode POST -> 백엔드 전환
...
옵션 1: 슬래시 명령어 (권장)
~/.claude/commands/ 에 다음 파일을 추가하세요:
deepseek.md:
모델 프록시를 DeepSeek 으로 전환합니다. 이 명령어를 조용히 실행하고 결과를 보고하세요:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=deepseek"
성공 시 다음을 말하세요: "DeepSeek 으로 전환했습니다."
anthropic.md:
모델 프록시를 Anthropic 으로 되돌립니다. 이 명령어를 조용히 실행하고 결과를 보고하세요:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=anthropic"
성공 시 다음을 말하세요: "Anthropic 으로 전환했습니다."
openrouter.md:
모델 프록시를 OpenRouter 로 전환합니다. 이 명령어를 조용히 실행하고 결과를 보고하세요:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=openrouter"
성공 시 다음을 말하세요: "OpenRouter 로 전환했습니다."
그런 후 Claude Code 세션에서 /deepseek, /anthropic, 또는 /openrouter 를 입력하여 즉시 전환할 수 있습니다.
옵션 2: CLI 플래그
deepclaude --switch deepseek
deepclaude -s anthropic
옵션 3: VS Code 키보드 단축키
.vscode/tasks.json 에 추가하세요:
{
"version": "2.0.0",
"tasks": [
...
그런 후 keybindings.json 에서 결합하세요:
{ "key": "ctrl+alt+d", "command": "workbench.action.tasks.runTask", "args": "프록시: DeepSeek 으로 전환" },
{ "key": "ctrl+alt+a", "command": "workbench.action.tasks.runTask", "args": "프록시: Anthropic 으로 전환" }
비용 추적
프록시는 토큰 사용량을 추적하고 Anthropic 가격 대비 절감액을 계산합니다:
curl -s http://127.0.0.1:3200/_proxy/cost
반환값:
{
"backends": {
"deepseek": {
...
VS Code / Cursor 통합
IDE 에서 deepclaude 를 실행할 수 있도록 터미널 프로필을 추가하세요:
설정 > JSON:
{
"terminal.integrated.profiles.windows": {
"DeepSeek Agent": {
...
또는 macOS/Linux 에서:
{
"terminal.integrated.profiles.linux": {
"DeepSeek Agent": {
...
원격 제어 (--remote)
어떤 브라우저에서 Claude Code 세션을 열어 DeepSeek 을 뇌로 사용하세요:
deepclaude --remote
deepclaude --remote -b or
deepclaude --remote -b anthropic
이는 휴대폰, 태블릿 또는 브라우저에서 열 수 있는 https://claude.ai/code/session_... URL 을 출력합니다.
작동 원리
원격 제어를 위해 WebSocket 연결을 위한 Anthropic 의 브릿지가 필요하지만, 모델 호출은 다른 곳으로 갈 수 있습니다. deepclaude 는 로컬 프록시를 시작하여 트래픽을 분할합니다:
claude remote-control
+-- Bridge WebSocket -> wss://bridge.claudeusercontent.com (Anthropic, hardcoded)
+-- Model API calls -> http://localhost:3200 (proxy)
...
Prerequisites
- Must be logged into Claude Code:
claude auth login
- Must have a claude.ai subscription (the bridge is Anthropic infrastructure)
- Node.js 18+ (for the proxy)
The proxy starts automatically and stops when the session ends. See proxy/README.md for technical details.
License
MIT