← Back to Leaderboard
Cmusistudio

musistudio/claude-code-router

Local model gateway for routing coding agents across providers

Engineering Health (Methodology)
A+ · 98/100
Maintenance Activity
● Updated 13d ago
Latest Release
v3.1.6
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption23/25
Release Cadence20/20
License Clarity20/20
DockerSelf-HostedCLIMCPAPI
Total Stars
★ 38,472
24h Growth
+8
7d Growth
+101
Forks
3,255

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

musistudio/claude-code-router Star History (2025-02-24 - 2026-12-04) ALL-TIME STAR HISTORY (2025-02 – 2026-12) +38.5k in 648d · avg +59/day 40.6k 20.3k 0 2025-02-24: ★ 12025-04-05: ★ 1802025-05-17: ★ 2342025-06-28: ★ 2,0292025-08-09: ★ 11,1072025-09-20: ★ 17,1142025-11-01: ★ 19,6082025-12-13: ★ 22,2312026-01-24: ★ 25,3162026-03-07: ★ 28,0832026-04-18: ★ 31,5662026-05-30: ★ 33,7672026-07-11: ★ 35,1482026-08-22: ★ 36,4232026-10-03: ★ 37,2852026-11-12: ★ 38,0572026-12-04: ★ 38,472 ★ 38.5k 2025-02 2026-01 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Claude Code Router (CCR) is a local model gateway with a management UI. Agent profiles configure clients to use a stable endpoint. For each request, routing rules resolve the upstream provider, model, and account, allowing those choices to change without reconfiguring every agent. In the default desktop and CLI setup, the model gateway listens on port 3456; the CLI management UI is served separately on port 3458.

The TypeScript monorepo includes Electron desktop builds and a Node.js CLI that serves the web UI without Electron. The root manifest lists @the-next-ai/ai-gateway, undici, openai, and the native better-sqlite3 module. Wrapper and core gateway plugins, local routes, and virtual models provide extension points in the request path. Fusion, ToolHub, and MCP integration let the gateway add capabilities beyond forwarding model requests.

Key Capabilities & Differentiators

CCR supports OpenAI Chat and Responses, Anthropic Messages, and Gemini Generate Content and Interactions, alongside provider presets such as OpenRouter, DeepSeek, and Moonshot and custom compatible endpoints. Provider configuration includes protocol probing, model discovery, connectivity checks, and credential pools. Routing can match headers or bodies, apply prefixes or rewrites, retry requests, and move through an ordered list of fallback models.

Agent profiles can apply model overrides and environment settings across clients such as Claude Code, Codex, and OpenCode. Separate CCR client keys can expire and enforce local request, token, and image limits. Logs show the resolved provider, model, and credential alongside status, latency, usage, estimated cost, and tool activity. Fusion vision, web search, and MCP tools extend the workflow, but protocol compatibility alone does not establish native feature parity across agents and providers.

Trade-offs & Limitations

For one agent and one provider, direct configuration avoids an extra service, routing rules, and a separate credential store to manage. A generic API gateway is worth considering if the only requirement is a shared model endpoint. CCR is more compelling when agent-specific profiles, fallback policies, and centralized logs replace duplicated configuration across several clients. Validate fallback models against the actual client workflow: returning text through a compatible API does not prove that tool calls or native image features will behave the same way.

Retries and fallbacks can improve availability, but they may increase end-to-end latency and upstream usage. Local hosting gives you control over the routing layer; it does not make inference local, remove API charges, or prevent data from reaching an upstream provider. Treat provider credentials, client keys, and request and response logs as sensitive. Keep the loopback default unless remote access is needed and you can control who reaches the management interface.

Hardware & Deployment Guide

Use the desktop app on macOS, Windows, or Linux for graphical setup. For a headless install, the npm CLI requires Node.js 22 or newer: install @musistudio/claude-code-router and run ccr ui, then open http://127.0.0.1:3458. Docker Compose instead serves management and gateway routes behind Nginx through the loopback mapping 127.0.0.1:3458:8080 and persists /data in the ccr-data volume. Internal listeners are not published by that Compose configuration, and the local gateway still needs connectivity to whichever upstream services you configure.

For desktop source builds, run npm ci under Node.js 22 or newer; Windows x64 packaging must run on Windows x64 because of the native better-sqlite3 Electron module. v3.1.4 fixed the Docker path that exposed the management token to unauthenticated clients. v3.1.5 addressed credential fallback and provider-qualified routing, among other fixes. v3.1.6 added provider balance and usage in Codex desktop and native image generation and editing through a configured Images API provider.

Agent profiles: Apply model overrides, scopes, and environment settings to clients such as Claude Code, Codex, and OpenCode.
Routing and failover: Match headers or bodies, rewrite requests, retry, and try fallback models in a configured order.
Protocol coverage: Support OpenAI Chat and Responses, Anthropic Messages, and Gemini Generate Content and Interactions.
Access and observability: Issue expiring client keys with local request, token, and image limits; inspect resolved routes, latency, usage, and estimated costs.
Tool integration: Extend model workflows with Fusion vision, search, MCP tools, ToolHub, and gateway plugins.
Container boundary: Compose publishes only Nginx at 127.0.0.1:3458 and persists the /data directory in a named volume.
Best For

Developers or teams running several supported coding agents who need to switch providers, configure fallback routes, and verify where requests went without maintaining separate routing configurations for each client.

Skip If

One agent connects reliably to one provider, or your primary need is an offline inference server or a guarantee of native feature parity across providers.

Reviewed on 2026-12-03 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

DockerSelf-HostedCLIMCP
npm install -g @musistudio/claude-code-router@latest
ccr ui

Comparison vs. Top Coding, Skills & MCP Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
claude-code-router ★38.5k+101TypeScriptMITLocal model gateway for routing coding agents across providers
cc-switch159.1k+1.7kRustMITTauri desktop manager for AI coding providers, local routing, and MCP config
herdr54.1k+871RustApache-2.0Rust terminal multiplexer for persistent, multi-machine coding-agent workspaces
magpie45.5k+2.9kGoMITA local API gateway that pools model subscriptions across coding agents

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/musistudio/claude-code-router.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

musistudio/claude-code-router Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about claude-code-router

How do I connect an agent and verify which upstream it actually used?

Add a provider with its API protocol, credentials, and models, then apply the profile for your agent. The agent sends requests to CCR rather than directly to the provider. Check Logs after a test request to verify the resolved provider, model, and status before enabling more complex routing rules.

Does self-hosting CCR require a GPU or a large machine?

CCR is a gateway, not an inference runtime. When you use hosted providers, the local machine does not need GPU VRAM for model inference. Size the host for Node.js, the desktop UI if used, concurrent requests, enabled tools, and log volume. If you also run a model backend locally, size that backend separately.

Can a company self-host CCR, and what does that cover?

The MIT license permits commercial use and self-hosting. If you redistribute the software, retain the copyright and license notices. Hosting CCR yourself does not change upstream provider terms or keep prompts and tool data on your machine when they are sent to hosted services. Review data handling and access to credentials and request logs separately.

When is CCR better than direct configuration or a generic API gateway?

Use direct agent-to-provider configuration for a stable one-client, one-provider setup with fewer components to maintain. Use CCR when multiple supported agents need centrally managed profiles, model routing, and logs. If you only need a shared API endpoint, compare a generic gateway first; CCR is most useful when its agent-specific profiles and tools replace work you would otherwise do per client.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining musistudio/claude-code-router? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature musistudio/claude-code-router on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

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

Saved in your browser · Export Markdown RFC tables or jump into /vs compare