# Repository Briefing: daodao97/code-switch
> Source: https://repoforai.com/repo/daodao97/code-switch (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/daodao97/code-switch
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Go
- **License**: Apache-2.0
- **Engineering Health**: B (55/100 · Maintenance 6/35 · Adoption 18/25 · Releases 11/20 · License 20/20)
- **Latest Release**: v0.1.8 (2025-11-17) — https://github.com/daodao97/code-switch/releases
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: Self-Hosted, Local AI
- **Momentum**: 822 ★ total (+0 24h / +0 7d) · 118 forks
- **When to Use**: Best for: 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. Skip if: One upstream serves your needs, client settings must remain untouched, or you need offline inference or a documented headless gateway for shared infrastructure.

## Overview
```text
### Architecture & 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.
```

## Key Capabilities
```text
- Stable CLI endpoint: both clients are redirected to http://127.0.0.1:18100, so switching upstreams does not require restarting them.
- Separate protocol routes: /v1/messages goes to configured Claude providers, while /responses goes to configured Codex providers.
- Priority groups: v0.1.8 adds provider Levels 1–10 and tries higher-priority groups first; an unset Level defaults to 1.
- Usage visibility: request-level usage tracking makes individual calls available for cost review.
- Management scope: MCP server configuration for both clients, plus Claude Code Skills installation and removal with two built-in repositories and support for custom sources.
- Codex migration: v0.1.7 improves cc-switch import to recognize aliased providers in TOML.
```

## Quick Start / Clone
```bash
brew install mingw-w64
```
