chinfeng/chat-to-claude-code — reverse-engineered prompt
Reverse engineered prompt
Build me a small TypeScript Bun proxy that lets Claude Code talk to any OpenAI compatible chat completions endpoint as if it were the Anthropic Messages API.
I want to run one simple server process for one upstream model provider, pass in the upstream base URL, API key, port, optional client auth token, and optional debug dump folder from the command line. It should stream responses back to Claude Code in real time, translate messages both ways, handle normal text, thinking or reasoning content, and tool calls as cleanly as possible.
Please also support optional web search and web fetch tools, using Brave Search or SearXNG for search, with basic domain allow and block controls for fetch. Keep it lightweight, no unnecessary dependencies, and make it easy to run locally or in Docker.
Add a clear README with setup examples for Claude Code, plus tests for the main translation and streaming behavior. Look up current API docs online if you need to.
Want more depth? Deep Reverse