Skip to content

Install the companion

OCEANOFANYTHING edited this page Nov 24, 2026 · 1 revision

Install the companion

The companion is a small Windows program, chernobyl-companion.exe, that runs on the PC where your agents run. It starts or attaches to the agents, enforces every approval, and is the only thing your phone talks to. It is one Rust program with no third-party libraries.

You need:

  • Windows on a 64-bit PC.
  • At least one agent installed and signed in on that PC: Claude Code, Codex, OpenCode or Google Antigravity. CHERNOBYL uses each agent's own sign-in and never copies it.
  • The project folders you want the agents to work in.

1. Download

From the latest release, download:

  • chernobyl-companion-0.1.1-windows-x64.exe (the companion)
  • SHA256SUMS.txt
  • Source code (zip), which contains the setup script scripts\setup-windows.ps1

Check the companion against SHA256SUMS.txt before you run it. The companion is not code-signed, so Windows SmartScreen may warn the first time. Click More info, then Run anyway.

You can also build the companion yourself from a checkout of the repository:

cargo build --release --manifest-path services/companion-rs/Cargo.toml

2. Run the setup script

Extract the source zip, open PowerShell in that folder and run the script with your project folders. Point -Exe at the companion you downloaded:

powershell -ExecutionPolicy Bypass -File scripts\setup-windows.ps1 -Workspaces 'C:\Projects\my-app' -Exe "$HOME\Downloads\chernobyl-companion-0.1.1-windows-x64.exe"

If you built the companion yourself, leave out -Exe: the script uses services\companion-rs\target\release\chernobyl-companion.exe by default.

Run it from an administrator PowerShell if you want the script to add the firewall rule. Without admin rights it skips that step and prints the command to run later.

The script does this, in order:

  1. Copies the companion to %LOCALAPPDATA%\Programs\CHERNOBYL\chernobyl-companion.exe, so a later rebuild or download never fights the running copy.
  2. Writes %APPDATA%\CHERNOBYL\companion.json: demo data off, Claude Code on for your folders, listening on your network (port 8787). An existing file is kept as companion.json.bak.
  3. Creates an access token once and stores it in your user environment variable HOST_TOKEN, never in a file.
  4. Allows inbound TCP on the port for Private networks (only when run as administrator).
  5. Registers start-on-login and starts the companion in the background, without a window.
  6. Prints the access token and a pairing QR code for ws://<this PC's LAN address>:8787.

Keep the PowerShell window open: you need the token and the QR code for Pairing. Each QR code works once and expires after 5 minutes. The script prints the command for a new one at the end.

The companion printing a pairing QR code in PowerShell, with the payload line above it and a note that the offer is valid for 300 seconds and single use

The pairing QR code the companion prints. The payload line above it is what you paste if you cannot scan.

Setup switches

Switch What it does
-Workspaces 'C:\path\a','C:\path\b' Required. The folders the agents may work in. Each must exist. Claude Code is always set up for them.
-Port <n> The companion's port. Default 8787.
-Exe <path> The companion exe to install. Default: the release build inside the checkout.
-Codex Adds Codex for the same folders. The companion finds codex.exe on PATH or in the Codex app's install at every start, so app updates need no change.
-OpenCode Adds OpenCode, attached to an opencode serve you run, at -OpenCodeUrl (default http://127.0.0.1:4096).
-OpenCodeUrl <url> Where your OpenCode server listens. Used with -OpenCode.
-StartOpenCode Also runs opencode serve --port <port> --hostname 127.0.0.1 hidden in the first workspace folder, now and at every login. Implies -OpenCode. Loopback addresses only.
-Antigravity Adds Google Antigravity (agy acp) for the same folders. Install agy and sign in first by running agy once.
-AntigravityModel <id> The model new Antigravity sessions start on, such as gemini-3.8-flash-low (agy models lists them). Implies -Antigravity.
-PhoneApprovals Lets Claude Code sessions you start in a terminal or VS Code ask your phone too. See Approvals.
-EnableTerminal Lets the paired phone run shell commands in your workspaces without approval prompts. Off unless you pass it. See Sessions.
-TunnelUrl wss://host Adds a second address for when you are away from home, a tunnel you run yourself. Turns on requireE2e and checks that the tunnel reaches the companion. See Remote access.
-NgrokDomain <name>.ngrok-free.dev Runs an ngrok tunnel for you, now and at every login, and sets -TunnelUrl. Run ngrok config add-authtoken once yourself first.
-Ngrok <path> Where ngrok.exe is. Default C:\ngrok\ngrok.exe.
-ConfigOnly Only writes companion.json (and the OpenCode launcher). Installs, starts and registers nothing. Useful to see what setup would write.
-NoAutostart Does not register start-on-login for the companion, ngrok or OpenCode.

For example, Claude Code and Codex in two folders, with phone approvals for terminal sessions:

powershell -ExecutionPolicy Bypass -File scripts\setup-windows.ps1 -Workspaces 'C:\Projects\app','C:\Projects\api' -Codex -PhoneApprovals

PowerShell running the setup script with -ConfigOnly, which reports that it wrote companion.json and installed, started and registered nothing

A dry run with -ConfigOnly writes only the settings file.

Allow-listing a folder means trusting it

Your phone can start an agent in any folder you list. Claude Code runs there in print mode, which skips its own folder-trust dialog, so that folder's project hooks and MCP servers load when the session starts. Codex runs there without its sandbox and asks the phone before every file change and every command it does not know as read-only. Only list folders you trust.

The companion refuses drive roots, your user-profile folder and any folder that contains its own data folder. Ways to bypass permissions are never reachable from the phone.

Notes per agent

  • Claude Code. Install it and sign in once by running claude in a terminal. The script warns if claude is not on PATH.
  • Codex. Install the Codex desktop app or the CLI and sign in once (codex login status should say "Logged in"). The companion runs one codex app-server from start to list your Codex threads (about 200 MB of memory). Turns use your ChatGPT plan's limits.
  • OpenCode. CHERNOBYL attaches to an opencode serve you run and never starts a second server. If your server has a password, set it as the user environment variable OPENCODE_SERVER_PASSWORD (and OPENCODE_SERVER_USERNAME if it is not opencode), then open a new PowerShell before running setup. No password is ever written to companion.json. To see a terminal task live on the phone, run it through the watched server: opencode run --attach http://127.0.0.1:4096 "...".
  • Antigravity. Install the agy CLI and sign in once. The phone answers agy's own permission prompts one at a time; the companion never writes agy's settings, so your agy allow-rules still apply.

Where things live

What Where
The installed companion %LOCALAPPDATA%\Programs\CHERNOBYL\chernobyl-companion.exe
Settings %APPDATA%\CHERNOBYL\companion.json
Journal, pairings and audit log %APPDATA%\CHERNOBYL (or the folder in CHERNOBYL_HOME)
Access token User environment variable HOST_TOKEN

Companion commands

Run these with the installed exe, for example & "$env:LOCALAPPDATA\Programs\CHERNOBYL\chernobyl-companion.exe" --devices.

Command What it does
--pair --endpoint ws://<address>:8787 Prints a new single-use pairing QR code, valid for 5 minutes. Repeat --endpoint for more addresses.
--devices Lists the paired phones.
--revoke <device-id> Revokes a phone. Its live connection closes at once.
--tui Starts with a terminal screen for sessions and approvals on the PC (j/k move, a approve, x reject, r refresh, ? help, q quit).
--background Runs without a window (what start-on-login uses).
--install-autostart / --uninstall-autostart Adds or removes start-on-login (your user's Run key, no admin rights needed).
--install-hooks / --uninstall-hooks Adds or removes the Claude Code approval hook for terminal and VS Code sessions.
--backup <file> / --restore <file> Backs up or restores the journal on the same PC.
--token <t>, --bind <address>, --port <n>, --require-e2e Server options. See Remote access.

A restore onto a different PC needs the phone to pair again, because the pairing keys in the journal are protected by Windows for that PC and user.

Demo data in the companion

The companion's default settings, used when you start it without running the setup script, turn on a demo adapter. Its hosts, agents, sessions and approvals appear on the phone marked Simulated. The setup script turns that adapter off. To turn it off by hand, set "enabled": false on the mock entry in companion.json.

Update the companion

Download the new exe, check it, and either replace %LOCALAPPDATA%\Programs\CHERNOBYL\chernobyl-companion.exe or run the setup script again with -Exe pointing at the new file. Restart the companion. Your pairing stays.

Remove it

  1. Run chernobyl-companion.exe --uninstall-autostart (and --uninstall-hooks if you used -PhoneApprovals).
  2. Stop the companion.
  3. Delete %APPDATA%\CHERNOBYL and %LOCALAPPDATA%\Programs\CHERNOBYL.
  4. Optionally remove the HOST_TOKEN user environment variable and the "CHERNOBYL companion" firewall rule.

Next: Pairing.

Clone this wiki locally