Claude Code on your own models
Start Claude Code on any model on any of your machines — one command, configured for that run only.
Before you start
- Corewire running on this computer — the app, or
corewire agent. - Claude Code installed: the
claudecommand. - A model whose runtime speaks the Anthropic Messages API — Ollama 0.14 or newer, LM Studio 0.4.1 or newer, vLLM 0.11.1 or newer, SGLang 0.5.9 or newer, MTPLX, oMLX, Docker Model Runner or Lemonade — on this machine or any of your others. Sharing Ollama takes a minute.
Pick a model
corewire modelsNAME RUNTIME STATE WORKS WITHmac-studio/qwen3-coder:30b ollama serving claude-code, codex, opencode
Any row with claude-code under WORKS WITH will do. corewire models -all adds the models installed or available but not serving, here and on your other devices.
Launch
corewire launch claude-code -model mac-studio/qwen3-coder:30bstarting Claude Code on mac-studio/qwen3-coder:30b through this device's gateway (key 9f2c41d07e5ab316)
Corewire mints a gateway key for this launch — labelled “Claude Code via corewire launch”, limited to models, retired after thirty days unused — and starts claude with the gateway’s address, that key, and every model setting pointed at your model: the main model, the fast one and subagents, so background work does not ask for a model your machines do not have.
It is configured for this run only, through environment variables: your own Claude Code settings are untouched, and any ANTHROPIC_* or CLAUDE_CODE_* variables inherited from your shell — or from another Claude session — are cleared so they cannot outrank the gateway. Arguments after -- go to Claude Code:
corewire launch claude-code -model mac-studio/qwen3-coder:30b -- -p "summarise this repository"Or start it in a terminal of your own
-print starts nothing. It prints the key once, as an export line, and the command to run — which refers to the key by name, so it can sit in your shell history:
corewire launch claude-code -model mac-studio/qwen3-coder:30b -printexport COREWIRE_GATEWAY_KEY=cwk_9f2c41d07e5ab316_…ANTHROPIC_AUTH_TOKEN="${COREWIRE_GATEWAY_KEY}" ANTHROPIC_BASE_URL=http://127.0.0.1:36121 … claude
In the desktop app, Agents › Claude Code › Launch shows the same two lines.
Set it up by hand
For a permanent setup, or an editor extension that runs Claude Code for you, make a key whose default model catches the requests Claude Code sends under Anthropic’s own model names:
corewire keys new -label "Claude Code" -scopes models -default-model mac-studio/qwen3-coder:30bThen, wherever you keep environment variables:
export ANTHROPIC_BASE_URL=http://127.0.0.1:36121export ANTHROPIC_AUTH_TOKEN=cwk_…export ANTHROPIC_MODEL=mac-studio/qwen3-coder:30b
The Anthropic address has no /v1: Claude Code adds it. The key is shown once — paste it where the cwk_… is.
When something is off
- The launch is refused. The model’s runtime does not speak Anthropic Messages. Nothing starts and no key is minted; the refusal lists the models Claude Code can use. Updating the runtime is usually the fix.
- “This route needs a Corewire gateway key.” Claude Code sent a credential of its own — its Anthropic sign-in — and no key: the shell it started from has no
ANTHROPIC_AUTH_TOKEN.corewire launchsets it for you; by hand, check the export reached that shell. - Long sessions lose their beginning. Claude Code does not know a local model’s context window and assumes a large one. Give the model a large context in its runtime.
corewire keys lists every key and when it was last used; corewire keys revoke 9f2c41d07e5ab316 retires one for good. Keys are made and revoked on the device that holds them, never from another.