shunt CLI
A local gateway for Claude Code that sends mapped models to OpenAI, Kimi, DeepSeek or Gemini and passes the rest to Anthropic
- 264 ★ on the repository
- Last commit
- Apache-2.0
Broad access
Why this level
- The text of all Claude Code requests and replies, including project code, passes through the gateway, and the mapped models receive it at third-party providers
- It stores subscription sign-ins, tokens and API keys in ~/.shunt and the config, and an account pool spends the limits of several subscriptions
- Using subscriptions from an unofficial client may break providers' terms and get an account blocked; the author leaves that to your judgment
Install
- Works in
Manual install
brew install pleaseai/tap/shuntFor macOS and Linux. brew services start shunt runs it as a service.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The text of all Claude Code requests and replies, including project code, passes through the gateway, and the mapped models receive it at third-party providers
- It stores subscription sign-ins, tokens and API keys in ~/.shunt and the config, and an account pool spends the limits of several subscriptions
- Using subscriptions from an unofficial client may break providers' terms and get an account blocked; the author leaves that to your judgment
This is third-party code. Review the repository files before installing.
What it does
shunt is a transparent proxy between Claude Code and model APIs. You point Claude Code at it with the ANTHROPIC_BASE_URL variable. The gateway reads the model field of each request. If the id is described in shunt.toml, the request goes to another provider while Claude Code's tools and skills keep working. Every other id, such as claude-*, goes to Anthropic unchanged. Built-in providers include OpenAI, ChatGPT/Codex, xAI, Grok, Cursor, Kimi Code, Zhipu, MiniMax, OpenCode Zen, Gemini and Antigravity. Any backend that speaks Anthropic Messages is added with one table in the config and no code. For OpenAI Responses the gateway translates request and response formats itself, streaming included. Some providers work with an API key, some through a sign-in to a subscription you already pay for. The config can define an upstreams chain with failover to a spare provider, a pool of several accounts that respects limits, a router by turn complexity and a separate model for subagents. The config reloads without a restart. For administration there is a web dashboard and a JSON API. The shunt add upstream kimi --print command prints a setup guide you can hand to an agent.
Who it is for. Claude Code users who want to run part of their requests on other models, keep a fallback provider for rate limits or track spending across several accounts.
Good fit when
- You want to try gpt-5.6-sol or kimi-k3 inside the familiar Claude Code without changing tools or skills
- Your Anthropic subscription limit runs out mid-task and you need an automatic switch to a spare upstream
- Explore subagents are fine on a cheap model while the main session needs a strong one
- You want several accounts merged into a pool that tracks quota windows
- An agent should configure a new provider itself from the built-in shunt add guide
Not a fit when
- One Anthropic model and the standard Claude Code sign-in are enough: an extra proxy adds a point of failure
- Company policy forbids sending code and prompts through third-party gateways and providers
- You need a product with a compatibility guarantee: the project is pre-1.0 and settings and behavior change
- You want to share someone else's subscription with other people: that breaks providers' terms
Example request
Install shunt, map gpt-5.6-sol to my Codex login and show me how to start Claude Code through the local gateway on port 3001Limitations
- The project is pre-1.0. Config keys, commands and behavior may change between 0.x releases, so read the release notes before upgrading.
- The author states that using ChatGPT, Codex, SuperGrok or Kimi subscriptions from an unofficial client is at your own risk and provider policy may change.
- With the ChatGPT plan provider some request parameters are rejected, and a limit hit after output starts ends the stream without failover.
- The web dashboard exists only in builds with the ui feature (Homebrew and release binaries), not in cargo install.
How to disable. Remove the ANTHROPIC_BASE_URL and ANTHROPIC_CUSTOM_MODEL_OPTION variables from the environment and Claude Code goes straight to Anthropic again. brew services stop shunt stops the service. brew uninstall shunt removes the application. Saved sign-ins live in ~/.shunt; delete them if you no longer need them.
FAQ
How do I run Claude Code through shunt?
Describe a route in shunt.toml, run shunt run and in another window set ANTHROPIC_BASE_URL=http://127.0.0.1:3001 and ANTHROPIC_CUSTOM_MODEL_OPTION to the id you need. Then start claude and pick the model with /model.
What happens to ordinary requests to Claude models?
If a model id is not described in the config, shunt forwards the request to Anthropic unchanged with your own credential. The fallback provider for such requests can be changed with the server.default_provider setting.
Which providers are built in?
OpenAI, ChatGPT/Codex, xAI, Grok, Cursor, Kimi Code, Zhipu, MiniMax, OpenCode Zen, Cheaper Inference, Gemini, Antigravity and an Anthropic passthrough. Any backend with the Anthropic Messages format is added with a table in the config.
How is shunt different from claude-code-router?
Both switch Claude Code models. shunt claims compliance with the Claude Code gateway specification and routes by the model field at the inference layer. It is written in Rust, installs through Homebrew or a prebuilt binary and supports provider chains with failover, account pools and a separate model for subagents.
Do I have to expose the gateway to the internet?
No, in the quickstart the gateway listens on 127.0.0.1:3001. For shared access the README describes client tokens, JWT and a gateway login, but you should enable them deliberately.
Discussion
No questions or reviews yet.
Related
CLI toolsA local gateway for Claude Code, Codex, OpenCode and other agents: pick model providers, route requests, set fallbacks and read logs
Clother switches Claude Code between providers with one command: Z.AI, Kimi, DeepSeek, OpenRouter and local models.
Magpie
magpie
Magpie — an app and local gateway that connect any model to Claude Code, Codex, Gemini CLI and OpenCode and switch them from the menu bar
A CLI that plugs third-party models into Claude Code orchestration: workflows, agent teams and subagents on DeepSeek, GLM, Kimi, Qwen or a Codex subscription
A local proxy exposing GigaChat through OpenAI- and Anthropic-compatible APIs so it can drive Claude Code, aider and other agents
CCS
CCS - Claude Codex Switch
A CLI that switches Claude Code between accounts, providers and local models without editing configs
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Repository stars | Main difference |
|---|---|---|---|
| shunt (this card) | no | 264 | |
| Claude Code Router | no | 38,127 | another gateway with routing for the same agents, while shunt's README adds account pools, a web dashboard and spend limits |
| routatic-proxy | no | 981 | a local CLI proxy that translates requests between APIs, while shunt picks the provider by model id |
README in short
The page explains the gateway idea and gives three ways to install: Homebrew, a script and cargo. It continues with a quickstart using shunt.toml, a table of built-in providers, examples of upstreams chains and a feature list with configuration modes: account pools, a web dashboard, spend limits, routers. It states separately that the project is pre-1.0.