TL;DR: Install
claude-code-routeron Node 22, add your local endpoint as a custom provider, and write one Global Routing rule: ifrequest.body.modelcontainshaiku, rewrite it toai/gpt-oss. That is the entire rule. Two things older guides still get wrong: version 3 has noconfig.jsonand noccr codecommand, and the Claude Code login it offers to import cannot authenticate, so the hosted half needs a real API key. What this guide does not have is a measured split. The hosted branch never authenticated here, so no share of traffic and no saving is claimed.
The previous article ended with a working local setup and a recommendation not to use it as your only model. Full local loses on wall-clock, on multi-file reasoning, and once you buy hardware that holds a decent model, on money too.
Does that mean the local model has to sit idle? No. A router can sit between Claude Code and its providers and send some requests one way and some the other, based on what each request says about itself.
This walkthrough comes from an automated install of version 3.0.22 in August 2026, driven through an AI-assisted session, with the screenshots taken during that run. It is not a log of the author's own machine. Several things the older guides say turned out to be out of date, which is the useful part. On November 25, 2026 the newest release on npm is 3.1.6, still requiring Node 22 or newer; the walkthrough has not been repeated on it, so treat the screens below as 3.0.22 and expect labels to have moved.
What the router decides
The thing to understand before touching anything: you do not classify tasks. Every request Claude Code sends carries a model name in its body, and the router matches on that string. A request that names a Haiku model matches a contains haiku condition; a request that names Sonnet or Opus doesn't.
Which requests name Haiku? That depends on your setup, and it wasn't measured here. Claude Code's model docs describe haiku as the alias for the fast model meant for simple tasks, and the cost docs suggest model: haiku for simple subagent work. If nothing in your sessions asks for Haiku, this rule never fires. Step 7 is how you find out.
A rule is a condition plus a rewrite. Match on something in the request, change something in the request, forward it on.
Notice what this is not. Nothing inspects your prompt and decides it looks easy. A short question about a subtle race condition goes out under whatever model the session is on, and a subagent pinned to Haiku goes out as Haiku. Neither decision involved judgement about the work.
Step 0: two version traps
Deal with these first, because both produce errors that point somewhere else.
Node 20 is not enough. The npm CLI requires Node.js 22 or newer, and the package declares node >=22 in its engines field, so on a Node 20 shell it won't run until you switch:
nvm use 22
npm install -g @musistudio/claude-code-router
Version 3 threw away the config file. Every guide written before it, including the ones near the top of the search results, tells you to edit ~/.claude-code-router/config.json with a Providers array and a Router block holding default, background, think and longContext. That file does not exist any more. Version 3.0.22 keeps its configuration in config.sqlite and expects you to use a web UI. Don't edit the live SQLite by hand.
The CLI changed with it. There is no ccr code:
Usage:
ccr start [--host <host>] [--port <port>] [--open|--no-open] [--gateway|--no-gateway]
ccr ui [--host <host>] [--port <port>]
ccr stop
ccr <profile-name-or-id> [cli|app] [-- <agent args>]
You launch a named profile, not a fixed subcommand.
Step 1: check the local endpoint before adding a hop
A router in front of a broken endpoint produces errors that blame the router.
docker model ps
curl -s http://localhost:12435/anthropic/v1/messages \
-H "Content-Type: application/json" \
-d '{"model":"ai/gpt-oss","max_tokens":16,"messages":[{"role":"user","content":"Reply with ready."}]}'
Port 12435 is the schema-stripping proxy from the previous article, not Model Runner's own 12434. Point the router at 12434 and the local branch will 400 on the first tool-bearing request with failed to parse grammar, for the reasons the previous article covers: llama.cpp's repetition limit and unsupported regex keywords.
If the model is not resident, load it with the window it needs and a generous keep-alive, because routed requests arrive sporadically and a model that unloads between them turns every one into a cold start:
docker model configure --context-size 65536 --keep-alive 30m ai/gpt-oss
Step 2: start the service
ccr start --no-open
CCR service started at http://127.0.0.1:3458/?ccr_web_token=<token> (pid 49437).
The gateway that Claude Code will talk to runs on 127.0.0.1:3456; the management UI is the 3458 URL above. That token is a credential. Do not paste the URL into a ticket, and keep both listeners on localhost.
Step 3: importing existing authentication
The first-run wizard scans your machine and offers this:
Claude Code login detected. Click Import to add it as a gateway provider.
It is the most inviting button on the screen and it does not work. The import succeeds, the provider appears, and then the account check fails:
Account endpoint returned HTTP 401: OAuth access token has expired.
Re-authenticate to continue.
Claude Code authenticates a subscription with a short-lived OAuth token that it refreshes itself. The router copies the token and has no way to refresh it. So the hosted half of a hybrid setup needs a real Anthropic API key, billed separately from a Max subscription. That is a genuine cost the routing guides do not mention: you are not splitting a subscription, you are adding metered API spend and hoping the local branch offsets it.
Step 4: add the local provider
In Providers, click Add. The preset list offers Anthropic, and picking it feels right because the local proxy speaks the Anthropic messages protocol. It is a trap: a preset hard-codes its vendor URL and the form shows no endpoint field at all. In the August run, a provider saved from that preset was quietly pointing at api.anthropic.com.
Choose Other / custom API endpoint instead. The endpoint field appears:
Set the endpoint to http://localhost:12435, give it any placeholder API key (nothing checks it locally, but an empty value fails validation), and add ai/gpt-oss with Custom model, because the runner returns no model list to enumerate.
Protocol detection then runs against the proxy and reports Anthropic Messages available alongside both OpenAI dialects. No transformer needed, which is the payoff for Model Runner carrying three dialects on one port.
Step 5: write the routing rule
Open Global Routing and add a rule. The one this guide uses:
| Field | Value |
|---|---|
| Condition source | request.body |
| Path | model |
| Operator | contains |
| Value | haiku |
| Rewrite | Set request.body.model = ai/gpt-oss |
The condition can also read request.header or request.auth, and the rewrite can delete keys or push into arrays, so the same engine covers considerably more than a model swap. For hybrid routing you need exactly one rule.
Leave On failure off while you are testing. Retry and fallback chains hide a broken local branch behind a silent redirect to the hosted one, and then you cannot tell whether the split is working.
Step 6: keep a profile from hijacking everything
In Agent Profiles, create a Claude Code profile. The field that matters is effect scope: set it to Only opened from CCR, not System default. System default rewires every claude invocation on the machine, which is exactly the mistake the previous article warned about with a stray ANTHROPIC_BASE_URL.
Then launch by profile name:
ccr hybrid-local
Also unset the variable from the previous article, or it wins and everything goes local:
unset ANTHROPIC_BASE_URL
Step 7: prove the split is real
This is the step people skip, and then they run for a month convinced they are saving money.
The router's Overview page counts requests, tokens and cost per provider, which is the easiest instrument you will get:
Cross-check it from the other end, so you are not trusting one counter:
docker model requests --follow --model ai/gpt-oss \
| jq -R -c 'fromjson? | .[].records[] | {url, status: .status_code}'
The stream opens with a plain-text status line, which fromjson? drops, and each event after it is an array of request records. No lines at all means the split is not happening, and there are only three plausible reasons: ANTHROPIC_BASE_URL is still set, the rule's rewrite value does not exactly match a model you declared on the local provider, or the session sent nothing with a Haiku model name, which is a real possibility and the reason to check before counting on this.
What this guide cannot give you is a ratio. The hosted branch never authenticated, for the reason in step 3, so there is a verified local branch and a verified rule but no live session split. Anyone quoting you a percentage without saying how they counted is quoting a README. Count your own.
What routing doesn't improve
Routing changes where requests go, not what happens when they arrive, so every limit from the previous article still applies on the local branch.
The handshake still ships. It is tens of thousands of tokens (the previous article shows how to capture your own request and estimate it), and a routed request carries the same system prompt and the same tool schemas as any other. A 64k window can therefore still leave only about half as room, and /clear still does not give the handshake back.
The speed is unchanged. A routed request runs on the same local hardware as the full-local setup in the previous article, where even a one-file question can take minutes on modest hardware once the handshake has been processed, and routing doesn't change that. In a hybrid setup that appears as a stall in the middle of a session that was otherwise fast, which is arguably worse than a slow session you had braced for.
Is the setup worth it?
Honestly, it depends on two numbers you do not have yet, and neither does this guide: the share of your requests that name Haiku, and what the hosted branch costs you at API rates rather than subscription rates. The second one is the awkward part. If you are on a Max plan today, hybrid routing does not reduce that bill, it opens a second one.
Measure before committing. Step 7 costs half an hour and answers it properly, which beats reasoning from a savings multiplier someone else measured on a workload that isn't yours.
For choosing which local model to sit behind the rule, the local model shortlist in that Docker Hub setup applies, though the criteria shift: summarisation quality matters more than agentic editing, so the smaller and faster options look better here than they do as a primary model.
Rolling it back
ccr stop
npm uninstall -g @musistudio/claude-code-router
rm -rf ~/.claude-code-router
Then run claude directly again. Nothing on the Docker side needs undoing unless you want the disk space back, and the local model stays useful for the offline case whether or not you keep the router.
Correction, November 26, 2026: An earlier version of this guide spoke in the first person about installing and configuring the router and repeated a 35,482-token handshake figure from the previous article. The install was an automated session, not the author's own machine, and the handshake number could not be reproduced; both are corrected above.