Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ ccmux

Claude Code on Copilot + Ollama Cloud.

Your GitHub Copilot subscription (including the free tier) and your Ollama Cloud key both power claude in your terminal.

npm node license

npm i -g @dondetir/ccmux && ccmux claude

Don't switch tools. Switch backends.


💡 Why? Your Copilot subscription already includes Claude, GPT, and Gemini, and Ollama Cloud adds GLM, Qwen, DeepSeek, Kimi and more. You just couldn't run them in claude. ccmux fixes that, aggregating every backend you have into one /model picker.

⚠️ Unofficial: it rides Copilot's editor-facing API, not a public one, so it can break when GitHub changes that surface. Free-tier premium requests are limited; 429s are passed through so Claude Code backs off cleanly.

🔌 How it works

 ┌─────────────┐   Anthropic API    ┌───────┐    Copilot API     ┌────────────────┐
 │ Claude Code │ -----------------> │ ccmux  │ -----------------> │ GitHub Copilot │
 │ (terminal)  │ <----------------- │ :4141 │ <----------------- │ (your sub)     │
 └─────────────┘  streamed replies  └───────┘  native/translate  └────────────────┘

ccmux speaks the Anthropic API to Claude Code and routes each request to the right backend by model id: native pass-through for Copilot's Claude models, OpenAI translation for GPT/Gemini and every Ollama Cloud model (ollama/*), and the Responses API for /responses-only models. Ollama thinking models stream their reasoning back as Claude thinking blocks. It binds to 127.0.0.1, so your credentials never leave your machine.

🚀 Quickstart

npm i -g @dondetir/ccmux   # puts the `ccmux` CLI on your PATH
ccmux claude        # starts the proxy if needed, then launches Claude Code

Requires Node 20+, Claude Code, and a GitHub account with Copilot access. The first run without a token triggers a one-time device-flow login in your terminal (saved to ~/.config/ccmux/env).

🧠 Models

Every Copilot model shows up in the native /model picker, with no settings.json edits:

$ ccmux claude
✓ proxy ready on http://127.0.0.1:4141
> /model
  claude-haiku-4.5
  claude-sonnet-4.6
  claude-gpt-4.1
  claude-gemini-2.5-pro
  …

Free tier gets claude-haiku-4.5 only; paid Copilot unlocks sonnet, GPT, and Gemini. Set an Ollama Cloud key (ccmux login ollama) and its models join the same picker as ollama/<id> (e.g. ollama/glm-5.2, ollama/qwen3-coder:480b), each showing its real context window. Non-Claude ids are prefixed claude- to pass discovery, then the proxy strips the prefix and routes them to the right backend.

🛠 Commands

Command What it does
ccmux claude Start the proxy if needed + launch Claude Code through it
ccmux login copilot One-time GitHub device-flow login (in a terminal)
ccmux login ollama Save an Ollama Cloud API key (from ollama.com/settings/keys)
ccmux logout Remove saved tokens (GitHub + Ollama) + VS Code Copilot tokens + stop the proxy. Use eval "$(ccmux logout)" to also clear tokens exported in the current shell
ccmux serve Run the proxy in the foreground on :4141
ccmux claude --dangerously-skip-permissions Launch Claude Code with --dangerously-skip-permissions (aliases: --dangerously, --yolo). Skips per-action permission prompts — sandbox/VM only
ccmux claude --debug Dump every request + upstream response (auth redacted) to ~/.config/ccmux/debug.log (also CCMUX_DEBUG=1)

Logs stream to ~/.config/ccmux/proxy.log. If models vanish, the catalog self-heals on the next request.

⚙️ Configuration

Env vars (or ~/.config/ccmux/env):

Var Default Meaning
GH_TOKEN device flow GitHub OAuth token (GITHUB_TOKEN also accepted)
OLLAMA_API_KEY unset Ollama Cloud key; set it (or run ccmux login ollama) to add ollama/* models
NATIVE_MODEL claude-haiku-4.5 Model served to Claude Code. Paid: try claude-sonnet-4.6
PORT 4141 Proxy port (binds 127.0.0.1 only)
USE_NATIVE 1 1 = native pass-through; 0 = OpenAI translation path
CLAUDE_CONTEXT_WINDOW 200000 Context window Claude Code assumes (token counts scaled to match)

🐛 Troubleshooting

GPT-5 / reasoning models show "invalid parameter" and no response

GPT-5 reasoning models (gpt-5.*, served via the Responses API) reject sampling parameters — temperature and top_p — returning an "invalid/unsupported parameter" error, so Claude Code renders nothing. ccmux now drops those for reasoning models automatically. If a model still errors, find the exact rejected field with debug logging:

ccmux claude --debug          # or CCMUX_DEBUG=1 ccmux serve
# then reproduce; inspect ~/.config/ccmux/debug.log

Every inbound Anthropic request, the translated upstream request (Authorization redacted), and the full upstream response (or raw SSE frames for streams) are appended to ~/.config/ccmux/debug.log (0600, loopback proxy only). This is the authoritative way to see what Copilot rejected.

Run without permission prompts

ccmux claude --dangerously-skip-permissions   # alias: --yolo

This passes --dangerously-skip-permissions through to Claude Code, skipping its per-action prompts. Only do this inside a sandbox or VM — it lets the agent read, write, and execute without asking.

🔧 Development

npm install
npm test        # translators + streaming state machine
npm run dev     # proxy with live reload

📜 License

Released under the MIT License.

MIT License

Copyright (c) 2026 dondetir

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

A copy is also included in the repository as LICENSE.


💛 Built with conviction

Claude Code is the best agentic coding harness out there, but it only spoke one backend. ccmux gives you the freedom to run any Copilot model on it, not just Claude: GPT, Gemini, and Claude, all in one terminal, all from the subscription you already have. No relay servers, no middlemen, just a few hundred lines of TypeScript running on your own machine.

If ccmux gave you model freedom on the best harness, ⭐ star the repo. It's the fuel that keeps projects like this alive and maintained.

stars · Report a bug · Request a feature

Built for developers who want every model on the best harness.

About

Run Claude Code on your GitHub Copilot subscription and Ollama Cloud key. A tiny local proxy that unlocks every model in the /model picker.

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages