daodao97/code-switch
A local desktop proxy for switching Claude Code and Codex providers
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Code Switch is a Wails 3 desktop app with a local HTTP proxy. At startup it listens on port 18100 and updates both CLI configurations to use http://127.0.0.1:18100. The proxy sends /v1/messages to configured Claude providers and /responses to configured Codex providers. Its proxyHandler selects an enabled provider by priority and tries another on failure, so the CLI endpoint stays fixed while upstream routing changes.
The Go repository has a root main.go, a services/ directory, and a separate frontend/ tree. The module targets Go 1.24 and pins Wails v3.0.0-alpha.38. Dependencies include Gin, go-toml/v2, GJSON, SJSON, yaml.v3, and modernc.org/sqlite; the dependency list does not establish what is persisted in SQLite. MCP server configuration and Claude Code Skills management are separate from the two inference request routes.
Key Capabilities & Differentiators
The primary capability is live provider switching with automatic fallback for Claude Code and Codex. v0.1.8 adds Levels 1–10 and a two-level scheduling loop that tries higher-priority groups first. Existing providers without a Level default to Level 1. Teams can use the groups to prefer lower-cost providers or reserve a preferred backup tier. Request-level usage tracking supports cost review, but provider-specific billing reconciliation is not established.
The desktop UI also manages MCP server configuration for both clients. Claude Code Skills can be browsed, downloaded, installed, and removed through two built-in repositories or custom sources. Provider compatibility is expressed through the two supported request paths, not a model-by-model matrix: a provider’s presence in the list is not proof that every CLI feature will work through it.
Trade-offs & Limitations
Direct Claude Code or Codex configuration is simpler if one upstream is enough: there is no extra local process in the request path and no intermediary rewriting client settings. Code Switch earns that extra dependency when operators need failover or deliberate provider ordering. The trade-off is that a fallback can change response behavior, cost, or who handles request data; failed upstream attempts can also lengthen a request. Timeout behavior and streaming recovery are not established, so test failover with the providers you intend to use.
The proxy defaults to binding :18100, which can expose the listener beyond loopback even though both clients point to 127.0.0.1. Verify reachability and restrict access before using it on a shared or untrusted network; do not assume proxy authentication. The app is Apache-2.0 licensed, but upstream API terms still apply, and a local listener does not mean request data stays on the machine.
Hardware & Deployment Guide
For a source build, use Go 1.24+, Node.js 18+, a package manager such as npm, pnpm, or yarn, and the Wails 3 CLI. Run wails3 task dev for development. The macOS flow refreshes build assets with wails3 task common:update:build-assets before wails3 task package. Windows amd64 cross-building from macOS uses mingw-w64 and env ARCH=amd64 wails3 task windows:build. Downloads are listed for macOS, Windows, and Linux amd64.
This is a self-hosted desktop gateway, not an offline inference engine: the proxy runs locally, but API calls still need access to the selected upstream. No container or headless deployment path is established. Test automatic configuration changes with copies of existing CLI settings before rollout. The release sequence adds Skills management in v0.1.6, improves Codex provider import from cc-switch in v0.1.7, and introduces grouped fallback in v0.1.8.
Developers running Claude Code or Codex on a workstation who already have multiple compatible providers and want a stable CLI endpoint, ordered fallback, and per-request usage visibility.
One upstream serves your needs, client settings must remain untouched, or you need offline inference or a documented headless gateway for shared infrastructure.
Quick Start & Installation
brew install mingw-w64
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| code-switch ★ | 822 | — | Go | Apache-2.0 | A local desktop proxy for switching Claude Code and Codex providers |
| codex | 137.3k | +623 | Rust | Apache-2.0 | Rust coding agent that brings AI-assisted repository work to the terminal |
| pi | 125.5k | +1.1k | TypeScript | MIT | An extensible TypeScript coding CLI and agent runtime with a unified model API |
| gemini-cli | 109.6k | +376 | TypeScript | Apache-2.0 | A Node.js terminal agent for enterprise Gemini coding workflows and MCP tools |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/daodao97/code-switch.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about code-switch
How does Code Switch integrate with Claude Code and Codex?
Do I need a GPU, and how should I size the host?
Can a company use or redistribute Code Switch?
When is Code Switch preferable to direct CLI configuration?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy