{"slug": "show-hn-cognition-claude-proxy-use-devin-model-catalog-with-claude-code", "title": "Show HN: Cognition-Claude-proxy – Use Devin model catalog with Claude Code", "summary": "A developer released Cognition-Claude-proxy, a local proxy that lets Anthropic's Claude Code use Devin's model catalog — including SWE-2, GLM-5.2, and DeepSeek V4.1 Flash — as its backend by translating the Anthropic Messages API to the Connect-RPC format used by the Devin CLI. The proxy runs on port 8765 by default, authenticates via local Devin CLI credentials, and live-syncs models from the upstream catalog with a bundled fallback snapshot of 398 entries. It requires Node.js 18+, an authenticated Devin CLI, and Claude Code, and was verified end-to-end with real claude -p sessions covering text, thinking deltas, and tool calls.", "body_md": "A local proxy that lets **Claude Code** (or any Anthropic-API client) use\n**Devin's model catalog** — SWE-2, GLM-5.2, DeepSeek V4.1 Flash, and 200+\nothers — as its backend. It translates the Anthropic Messages API to the\nConnect-RPC format that the Devin CLI uses, and translates the streaming\nresponses back to Anthropic SSE.\n\n``` php\ngraph LR\n    CC[Claude Code] -->|POST /v1/messages\\nAnthropic JSON| PX[Proxy :8765]\n    PX -->|Connect-RPC protobuf\\nauthenticated| UP[Devin CLI backend\\nserver.codeium.com]\n    UP -->|streaming events| PX\n    PX -->|Anthropic SSE| CC\n    PX -->|GET /v1/models| UP\n    style PX fill:#4d94ff,stroke:#333,stroke-width:2px\n    style CC fill:#e066ff,stroke:#333\n    style UP fill:#2eb82e,stroke:#333\n```\n\n## Plain-text flow\n\n``` php\nclaude  (ANTHROPIC_BASE_URL=http://localhost:8765)\n  -> POST /v1/messages            (Anthropic Messages API, JSON)\n    -> proxy: translate to Connect-RPC protobuf\n      -> POST https://server.codeium.com  (authenticated via local Devin CLI credentials)\n    <- Connect server-stream of events (text/thinking/tool-call/usage)\n  <- Anthropic SSE events (message_start/content_block_*/message_delta)\n```\n\nThe proxy authenticates using your local Devin CLI credentials\n(`%APPDATA%\\devin\\credentials.toml` on Windows, `~/.config/devin/credentials.toml`\non Linux/macOS). No API keys to manage — if `devin` works, `dclaude` works.\n\n- [Node.js](https://nodejs.org/) 18+\n- [Devin CLI](https://devin.ai/) installed and authenticated (`devin` command works)\n- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed (`claude` command works)\n\n```\ngit clone https://github.com/coderexpert123/cognition-claude-proxy.git\ncd cognition-claude-proxy\n\n# Option A: use the wrapper (auto-starts the proxy)\nbin\\dclaude.bat -p \"hello\"\n\n# Option B: start the proxy manually\nnode src/server.js            # starts on 127.0.0.1:8765\n# then in another shell:\nset ANTHROPIC_BASE_URL=http://localhost:8765\nset ANTHROPIC_AUTH_TOKEN=test\nclaude -p \"hello\"\ncd cognition-claude-proxy\nnode src/server.js            # starts on 127.0.0.1:8765\n```\n\nThen use the wrapper (put `bin\\` on PATH or call directly):\n\n```\nbin\\dclaude.bat               # launches claude pointed at the proxy\nbin\\dclaude.bat --model swe-2 # pick any model from `devin models list`\nbin\\dclaude.bat --free        # free-models-only fallback (replaces paid models with free ones)\n```\n\nEnv knobs: `CCP_PORT` (default 8765), `CCP_API_KEY` (override credential),\n`CCP_CREDENTIALS` (override credentials.toml path), `CCP_UPSTREAM`\n(override backend URL), `CCP_DEFAULT_MODEL` (default `swe-2-high`),\n`CCP_DEBUG` (log requests + dump bodies to `%TEMP%\\ccp-*.json`),\n`CCP_DEBUG_SSE` (dump emitted SSE to `%TEMP%\\ccp-*.log`).\n\n`dclaude.bat` maps Claude Code's tier aliases to a pinned model waterfall:\n\n| Tier | Alias | Model | Effort | Context | \n|---|---|---|---|---|\n| Orchestrate | fable | `glm-5-2` | high | 200K | \n| Deep-plan | opus | `deepseek-v4-1-flash-max[1m]` | max | 1M | \n| Execute | sonnet | `swe-2-max` | max | 262K | \n| Background | haiku | `swe-2-medium` | medium | 262K | \n| Verify | (explicit) | `glm-5-2` | high | 200K | \n\n`--free` fallback: replaces the paid deep-plan model (deepseek) with\n`glm-5-2`; sonnet/haiku stay on free SWE-2.\n\n`GET /v1/models` live-syncs from the upstream model catalog — the same call\n`devin models list` uses — returning every available model with its\n`context_window` and `max_output_tokens`. If the fetch fails it falls back to\na bundled snapshot (`src/models.json`, 398 entries).\n\nClaude Code decides context accounting client-side. The proxy configures\nper-model context windows via a `claude-settings.json` file (passed through\n`--settings`) containing `modelPicker` rows with `[1m]` suffixes for 1M-context\nmodels and `behavesAs` entries for 200K models. Run\n`node scripts/gen-settings.js` to regenerate it from `src/models.json`.\n\nVerified end-to-end with real `claude -p` sessions: text + thinking deltas,\ntool calls (streamed JSON args), tool results, usage stats, multi-turn agent\nloops (SWE-2 called the `Write` tool through Claude Code and it executed).\nMCP tools (Playwright, context7, etc.) work through the proxy.\n\nNot yet handled: images (replaced with a text placeholder), prompt caching\n(`cache_control` is stripped), `thinking.budget_tokens` mapping.\n\n- The upstream backend runs a pre-inference content filter. Claude Code's\nsystem prompt contains phrases that trip it, so the proxy replaces the\nsystem prompt with a neutral equivalent (`sanitizeSystem` in`src/translate.js` ). Tool descriptions are also sanitized and capped at\n480 chars. If a request fails with`permission_denied: \"content policy\"` ,\ncheck the proxy console log and extend the sanitizer.\n- Cloud MCP connectors (Drive, Gmail, Calendar) are disabled by Claude Code\nwhen a custom `ANTHROPIC_AUTH_TOKEN` is set. Local/stdio MCPs work fine.\n- `[1m]` is the only context suffix Claude Code recognizes —`[262k]` is not\nparsed and would be sent upstream as part of the model name.\n\n**`permission_denied: \"content policy\"`** — The upstream content filter\nrejected something in the request. Check the proxy console log for the\nupstream error. If Claude Code updated its system prompt with new phrases,\nextend `sanitizeSystem` in `src/translate.js`.\n\n**`permission_denied: \"MCP configuration issue\"`** — Misleading; this is\nusually a tool description tripping the content filter, not an actual MCP\nproblem. Check which tool description triggered it and extend\n`sanitizeToolDesc` in `src/translate.js`.\n\n**Empty response from Claude Code** — The proxy is running but Claude Code\nshows nothing. Ensure the proxy started successfully (check\n`http://localhost:8765/health` returns `{\"ok\":true}`). If it did, run with\n`CCP_DEBUG=1` to dump request/response bodies to `%TEMP%\\ccp-*.json`.\n\n**`windsurf_api_key not found`** — The proxy couldn't find your Devin CLI\ncredentials. Ensure `devin` works first. Or set `CCP_API_KEY` directly.\n\n**Model not found / wrong context window** — Run `node scripts/gen-settings.js`\nto regenerate `claude-settings.json` from the latest `src/models.json` snapshot.\nTo refresh the snapshot, fetch a live `GetCliModelConfigs` response and\ndecode it (see `src/models.js` for the field mapping).\n\n**Proxy port already in use** — Set `CCP_PORT=8766` (or any free port) before\nstarting the proxy. If using `dclaude.bat`, set it in the environment before\nrunning the wrapper.\n\n**Upstream API changed** — If the backend protocol changes, the proxy will\nbreak. The field mappings are in `src/codeium.js` (request encoding) and\n`src/translate.js` (response decoding). Check the proxy console log for\ndecode errors. PRs welcome.\n\n```\nnode scripts/test.js    # checks /health and /v1/models\n```\n\n", "url": "https://wpnews.pro/news/show-hn-cognition-claude-proxy-use-devin-model-catalog-with-claude-code", "canonical_source": "https://github.com/coderexpert123/cognition-claude-proxy", "published_at": "2026-09-14 16:33:33+00:00", "updated_at": "2026-09-14 16:56:50.200157+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-products", "large-language-models"], "entities": ["Cognition-Claude-proxy", "Claude Code", "Devin", "Anthropic", "SWE-2", "GLM-5.2", "DeepSeek V4.1 Flash", "Node.js"], "alternates": {"html": "https://wpnews.pro/news/show-hn-cognition-claude-proxy-use-devin-model-catalog-with-claude-code", "markdown": "https://wpnews.pro/news/show-hn-cognition-claude-proxy-use-devin-model-catalog-with-claude-code.md", "text": "https://wpnews.pro/news/show-hn-cognition-claude-proxy-use-devin-model-catalog-with-claude-code.txt", "jsonld": "https://wpnews.pro/news/show-hn-cognition-claude-proxy-use-devin-model-catalog-with-claude-code.jsonld"}}