Intercepting an IDE without sudo, and without blackholing a domain
DNS capture needs your password every time and redirects a hostname for the whole machine. Proxy capture mode does neither: one app, no password, and nothing left behind if it dies.
To route an app that has no base-URL setting, you have to catch its traffic. The standard way to do that locally is to edit /etc/hosts, point the hostname at 127.0.0.1, and answer on port 443 with a certificate your machine trusts.
It works. It also has three properties you only notice once you are living with it:
- It needs root every single time. Not once at install — every toggle, because every toggle edits a protected file.
- It is machine-wide.
api.anthropic.comnow means127.0.0.1for every process on the computer, not just the app you wanted to capture. - If the interceptor dies, the domain is a black hole. The hosts entry outlives the process that justified it. Every program on the machine now resolves that hostname to a port where nothing is listening.
That third one is the expensive one. A crash does not degrade to "capture is off" — it degrades to "this domain is unreachable from this computer," and it stays that way until someone edits the file back.
Since 0.5.175, kRouter has a second transport that has none of those properties.
Proxy capture mode
Instead of lying about DNS, kRouter runs an HTTP CONNECT proxy on port 20129. You point one client at it:
HTTPS_PROXY=http://127.0.0.1:20129 claudeThat client's TLS now terminates at kRouter. Nothing else on the machine is affected, because nothing else was told about the proxy.
| DNS capture | Proxy capture | |
|---|---|---|
| sudo | every toggle | never |
| scope | whole machine | one app |
| if kRouter dies | domain blackholed machine-wide | one refused connection |
| state left behind | hosts entries to heal | none |
| hosts covered | a hardcoded list | any CONNECT target |
The failure mode is the row that matters. A refused connection on a proxy port is an error the client understands and reports. A hostname that resolves to a dead local port is a mystery that follows you around until you find the file.
Passthrough has to be the default
A proxy that an entire application is pointed at sees all of that application's traffic — sign-in, telemetry, update checks, feature flags, the lot. Chat requests are a small fraction of it.
So anything kRouter does not specifically intercept is blind-tunnelled through untouched. It never parses it, never buffers it, never has an opinion about it. This is not politeness; it is the only way pointing a whole app at the proxy can be safe. If the proxy had to understand everything flowing through it, every unrecognised request would be a new way to break the app.
Running the real Claude CLI through it, the log shows what the split actually looks like: fifteen non-chat calls passed through untouched, and exactly one intercepted and mapped.
The same held for the Claude Desktop app relaunched with the variable set — its bootstrap call, its MCP artifacts endpoint, its plugin directory lookup all went straight through, while chats were intercepted and OAuth and telemetry were not touched.
One routing decision, two transports
Adding a second transport creates an obvious hazard: two code paths deciding what to intercept, drifting apart.
That drift is not hypothetical. Nearly every interception bug worth shipping a release for has been a bug in that decision — an alias map consulted in the wrong order, a model ladder with a gap in it, a gzipped body that the matcher could not read. A second copy of the logic means every one of those bugs gets to happen twice, and the second copy is always the one nobody tests.
So the decision moved into one module both transports call. It takes a request and returns a verdict. It opens no sockets and does no I/O beyond reading the saved alias map, which also means it became testable for the first time: the TLS server opens a listener when you require it, so nothing could unit-test the routing logic while it lived there.
Two more pieces moved out at the same time: per-host TLS contexts, and a DNS resolver that deliberately bypasses the hosts file. That last one exists so the two modes cannot loop into each other — passthrough must reach the real service, and if it resolved through the hosts file it would land back on the interceptor.
What it does not do
Antigravity cannot use this mode. Its agent reads no proxy environment variable at all, so there is nothing to point at the proxy. Antigravity is captured over DNS, which does work — see the MITM capture guide.
Each tool card in the dashboard carries the transports actually verified for it, rather than the ones that ought to work. At the time proxy mode shipped, the Kiro client side had not been verified end to end, so Kiro's card did not list it — the request shape was replayed through the proxy and answered correctly, but the real client had not been restarted against it, and "the shape works" is not "the app works."
That distinction is worth keeping. A capture mode that is listed but not verified sends people to spend an afternoon on something nobody has actually seen work.
The bugs it found before shipping
Running the proxy before releasing it turned up four lifecycle bugs, three of them the same shape: a status that lies.
Status was reported from the child-process handle rather than from whether the port was actually listening. Those two disagree more often than you would like — a process can be alive and not listening, or listening and wedged. Any UI built on the first one eventually tells the user capture is running when it is not, which is the worst possible thing for a feature whose failure mode is "your own subscription silently pays for every request."
Which one should you use
Use proxy capture when the client honours HTTPS_PROXY: no password, one app, nothing left behind.
Use DNS capture when it does not — Antigravity today — or when you want everything on the machine captured at once without configuring each client.
They can run together. The same routing decision serves both, so a model mapping you make applies whichever transport the request arrived on.
Published by Kodelyth, the team that builds kRouter. Posts are drafted with AI assistance and reviewed by a person before they go out. kRouter is free and MIT licensed.
Install kRouterRelated posts
- How kRouter worksKiro IDE with any model through a local MITM proxyKiro IDE has no custom endpoint setting. kRouter's MITM mode sends its chat turns to any model you map. How it works, the v0.5.137 fix, and setup.
- How kRouter worksUsage said Kiro made one request in 18 hours. It was making all of themA captured request is rewritten on the way through, so by the time usage recorded it the only thing left to attribute by was whoever served it. The page was not incomplete — it was wrong in a way that read as an answer.
- How kRouter worksLive model catalog: new models without a kRouter updatekRouter asks each provider what it serves right now, so a model launched today can be added from the dashboard without waiting for a kRouter release.
Relevant docs
- Core conceptsProviders, combos, account routing, token savers, MITM mode, quota tracking, the response cache and remote access: the eight ideas behind kRouter.
- The Zenith Routing EngineHow kRouter picks which of your accounts serves a request: Zenith scoring, conversation stickiness, cooldowns, and the round-robin, P2C and random options.
- Token savers: RTK, Caveman, Ponytail, Headroom, PXPIPEFive ways kRouter can shrink a request before it reaches the provider. Only RTK is on by default. What each saver does, what it needs, and its limits.