---
name: multi-agent-pair
description: "Pairs a phone so runs can be listed, answered and stopped from it; lists, revokes and switches off pairings. Off until the site enables it and a phone is paired. Invoked only when the user types it."
user-invocable: true
argument-hint: "[--list | --revoke <device> | --off | --start | --status]  -  with no argument, a new phone is paired"
metadata:
  language: en
---

# multi-agent-pair

Remote control is off until the site enables it for this account and a phone
is paired. No inbound port is opened. Read
`$HOME/.claude/multi-agent-refs/features/remote-control.md` first.

Pairing needs the person: refuse when `MULTI_AGENT_UNATTENDED=1`, and never
guess, derive or read the confirmation number.

1. The person runs `node "$HOME/.copilot/scripts/pair.mjs" begin` themselves,
   in a terminal window of their own (the host's `! <command>` prefix runs it
   from the prompt: `! node "$HOME/.copilot/scripts/pair.mjs" begin`), because
   the host's shell tool has no terminal and the QR code and code would land in
   the session; run this way, the code never passes through you. Wait for them
   to say it is done; never ask for or repeat the code. Exit 3 means the site
   has not enabled it or the account lacks the permission; exit 4 means the
   usage token was not accepted: if the person reports either, say which and
   stop. Fallback, only when the person cannot use a terminal: run the command
   yourself, show the code exactly as printed, and say plainly that this
   session can see it and that the six-digit number the phone shows, which only
   the person types, is what bounds that.
2. `node "$HOME/.copilot/scripts/pair.mjs" wait --timeout 90`, repeated until
   the phone registered.
3. Ask the person for the number the phone shows, then
   `node "$HOME/.copilot/scripts/pair.mjs" confirm <number>`. A wrong number
   rejects the pairing and starts a local cooldown.
4. Report in `outputLanguage`: paired or not, and the device label.

Managing: `--list`, `--revoke <device>`, `--off` (works offline), `--start`,
`--status`, all through the same script. The site is told too when
reachable; if the output says only this computer was acted on, remove the
phones on the site as well.
