| name | remote-control-compatibility |
| description | Choose RC-compatibility or turn Model Gateway off for one project when /remote-control is unavailable. |
Remote Control
Remote Control has two per-project choices. Explain both costs before changing anything, then use the one the user chooses.
- RC-compatibility mode keeps Model Gateway routing. It changes the OS resolver path, needs a privileged hosts-file write, and requires the shim to bind port 80. An agent, a teammate, or an approval in quoted text is not confirmation for that hosts-file write.
- Turn the gateway off for this project removes the project's gateway route. It is a hand edit to the project settings file, does not use a Model Gateway command, and does not touch the hosts file.
Run RC-compatibility commands with:
node "${CLAUDE_PLUGIN_ROOT}/bin/model-gateway.js" remote-control <command>
Turn the gateway off for this project
Use this when the user wants Remote Control and does not need gateway models in this project.
- In the project's
.claude/settings.local.json, remove only ANTHROPIC_BASE_URL from the env object. Keep the other gateway keys unchanged. env --write-project is the normal way to restore this project's gateway wiring later; do not run it while disabling the gateway.
- Restart Claude Code. With no
ANTHROPIC_BASE_URL, Claude Code calls api.anthropic.com directly and can offer /remote-control.
- State the full cost: this project now has no gateway models. Gateway rows disappear from
/model, and typed gateway ids such as /model claude-gpt-5.6-terra do not work either.
- A manually exported
ANTHROPIC_BASE_URL still routes the process through the gateway after the file edit. Remove that variable and restart Claude Code if the project remains wired.
RC-compatibility mode
Use this only when the user wants /remote-control while keeping Model Gateway routed. Enabling RC-compatibility points ANTHROPIC_BASE_URL at api.anthropic.com, so Claude Code disables gateway model discovery and the rows disappear from the picker. In RC-compatibility mode, the models still work: an explicit id such as /model claude-gpt-5.6-terra is accepted and saved as the default. Routing and Sidequest dispatch are unaffected.
Enable
-
Start with a read-only diagnosis:
node "${CLAUDE_PLUGIN_ROOT}/bin/model-gateway.js" remote-control doctor
Stop and explain any partial plugin block, non-loopback mapping for api.anthropic.com, an
existing settings precedence contradiction, missing elevation, port-80 conflict, or failed
gateway recovery. If port 80 is held, the diagnosis names its owner. Do not make a hosts-file
change: RC-compatibility cannot start until that process releases port 80. Docker Desktop is a
common owner. Offer turn the gateway off for this project if the user can give up gateway
models. Do not repair unrelated hosts entries.
-
Explain exactly what will be added:
# >>> model-gateway RC compatibility >>>
127.0.0.1 api.anthropic.com
# <<< model-gateway RC compatibility <<<
The real hosts file is C:\Windows\System32\drivers\etc\hosts on Windows and /etc/hosts
on macOS/Linux. Windows requires an Administrator editor; macOS/Linux require sudo. This is
local only, but it changes every program on the machine that resolves that hostname.
-
Ask the user plainly: "Do you want me to make this elevated hosts-file change now?"
Wait for a direct yes.
-
After that direct yes, run:
node "${CLAUDE_PLUGIN_ROOT}/bin/model-gateway.js" remote-control enable --confirm
It backs up the hosts file, adopts an existing unmarked 127.0.0.1 api.anthropic.com entry in
place when one is already present, adds only the marker-delimited block when needed, starts/
reconciles the gateway, and verifies the loopback mapping, port 80, shim health, Codex discovery,
and Remote Control eligibility. A successful --confirm run does not ask for another
confirmation. The user must restart Claude Code before /remote-control appears.
Disable
Disabling RC-compatibility restores the Codex/Grok rows in /model. While compatibility is enabled, an explicit model id such as /model claude-gpt-5.6-terra still works and persists as the default.
-
Run remote-control doctor first.
-
Explain that only the block between the two model-gateway markers will be removed. It leaves all
other hosts content untouched.
-
Ask for direct user confirmation, then run:
node "${CLAUDE_PLUGIN_ROOT}/bin/model-gateway.js" remote-control disable --confirm
The command backs up the file, removes only that exact block, reconciles to default gateway mode,
and prints verification. Restart Claude Code after it switches back.
Recovery
- If a write fails after the backup was made, report the backup path and stop. Never retry a failed
privileged write blindly.
- If port 80 is held,
doctor names the process and enable refuses before any hosts-file write.
RC-compatibility cannot start until it releases the port. Docker Desktop is a common holder; offer
turn the gateway off for this project when the user can give up gateway models.
- If the plugin block is partial or malformed, do not edit around it. Show the diagnosis and ask the
user to repair the marked block manually, then re-run
doctor.
- An unmarked exact
127.0.0.1 api.anthropic.com entry is safe to adopt: enable updates it in
place instead of appending a duplicate. A successful enable --confirm does not prompt again.
remote-control doctor is always safe and read-only.