{"id":49720072,"url":"https://github.com/aattaran/deepclaude","last_synced_at":"2026-05-13T15:00:46.184Z","repository":{"id":355494165,"uuid":"1228306162","full_name":"aattaran/deepclaude","owner":"aattaran","description":"Use Claude Code's autonomous agent loop with DeepSeek V4 Pro, OpenRouter, or any Anthropic-compatible backend. Same UX, 17x cheaper.","archived":false,"fork":false,"pushed_at":"2026-05-03T23:13:46.000Z","size":42,"stargazers_count":32,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-03T23:29:00.135Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aattaran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-03T21:27:49.000Z","updated_at":"2026-05-03T23:28:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aattaran/deepclaude","commit_stats":null,"previous_names":["aattaran/cheapclaude"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/aattaran/deepclaude","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aattaran%2Fdeepclaude","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aattaran%2Fdeepclaude/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aattaran%2Fdeepclaude/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aattaran%2Fdeepclaude/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aattaran","download_url":"https://codeload.github.com/aattaran/deepclaude/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aattaran%2Fdeepclaude/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32987764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-09T00:00:28.506Z","updated_at":"2026-05-13T15:00:46.158Z","avatar_url":"https://github.com/aattaran.png","language":"PowerShell","funding_links":[],"categories":["🤖 Agents \u0026 Orchestration","JavaScript"],"sub_categories":[],"readme":"# deepclaude\n\nUse Claude Code's autonomous agent loop with **DeepSeek V4 Pro**, **OpenRouter**, or any Anthropic-compatible backend. Same UX, 17x cheaper.\n\n![Remote control running DeepSeek V4 Pro in the browser](screenshots/remote-control-deepseek.png)\n\n## What this does\n\nClaude 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.\n\n**deepclaude** swaps the brain while keeping the body:\n\n```\nYour terminal\n  +-- Claude Code CLI (tool loop, file editing, bash, git - unchanged)\n        +-- API calls -\u003e DeepSeek V4 Pro ($0.87/M) instead of Anthropic ($15/M)\n```\n\nEverything works: file reading, editing, bash execution, subagent spawning, autonomous multi-step coding loops. The only difference is which model thinks.\n\n## Quick start (2 minutes)\n\n### 1. Get a DeepSeek API key\n\nSign up at [platform.deepseek.com](https://platform.deepseek.com), add $5 credit, copy your API key.\n\n### 2. Set environment variables\n\n**Windows (PowerShell):**\n```powershell\nsetx DEEPSEEK_API_KEY \"sk-your-key-here\"\n```\n\n**macOS/Linux:**\n```bash\necho 'export DEEPSEEK_API_KEY=\"sk-your-key-here\"' \u003e\u003e ~/.bashrc\nsource ~/.bashrc\n```\n\n### 3. Install\n\n**Windows:**\n```powershell\n# Copy the script to a directory in your PATH\nCopy-Item deepclaude.ps1 \"$env:USERPROFILE\\.local\\bin\\deepclaude.ps1\"\n\n# Or add the repo directory to PATH\nsetx PATH \"$env:PATH;C:\\path\\to\\deepclaude\"\n```\n\n**macOS/Linux:**\n```bash\nchmod +x deepclaude.sh\nsudo ln -s \"$(pwd)/deepclaude.sh\" /usr/local/bin/deepclaude\n```\n\n### 4. Use it\n\n```bash\ndeepclaude                  # Launch Claude Code with DeepSeek V4 Pro\ndeepclaude --status         # Show available backends and keys\ndeepclaude --backend or     # Use OpenRouter (cheapest, $0.44/M input)\ndeepclaude --backend fw     # Use Fireworks AI (fastest, US servers)\ndeepclaude --backend anthropic  # Normal Claude Code (when you need Opus)\ndeepclaude --cost           # Show pricing comparison\ndeepclaude --benchmark      # Latency test across all providers\ndeepclaude --switch ds      # Switch backend mid-session (no restart)\n```\n\n## How it works\n\nClaude Code reads these environment variables to determine where to send API calls:\n\n| Variable | What it does |\n|---|---|\n| `ANTHROPIC_BASE_URL` | API endpoint (default: api.anthropic.com) |\n| `ANTHROPIC_AUTH_TOKEN` | API key for the backend |\n| `ANTHROPIC_DEFAULT_OPUS_MODEL` | Model name for Opus-tier tasks |\n| `ANTHROPIC_DEFAULT_SONNET_MODEL` | Model name for Sonnet-tier tasks |\n| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | Model name for Haiku-tier (subagents) |\n| `CLAUDE_CODE_SUBAGENT_MODEL` | Model for spawned subagents |\n\n**deepclaude** sets these per-session (not permanently), launches Claude Code, then restores your original settings on exit.\n\n## Supported backends\n\n| Backend | Flag | Input/M | Output/M | Servers | Notes |\n|---|---|---|---|---|---|\n| **DeepSeek** (default) | `--backend ds` | $0.44 | $0.87 | China | Auto context caching (120x cheaper on repeat turns) |\n| **OpenRouter** | `--backend or` | $0.44 | $0.87 | US | Cheapest, lowest latency from US/EU |\n| **Fireworks AI** | `--backend fw` | $1.74 | $3.48 | US | Fastest inference |\n| **Anthropic** | `--backend anthropic` | $3.00 | $15.00 | US | Original Claude Opus (for hard problems) |\n\n### Setup per backend\n\n**DeepSeek** (default - just needs `DEEPSEEK_API_KEY`):\n```bash\nsetx DEEPSEEK_API_KEY \"sk-...\"           # Windows\nexport DEEPSEEK_API_KEY=\"sk-...\"         # macOS/Linux\n```\n\n**OpenRouter** (optional):\n```bash\nsetx OPENROUTER_API_KEY \"sk-or-...\"      # Windows\nexport OPENROUTER_API_KEY=\"sk-or-...\"    # macOS/Linux\n```\n\n**Fireworks AI** (optional):\n```bash\nsetx FIREWORKS_API_KEY \"fw_...\"          # Windows\nexport FIREWORKS_API_KEY=\"fw_...\"        # macOS/Linux\n```\n\n## Cost comparison\n\n| Usage level | Anthropic Max | deepclaude (DeepSeek) | Savings |\n|---|---|---|---|\n| Light (10 days/mo) | $200/mo (capped) | ~$20/mo | 90% |\n| Heavy (25 days/mo) | $200/mo (capped) | ~$50/mo | 75% |\n| With auto loops | $200/mo (capped) | ~$80/mo | 60% |\n\nDeepSeek's automatic context caching makes agent loops extremely cheap - after the first request, the system prompt and file context are cached at $0.004/M (vs $0.44/M uncached).\n\n## What works and what doesn't\n\n### Works\n- File reading, writing, editing (Read/Write/Edit tools)\n- Bash/PowerShell execution\n- Glob and Grep search\n- Multi-step autonomous tool loops\n- Subagent spawning\n- Git operations\n- Project initialization (`/init`)\n- Thinking mode (enabled by default)\n\n### Doesn't work or degraded\n| Feature | Reason |\n|---|---|\n| Image/vision input | DeepSeek's Anthropic endpoint doesn't support images |\n| Parallel tool use | Supported by DeepSeek (up to 128 per call), but Claude Code sends tools sequentially by default |\n| MCP server tools | Not supported through compatibility layer |\n| Prompt caching savings | DeepSeek has its own caching (automatic), but Anthropic's `cache_control` is ignored |\n\n### Intelligence difference\n- **Routine tasks** (80% of work): DeepSeek V4 Pro is comparable to Claude Opus\n- **Complex reasoning** (20%): Claude Opus is stronger - switch with `--backend anthropic`\n\n## Live switching (no restart)\n\nSwitch between Anthropic and DeepSeek **mid-session** - from inside Claude Code itself. No restart, no terminal commands. Just type a slash command.\n\n**In Claude Code terminal:**\n\n![/deepseek in Claude Code CLI](screenshots/terminal%20for%20terminal%20embed2.PNG)\n\n**In Claude Code VS Code extension:**\n\n![/deepseek in VS Code extension](screenshots/terminal%20for%20vscode%20embed2.PNG)\n\n### How it works\n\nThe proxy runs on `localhost:3200` and intercepts all API calls. A control endpoint (`/_proxy/mode`) lets you switch the active backend instantly:\n\n```\nClaude Code -\u003e localhost:3200 (proxy)\n                 |\n                 +-- /_proxy/mode POST -\u003e switch backend\n                 +-- /_proxy/status GET -\u003e current backend + uptime\n                 +-- /_proxy/cost GET -\u003e token usage + cost savings\n                 |\n                 +-- /v1/messages -\u003e active backend (DeepSeek/OpenRouter/Anthropic)\n                 +-- everything else -\u003e Anthropic (passthrough)\n```\n\n### Option 1: Slash commands (recommended)\n\nAdd these files to `~/.claude/commands/`:\n\n**`deepseek.md`:**\n```\nSwitch the model proxy to DeepSeek. Run this command silently and report the result:\ncurl -sX POST http://127.0.0.1:3200/_proxy/mode -d \"backend=deepseek\"\nIf successful, say: \"Switched to DeepSeek.\"\n```\n\n**`anthropic.md`:**\n```\nSwitch the model proxy back to Anthropic. Run this command silently and report the result:\ncurl -sX POST http://127.0.0.1:3200/_proxy/mode -d \"backend=anthropic\"\nIf successful, say: \"Switched to Anthropic.\"\n```\n\n**`openrouter.md`:**\n```\nSwitch the model proxy to OpenRouter. Run this command silently and report the result:\ncurl -sX POST http://127.0.0.1:3200/_proxy/mode -d \"backend=openrouter\"\nIf successful, say: \"Switched to OpenRouter.\"\n```\n\nThen type `/deepseek`, `/anthropic`, or `/openrouter` in any Claude Code session to switch instantly.\n\n### Option 2: CLI flag\n\n```bash\ndeepclaude --switch deepseek    # or: ds, or, fw, anthropic\ndeepclaude -s anthropic\n```\n\n### Option 3: VS Code keyboard shortcuts\n\nAdd to `.vscode/tasks.json`:\n```json\n{\n  \"version\": \"2.0.0\",\n  \"tasks\": [\n    {\n      \"label\": \"Proxy: Switch to DeepSeek\",\n      \"type\": \"shell\",\n      \"command\": \"Invoke-RestMethod -Uri http://127.0.0.1:3200/_proxy/mode -Method Post -Body 'backend=deepseek'\",\n      \"presentation\": { \"reveal\": \"always\" },\n      \"problemMatcher\": []\n    },\n    {\n      \"label\": \"Proxy: Switch to Anthropic\",\n      \"type\": \"shell\",\n      \"command\": \"Invoke-RestMethod -Uri http://127.0.0.1:3200/_proxy/mode -Method Post -Body 'backend=anthropic'\",\n      \"presentation\": { \"reveal\": \"always\" },\n      \"problemMatcher\": []\n    }\n  ]\n}\n```\n\nThen bind in `keybindings.json`:\n```json\n{ \"key\": \"ctrl+alt+d\", \"command\": \"workbench.action.tasks.runTask\", \"args\": \"Proxy: Switch to DeepSeek\" },\n{ \"key\": \"ctrl+alt+a\", \"command\": \"workbench.action.tasks.runTask\", \"args\": \"Proxy: Switch to Anthropic\" }\n```\n\n### Cost tracking\n\nThe proxy tracks token usage and calculates savings vs Anthropic pricing:\n\n```bash\ncurl -s http://127.0.0.1:3200/_proxy/cost\n```\n\nReturns:\n```json\n{\n  \"backends\": {\n    \"deepseek\": {\n      \"input_tokens\": 125000,\n      \"output_tokens\": 45000,\n      \"requests\": 12,\n      \"cost\": 0.0941,\n      \"anthropic_equivalent\": 1.05\n    }\n  },\n  \"total_cost\": 0.0941,\n  \"anthropic_equivalent\": 1.05,\n  \"savings\": 0.9559\n}\n```\n\n## VS Code / Cursor integration\n\nAdd terminal profiles so you can launch deepclaude from the IDE:\n\n**Settings \u003e JSON:**\n```json\n{\n  \"terminal.integrated.profiles.windows\": {\n    \"DeepSeek Agent\": {\n      \"path\": \"powershell.exe\",\n      \"args\": [\"-ExecutionPolicy\", \"Bypass\", \"-NoExit\", \"-File\", \"C:\\\\path\\\\to\\\\deepclaude.ps1\"]\n    }\n  }\n}\n```\n\nOr on macOS/Linux:\n```json\n{\n  \"terminal.integrated.profiles.linux\": {\n    \"DeepSeek Agent\": {\n      \"path\": \"/usr/local/bin/deepclaude\"\n    }\n  }\n}\n```\n\n## Remote control (`--remote`)\n\nOpen a Claude Code session in any browser - with DeepSeek as the brain:\n\n```bash\ndeepclaude --remote                # Remote control + DeepSeek\ndeepclaude --remote -b or          # Remote control + OpenRouter\ndeepclaude --remote -b anthropic   # Remote control + Anthropic (normal)\n```\n\nThis prints a `https://claude.ai/code/session_...` URL you can open on your phone, tablet, or any browser.\n\n### How it works\n\nRemote control needs Anthropic's bridge for the WebSocket connection, but model calls can go elsewhere. deepclaude starts a local proxy that splits the traffic:\n\n```\nclaude remote-control\n  +-- Bridge WebSocket -\u003e wss://bridge.claudeusercontent.com (Anthropic, hardcoded)\n  +-- Model API calls  -\u003e http://localhost:3200 (proxy)\n                            +-- /v1/messages -\u003e DeepSeek ($0.87/M)\n                            +-- everything else -\u003e Anthropic (passthrough)\n```\n\n### Prerequisites\n- Must be logged into Claude Code: `claude auth login`\n- Must have a claude.ai subscription (the bridge is Anthropic infrastructure)\n- Node.js 18+ (for the proxy)\n\nThe proxy starts automatically and stops when the session ends. See [proxy/README.md](proxy/README.md) for technical details.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faattaran%2Fdeepclaude","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faattaran%2Fdeepclaude","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faattaran%2Fdeepclaude/lists"}