---
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."
disable-model-invocation: true
description-tr: "Bir telefonu bu bilgisayarla eşler; koşular telefondan listelenir, sorular yanıtlanır, koşular durdurulur. Eşleşmeyi yönetir (listele, kaldır, kapat). Site hesap için açana ve bir telefon eşlenene kadar kapalıdır. Yalnızca kullanıcı yazdığında çalışır."
argument-hint: "[--list | --revoke <device> | --off | --start | --status]  -  with no argument, a new phone is paired"
parameters: [{"name":"--list","kind":"flag"},{"name":"--revoke","kind":"text"},{"name":"--off","kind":"flag"},{"name":"--start","kind":"flag"},{"name":"--status","kind":"flag"}]
gui: form
destructive: false
confirm: required
allowed-tools: Bash, AskUserQuestion
---

# multi-agent pair  -  control runs from your phone

> **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.

**Input**: $ARGUMENTS

Remote control is off by default. Nothing runs, polls or listens until the
site has enabled it for this account and a phone has been paired here. There
is no inbound port: the computer only makes outbound HTTPS requests to the
site, which relays end-to-end encrypted messages. What the phone can do is
fixed: list runs, read a run's status and pending question, answer a question
with one of its offered options, stop a run's session. It cannot run a
command, read a file or start a run.

Read `$HOME/.claude/multi-agent-refs/features/remote-control.md` for what
leaves the machine and what the site can and cannot do.

## Pairing needs the person

Pairing trusts the JavaScript the site serves to the phone while it runs, so enable remote control only for a site the user operates or trusts as much as their own machine, and say so.

Refuse in an unattended or autopilot run: if `MULTI_AGENT_UNATTENDED=1`, say
that pairing needs a person and stop. Never guess, derive or read the
confirmation number; it exists to prove the person looked at the phone.
Do not read `remote/pending.json` or any file under the state directory.

1. **Begin, run by the person.** The QR code and the fallback code are a
   secret for five minutes, and the host's shell tool has no terminal to show
   them on, so when this command runs them they land in the session. Tell the
   person to run the first step themselves, in a terminal window of their own,
   so the code never passes through you:

   ```bash
   node "$HOME/.claude/scripts/pair.mjs" begin
   ```

   The host's `! <command>` prefix runs the same command from this prompt:
   `! node "$HOME/.claude/scripts/pair.mjs" begin`; the code is shown in the
   session only if the host gives that command no terminal. Wait for the person
   to say it is done. Do not ask for the code and never repeat it. Tell them to
   scan it with the phone camera (or open the page and type the code), sign in,
   and create the passkey. Exit 3 means the site has not enabled remote
   control, or this account lacks the permission; exit 4 means the site did not
   accept this machine's usage token: if the person reports either, say which
   and stop.

   Fallback, only when the person cannot or will not use a terminal: run the
   same command yourself. The output then contains the code; show it exactly as
   printed in a code block 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 keeps a session that saw the code from finishing the pairing.

2. **Wait.** Run `node "$HOME/.claude/scripts/pair.mjs" wait --timeout 90`
   until it reports the phone registered (repeat while it says still waiting
   and the code has not expired).

3. **Ask the person** (AskUserQuestion, free text) for the six-digit number the phone
   now shows, and nothing else. Then run
   `node "$HOME/.claude/scripts/pair.mjs" confirm <number>`.
   A wrong number rejects the pairing for good, warns that someone may be
   interfering, and blocks new pairings for a growing cooldown (kept on this
   machine). Relay the warning as printed.

4. **Report** in `outputLanguage`: paired or not, the device label, and that
   the background listener now runs until `pair --off`.

## Managing

- `--list`: the phones pinned on this computer.
- `--revoke <device>`: forget one phone here (id or a unique prefix) and remove
  it on the site when the site is reachable. If the output says only this
  computer was acted on, tell the person to remove it on the site too.
- `--off`: stop the listener and forget every phone; the site is told when
  reachable. Works offline, with the same note when the site could not be told.
- `--start`: start the listener again for pinned phones.
- `--status`: listener and device count.

All run as `node "$HOME/.claude/scripts/pair.mjs" <flag>`; add `--json` for
parsing. Never print or ask for the usage token; the script reads it from the
credential store itself.
