---
name: pi-intercom
description: "Discover eligible local, cross-device, and Antigravity sessions, send immediate steering messages, publish workingOn claims, or read a peer's last completed response without waking it. Ships in the unified pi-subagents extension."
---

# Pi Intercom

`intercom` ships together with `delegate` and `agent_runs` in the single unified
`@fitchmultz/pi-subagents` extension—no additional package is needed for this
tool (note: an unrelated third-party `npm:pi-intercom` package also registers an
`intercom` tool and `pi-intercom` skill, so do not load both together). The
`intercom` tool is eager on every Pi session (mains and children)
and on Antigravity (`agy`) IDE sessions via the bundled MCP bridge (which also
exposes `delegate` and `agent_runs` to main Antigravity sessions). There is no
loader, separate child supervisor tool, workflow UI, or topic registry.

1. Use `intercom({action:"list"})` before choosing a peer. It prints the main
   sessions first (including connected Antigravity `agy-*` sessions and bridge
   mailboxes), then the child sessions of your group as one count line. A child
   is a valid target by name or ID without its row; `children:true` prints the
   rows. Rows include `git: <repo> (<branch>)` when the peer is inside a Git
   repository (branch name or detached short SHA), `working_on:<note>` when the
   peer set a claim, `worker_started:<age>` (the current worker process age,
   refreshed on `pi restart`), and `last_turn_error:<error>` when the peer's
   most recent assistant turn failed. Default discovery spans projects and agent
   directories under the
   same OS user; optional `scope:"project"` filters to this repository and its
   worktrees, and optional `to` keeps the sessions whose name or ID contains it,
   child rows included.
2. Pick the exact displayed target. Names are not unique; resolve ambiguity rather
   than guessing. The current session is not a peer target.
3. Choose the lightest operation. The lightest is no message: do not send
   acknowledgements, thanks or receipts. Send only what the peer must act on or
   must know to avoid a mistake. When a message you receive needs no action, do
   not reply and do not restate it.
   - `send`: immediate fire-and-forget steering; wakes a dormant or idle peer
     immediately (starting a model turn) and steers a busy peer right after its
     active tool boundary. Every message has this single steering behavior. When
     you need an answer from a peer, send your question and end your turn (or
     continue other work); the peer responds with `send` to the name or exact ID
     in your inbound header.
   - `last`: original last completed assistant text, without waking the peer;
     unpinned reads also report `Latest turn failed (<entryId>): <error>` when a
     newer assistant turn on the active branch failed.
   - `status`: connection, peer health and inbound queue state.
   - `claim`: set or clear (`message:""`) a short 1-line `workingOn` note on
     your presence record in `list` without waking any peer. Notes over 256 UTF-16
     code units after normalization are rejected; the previous note stays visible.
4. Handle the actual outcome. Broker acceptance is not recipient persistence,
   model consumption, a reply, completion, or process exit. Do not replay an
   uncertain side effect merely because its response was lost.

## Topology

A main and its children form one group. Every pair inside it can communicate.
Mains can also communicate with other mains. Children cannot discover, send to,
or read a foreign group's agents—even with an exact ID. Only mains delegate;
there is one level. Cwd and agentDir do not define groups. These are coordination
rules, not a sandbox against other code running as the same OS user.

## Other devices

A main can list the main sessions on the owner's other devices:
`intercom({action:"list", device:"all"})`, or one device name. The answer has one
block per device, with rows written `name@device`, and no session of this device.
A device can also be unreachable, have no Pi session, or lack the command; its
block says which.

The name and the ID of a row are targets: `send` with `to:"name@device"` reaches
that main. A native message from another device shows its sender as `name@device`;
use that as `to` for a message back. For a forwarded
notice, send to the reply address shown in its header, if any. A failure says whether
the message was not sent, or whether its delivery is unknown; check the
recipient before sending an unknown one again. `last` reads only the sessions of
this device.

A target ending in this device's configured alias resolves locally using the
usual group rules. Only mains can contact other devices. If no devices are
configured, a `device` list names the file and the keys to set.

## Delivery and paging

Every `send` across Intercom has one delivery behavior: immediate steering. It
wakes dormant or idle recipients immediately and delivers to busy recipients at
their next tool boundary. (Remote Intercom bridge mailboxes that gate container
wakes on a quota still store every message in the durable mailbox, and suppress
the remote wake webhook only when a non-question note starts with `ACK`,
`DUP-ACK`, `FYI`, `NOTE`, `RECEIPT`, or `NOWAKE`.)

`last` returns a stable entry ID and offsets. Follow its exact next-page call to
retrieve all text; offsets are UTF-16 code units, not bytes. A read never sends a
model prompt. It does not substitute a fabricated status summary for the answer.

Keep messages compact and self-contained: objective, scope, files, authority,
stop boundary, and expected reply. Never attach secrets or unrelated private
context. Use ordinary run completion for delegated handoff, not duplicate sends.

## Recovery

If a target disappears, list again.

Old agent-directory brokers may coexist during migration; updated sessions use
the same-user broker. Do not kill another broker or change runtime configuration
to force discovery. Only intercom-connected eligible sessions appear, not all
open Pi processes. See [local messaging](../../docs/intercom.md) for broker and
persistence contracts.
