starbaser/ccproxy
Build mods for Claude Code: Hook any request, modify any response, /model "with-your-custom-model", intelligent model routing using your logic or ours
What it solves
ccproxy is a network interceptor designed for LLM tooling and AI harnesses. It allows developers to capture, inspect, and transform traffic between LLM clients (like Aider, Cursor, or the OpenAI SDK) and AI providers (Anthropic, Gemini, OpenAI, DeepSeek, etc.). It solves the problem of "black box" LLM API calls by providing full TLS inspection and the ability to reroute or modify requests and responses in real-time.
How it works
The tool operates as a transparent proxy using two primary methods of interception:
- Reverse Proxy: A listener on port 4000 that clients can be pointed to via environment variables (e.g.,
ANTHROPIC_BASE_URL). - WireGuard Namespace Jail: A rootless Linux network namespace that captures all outbound traffic from a process, regardless of its SDK configuration.
Traffic passes through a DAG-driven hook pipeline (inbound and outbound) and a transformation layer called lightllm. This layer handles the wire-format conversion between different providers (e.g., converting an Anthropic-format request to a Gemini-format request) using streaming FSMs.
Who it’s for
AI developers and power users who need to debug LLM API interactions, implement cross-provider routing, or add unsupported features (like MCP sampling) to their existing LLM clients.
Highlights
- Cross-Provider Routing: Redirect or transform requests between major providers like Anthropic, Gemini, OpenAI, and DeepSeek.
- Transparent Capture: Uses WireGuard namespaces to intercept traffic without needing to modify client SDK settings.
- Flow Inspection: Built-in CLI tools to list, dump, diff, and compare client requests versus forwarded requests using
jqfilters. - MCP Bridging: Adds Model Context Protocol (MCP) features like sampling and server notifications to any client.
- OAuth Integration: In-process OAuth refresh for Anthropic, Google, and Codex, allowing shared credentials with official CLIs.
- Request Shaping: Replays sanitized request envelopes to maintain identity headers and compliance for specific providers.