Skip to main content

Your organization's proxy

When your organization turns on its enterprise proxy in RTK Cloud, Claude Code sends its requests through that shared proxy instead of a proxy on your machine. It compresses context the same way, applies your organization's pipelines and your own, and reports usage to the dashboard.

Admins running it on their own servers: on-prem setup.

Getting set up​

Log in to your organization:

rtk login

Login sets up Claude Code for you and prints what it changed:

  • If the proxy is on and answering, login points Claude Code at it. Your local RTK daemon keeps running for the sessions that still use it.
  • If the proxy is on but not answering, login leaves Claude Code as it is; RTK tries again while you work and at your next session start.
  • Otherwise (your organization uses local daemons, or its plan does not include the proxy), login starts the local RTK daemon and points Claude Code at it (http://127.0.0.1:8080). It also adds the session-start hook that restarts the daemon, and extends = "rtk:proxy" to a new pipeline.toml.

The session-start checks run from the hooks rtk init installs: run rtk init once if you have not. RTK also checks RTK Cloud while you work, at most every 2 minutes when you send a message: when your organization turns its proxy on, turns it off or moves it, Claude Code switches within about 2 minutes, from your next message, in the conversation you have open (except in the apps described in When a session can't switch). Your organization's proxy takes over from the local daemon as soon as it answers. When your organization's pipelines change, that session start also restarts the local RTK daemon in the background so it applies them; requests already running finish first. Once you are logged in, rtk init no longer asks whether to set up the local daemon: login takes care of it.

If Claude Code already points at a gateway on another machine, RTK leaves it and login tells you how to switch. A gateway on this machine is replaced by your organization's proxy, and kept when your organization uses local daemons.

With the local daemon, your usage still reaches the dashboard: RTK sends it at each session start and, at most once a minute, after rtk commands, also after a switch to your organization's proxy, for sessions that still use the daemon.

Your own pipeline files (pipeline.toml and pipelines/*.toml in your rtk config folder) are sent to your organization's proxy at login and at each session start when they changed, if your organization allows member rules. If the proxy refuses them, the session says why.

Each session's usage is attributed to the project you start it in (the repository decides which project and pipelines apply), whether you launch claude or rtk claude.

Your organization's proxy only accepts your own computer (always when RTK hosts it; on your organization's own servers unless the admin turned device certificates off). Login creates a key on this machine (it never leaves it) and gets a certificate for it from RTK Cloud; RTK points Claude Code at both files. The certificate lasts a day and renews by itself, also just before a prompt, so a session left open over a weekend keeps working. If the admin turns device certificates off, RTK keeps your certificate, so turning them back on does not interrupt you. Nothing to do on your side; rtk logout removes the key and the certificate.

When a session can't switch​

Some apps start Claude Code with the proxy address fixed for the whole session; the Superconductor app does. Such a session keeps that address until you restart it, even after RTK switched. New sessions always start on the new address. RTK tells you in that session, without stopping your message:

  • If its address stopped answering, at each message:

    RTK: this session can no longer reach your organization's proxy, so your messages fail. To fix it, restart this session: type /exit, then open it again (in a terminal: claude --resume). Your conversation is kept.

  • If its address still works, once:

    RTK: this session still goes through the local RTK proxy; new sessions use your organization's proxy. To switch it, restart this session: type /exit, then open it again (in a terminal: claude --resume). Your conversation is kept.

When the proxy is down​

A proxy hosted by RTK runs several instances. An update, or the loss of one instance, does not stop your session: at most the request in progress is sent again.

When no instance answers, or your organization removes its proxy, RTK moves Claude Code to your local RTK daemon, or to the provider directly if the daemon cannot start. You stay in the same conversation:

  • Before your message leaves, RTK checks your organization's proxy (at most every 30 seconds). If it does not answer, your message goes through your local RTK daemon instead. Claude Code shows once what changed, for example:

    RTK Pro: your organization's proxy at https://… is not answering. From your next message Claude Code goes through the local RTK proxy (http://127.0.0.1:8080), …

  • When the proxy answers again, RTK moves Claude Code back to it and tells you so.

  • A message sent less than 30 seconds after the previous check can still fail once. When RTK hosted the proxy, the error says so and asks you to send your message again; it then goes through your local RTK daemon.

  • The check adds a fraction of a second to at most one message every 30 seconds. RTK also checks in the background when Claude finishes an answer and right after a request fails, so a proxy that went away during an answer is caught before your next message.

  • If your local RTK daemon stopped, RTK starts it again before your next message.

  • A claude -p run checks the route when it starts, so it uses the working route from its first request.

  • A refusal from the proxy itself, such as one of your organization's policies, is never bypassed: RTK moves you only when the proxy does not answer at all.

If a message still meets a proxy that cannot be reached at all, for example off your organization's network, Claude Code first retries the request for up to about three minutes. Press Esc and send your message again: RTK has already moved you.

The order RTK tries is set in config.toml, in your rtk config folder:

[proxy]
order = ["cloud", "local", "direct"]

cloud is your organization's proxy, local your RTK daemon and direct the provider. With only cloud, RTK keeps your organization's proxy and Claude Code shows:

Your organization's proxy at https://… is not answering, so Claude Code requests fail. Run rtk llm-proxy reset and Claude Code talks to the provider directly from your next message.

rtk llm-proxy reset

This removes the proxy address RTK wrote in Claude Code's settings; your other settings stay. From your next message, Claude Code talks to the provider directly. RTK leaves Claude Code's routing alone until your next rtk login; run it when the proxy answers again. rtk claude checks the proxy before it starts and uses your local setup when it is down.

rtk llm-proxy reset also removes any proxy address on this machine (localhost), whether or not it answers.

When the proxy refuses you​

If you leave the organization, your membership is suspended, or its plan no longer includes the proxy, Claude Code shows the proxy's answer, for example:

RTK: you are no longer a member of this organization, so its proxy refuses your requests. Run rtk llm-proxy reset, then start a new Claude Code session.

Run rtk llm-proxy reset: from your next message Claude Code talks to the provider directly. You may not need to: the next session start learns it from RTK Cloud and says what it changed. If you left the organization or are suspended, it removes the proxy address RTK wrote. If the plan no longer includes the proxy, it points Claude Code at your local RTK daemon instead. If your access comes back, a later session start points Claude Code at the proxy again, unless you ran rtk llm-proxy reset: then run rtk login.

If your RTK login expired, the message asks you to run rtk login instead; the proxy address stays. A login for another organization gets the "no longer a member" message.

If your organization accepts its proxy only from its own networks, a request from anywhere else is refused with a message naming the address it came from: connect to the office network or VPN and try again.

If this computer's certificate belongs to another member, for example after someone else logged in with rtk login on it, the proxy says so: run rtk login with your own account. A hosted proxy cannot be reached without a certificate at all, so an rtk that predates them sees it as not answering: update rtk, then run rtk login.

If the proxy answers that it "does not terminate TLS", your organization requires device certificates but its proxy cannot check them: tell your RTK admin (the Proxy page shows the same warning).

RTK never sends Claude Code to an organization proxy whose address starts with http:// (other than this machine): your credentials would cross the network unencrypted. Login says so; ask your RTK admin for an https:// address.

Other changes​

  • Your organization switches back to local daemons: within about 2 minutes, Claude Code moves to your local RTK daemon and RTK tells you so.
  • When your RTK login ends, or your membership is suspended or removed, Claude Code tells you at your next message or session start, at most once a day.
  • rtk logout or logging in to another organization removes your organization's proxy address; Claude Code stays on your local RTK daemon if it used it.
  • rtk llm-proxy status shows the proxy address, whether it answers, and what to do if it does not; it also says when your login expired, or why the proxy is no longer used. rtk llm-proxy lists reset among its commands.
  • Delegated tasks from your pipelines go through your organization's proxy too, with their own API key: ANTHROPIC_API_KEY, or the pipeline's api_key_env or api_key_command. The proxy never stores or lends your Claude Code login. Without a key, or if the proxy is down, the task is skipped and you see the command's own output.
  • The x-rtk-auth header RTK writes in Claude Code's settings only works with your organization's proxy: it cannot be used to sign in to RTK Cloud. It renews with your RTK login and stops working when you run rtk logout or leave the organization.
  • When RTK routes Claude Code through a proxy it also sets CLAUDE_CODE_GATEWAY_HINT_HEADERS=1 in settings.json, so Claude Code tells the proxy which requests are main turns, subagents or compactions. rtk llm-proxy reset removes it with the rest.