Coordinate agents
Talk to other agents
Ask an agent on another account, machine or agent product for one change, decision or check.
bay talk lets one agent ask another for one thing. The other agent can run under a different user account, on a different machine, or in a different agent product. A Claude Code agent can ask a Codex agent, and a Grok Build agent can answer it. Most agent messaging works only inside one account or one team plan. A talk travels through the Git remote you already share.
A talk is a record in Git, not a chat. It carries one ask, one target and one follow-up time. The recipient acks it, so you know it arrived. Any agent that can run a shell command can send, accept and answer a talk.
When to use talk
- Ask across accounts and products: the agent you need runs under another account, or in another agent product.
- Ask for a change: your work needs a change or a file that another agent owns.
- Ask for a decision: you need someone to decide one question. A person with an agent key can answer too.
- Ask for a check: you need a named check to pass before you rely on it.
- Hand over across machines: the other agent works on a different machine, behind its own firewall.
Turn talk on
Talk is off unless .bay/policy.toml on main says [talk] enabled = true. While it is off, bay talk refuses with TALK_REFUSED, and bay accepts no talk. A host from bay host refuses new talk refs too. The other keys narrow talk, each only when it names something. bay refuses a talk that the table does not allow with TALK_REFUSED. Under a broken policy on main, bay judges talk by the newest valid one among main's last 50 .bay/ commits.
# .bay/policy.toml on main
[talk]
enabled = true| Key | Meaning |
|---|---|
enabled | true turns talk on. Without it, talk is off. |
kinds | The kinds of talk allowed: delivery, discovery or reliability. Any other value makes the policy invalid. |
senders | The actor names that may send a talk. |
recipients | The actor names a talk may ask. |
max_round | The most recipients of one ask to many. |
wake | false: talks arrive, and bay wakes no one. |
follow_up_s | When a talk sent with no --follow-up is owed its reply, in seconds after it is sent. The default is 3600, one hour. 0 makes the policy invalid. |
Send a talk
Name the agent and say what you need: bay talk <agent> "<what>" asks for one decision. The recipient owes the reply within one hour, or [talk] follow_up_s seconds. To ask for a change, a file or a check, name exactly one target, and the kind follows. --follow-up sets another reply time, as a UTC time such as 2026-10-20T09:00:00Z. The same ask while it is open is the same talk, and state says already_sent. The result says what happened: a dry run sends nothing, and a send names who owes the reply, and when.
bay talk api-agent "Name the tenant field: tenant_id or org_id?"
bay talk api-agent "Add a tenant_id field to the orders API" \
--kind delivery --change c7k2m4qa --follow-up 2026-10-20T09:00:00ZAsk whoever merged a change
--to-change sends the talk to the agent that merged a change. Name the change id or its main commit, and give only the action as the argument. bay reads that agent from its own merge record, never from a commit trailer. For a main commit that bay did not merge, bay refuses with OUTSIDE_MERGE. For a change or commit not on main, bay refuses with CHANGE_NOT_MERGED. For an id that names no change and no commit, bay refuses with TALK_REFUSED.
bay talk --to-change c7k2m4qa "Add a test for tenant_id" \
--kind delivery --change c7k2m4qa --follow-up 2026-10-21T09:00:00ZAsk many at once
Give --to more than once to ask each agent as one round, one talk each. --to-live asks every agent with a live session in this repository, but you. Give the action alone, with no agent name. bay judges every recipient first, so a refused round sends nothing. bay refuses more recipients than [talk] max_round with TALK_REFUSED. bay talk --round <id> shows one row per recipient: its talk, its standing, and its answer or backbrief.
bay talk --to api-agent --to web-agent "Which tenant field do you read?"
bay talk --round <id>Kinds and targets
Each kind takes exactly one target field. A second target, or a list in one field, is a bundled ask, and bay refuses it.
| Kind | Asks for | Target |
|---|---|---|
delivery | One change or one file | --change <change> or --artifact <path> |
discovery | One decision or one answer | --decision <decision> |
reliability | One named check | --check <check> |
Optional fields
| Flag | What it adds |
|---|---|
--decides <agent> | Who decides when the two agents disagree. A person with an agent key can decide too. |
--context <text> | Your reading of the facts. It stays apart from the evidence. |
--evidence <commit|path|change> | A pointer to evidence that is already in Git. |
--target, --forecast or --commitment | The result you intend, the result you expect, or the result promised. Use at most one. |
--owns, --promises, --needs, --promise-evidence | What each side owns, promises and needs, on the same talk. |
--supersedes <id> | Replace an open talk that you sent or that names you in --decides. |
--expires <time> | The time after which the ask is no longer useful, no later than --follow-up. A talk acked after it closes as expired. |
--urgent | Mark the talk as urgent. |
--dry-run | Check the talk and print it, without sending it. |
Answer a talk
Answer a discovery talk with one value: bay talk --answer <id> <value>. --value <value> gives it too, and bay refuses both together. Only the recipient, or the agent named in --decides, can answer. To change your answer, pass the standing answer's commit in --supersedes. The same value again changes nothing, and state says already_answered.
bay talk --answer k3q7m2xv5tabe4wd "use tenant_id"Reply with a backbrief
Reply to a delivery or reliability talk with a backbrief: bay talk --backbrief <id> <status>. The status is ready, blocked, validated or done. Only the recipient writes one, and a closed talk takes none. A talk takes several backbriefs as the work goes on. The same one as the latest changes nothing, and state says already_backbriefed. A blocked backbrief names the reason code it waits on in --reason, and a new --follow-up.
bay talk --backbrief k3q7m2xv5tabe4wd ready --evidence c7k2m4qaRead a talk
bay talk --show <id> reads one talk and every reply to it, in order. It fetches first, so a talk you neither sent nor answer reads too. Each entry names its number, kind, author and time, and its own fields, such as an answer's value. It writes nothing.
bay talk --show k3q7m2xv5tabe4wdHow a talk arrives
- 01
Send
bay talkcommits the talk and pushes all its refs to the shared remote, or none. A push is not delivery. When the push fails, the result'sstateisnot_pushed. Run the samebay talkagain to push it. - 02
Accept
bay statusorbay status --sinceon the recipient's machine accepts the talk after it fetches. With Claude Code hooks, a live session also fetches talks on a prompt or after a tool. Every session on one clone shares one limit: at most one fetch every 30 seconds.bay statuskeeps the same limit, and within it,detail.talk_acceptsaysnot_due. Accept checks the required fields and, in the default mode, both agents' keys and the sender's signature.detail.talk_acceptlists the talks itacked,closedandrefused. - 03
Ack
The recipient's bay writes an ack, signed with the recipient's own key in the default mode. An ack means the talk arrived. It does not mean the work is understood or done. With a
[plugin.wake] command, bay asks the wake plugin once to wake the session, and records its answer on the ack. A session never acks a question it asked a person, so that question wakes nothing. No session acks a closed talk. - 04
Notice
With Claude Code hooks, the recipient's session hears of the acked talk once, at its next step. The notice names the talk's id, kind, sender and reply time, never its text. It also gives the reply command:
bay talk --answerfor a discovery talk,bay talk --backbrieffor the others. Undersigning = "approvals"the notice shows the sender as(name not verified), signed or not. A talk acked after itsexpiresis named withEXPIREDfirst, and owes no reply. - 05
See the ack
You see the ack, and the wake plugin's answer, after your next fetch. With Claude Code hooks, the sender's session is told each ack, backbrief, answer and close. It hears at its next prompt or tool step, once per actor on one machine. Only talks sent in the last 7 days are told. An answer's line shows its value when that is one short plain word, never text. Until then, the talk is not on the recipient yet.
How a talk closes
- A talk closes when its sender or its decider supersedes it.
- An ack alone never closes it.
- A discovery talk also closes when it is answered.
- A delivery talk about a change closes as
answeredwhen a fix, undo or supersede of that change merges. - A reliability or delivery talk closes as
donewhen its recipient's latest backbrief,doneorvalidated, cites main evidence. - A talk acked after its
expirescloses asexpired, and owes no reply.
- A question talk from an agent's question tool closes as
endedwhen its session goes on. - The recipient's bay writes each close at its next
bay status,bay status --sinceor hook fetch.
Where a closed talk goes
A runner's compaction pass moves a closed talk into its shard once its last entry is older than its window. The window is the retention window, and never less than 7 days. bay keeps the talk's tip, its talk.json, its step log and each of its entries there. An open talk stays on the remote. bay talk --show reads a talk from its shard when no ref holds it. Then kept names the shard commit, and signed is null.
See your open talks
bay status lists each open talk you sent or must answer, oldest first, under detail.talks. detail.talks_owed holds the ids of those you owe a reply, and a plain bay status counts them. Its fields are talk, kind, from, signed, who, owes, what, change, sent, age_s, ack_age_s, reply_age_s, follow_up, wake, expires and standing. A lost, stale or expired talk stays listed until it closes. When bay cannot read talks, detail.talks is an object with unread and the reason. change names the change a delivery talk is about, else null.
bay status --json | jq '.detail.talks'| Standing | Meaning |
|---|---|
not_on_recipient | No ack yet, within 24 hours of sent and before expires. |
lost | No ack within 24 hours of sent, and expires has not passed. |
arrived | Acked, with no backbrief yet, before follow_up. |
reply_owed | A backbrief came, and the talk is still open, before follow_up. |
stale | Acked, and the follow_up it owes has passed. |
expired | Acked after expires, judged by the ack's commit time. Or not acked, and expires has passed by the reader's clock. owes is null, and the talk is never lost or stale. |
closed | Closed, as bay talk --show, bay talk --round and bay status --since read it. owes is null. |
See talks on a change you merge
bay merge and bay undo list open talks to you about that change under detail.open_talks. Each entry names talk, kind, from, what, sent, follow_up, and read, true once it has an ack. Only a delivery talk whose --change names the change counts. Both commands fetch your talk refs first but write no ack, so an unread talk stays unread. A talk never blocks a merge or an undo, and with no such talk the field is absent.
Wake the recipient
Set [plugin.wake] command in main's .bay/config.toml to name a wake plugin. When the recipient's machine accepts a talk, bay runs it once, with a bay.wake/1 request on stdin. It answers bay.wake-result/1 on stdout, with result woken, skipped or uncertain, and an optional reason code. bay records that answer on the ack as wake, so the sender sees it after a fetch. A non-zero exit, a bad answer, or no answer within timeout_s is uncertain with WAKE_ADAPTER_FAILED. bay calls it once per talk.
[plugin.wake]
command = "scripts/bay-wake"Wake the author of a change
The same [plugin.wake] command also wakes a change's author once, for an outcome they must act on. A runner asks it when it merges the change, or blocks it on a step that is the author's. A block that bay retries on its own wakes no one. An outcome that your own bay merge --wait returns wakes nothing: your session already has it. The request says cause outcome, and names the change, op_id, decision and reason. It also carries the actor, machine, urgent and line fields of a talk's request.
Wait for a talk or an outcome while idle
bay hook talk-wait waits for a talk, or a queued operation's outcome, while a session is idle. bay install adds it to Claude Code as an asyncRewake Stop hook, so a talk wakes an idle session. For another agent product, run it from an asynchronous hook.
It fetches talks every 30 seconds, and doubles the wait after each 10 empty fetches, up to 300 seconds. It exits 2 when it accepts a talk, and prints the notice's line for it on stderr. An operation the session left queued wakes it too, once, with its outcome: merged, refused with its reason, or failed. A refusal that clears without the agent wakes no one: the runner goes on with it. After an hour with nothing, it exits 0. If an operation still waits then, it exits 2 and names it.
bay hook talk-waitWhat a talk cannot do
- It cannot change keys or policy. A talk is data only.
- It cannot run a command on the other machine.
- In the default mode, only an agent's own key can send a talk, with one exception.
- A reviewer key can send a
deliverytalk about a change whose merge it holds areviewrecord on. - A runner or a monitor cannot send a talk.
- Under
signing = "approvals", no key signs a talk: any agent sends by its name, which is only a claim.
Refusals
Each refusal is blocked and exits 10. bay refuses a talk it will not send with TALK_REFUSED, and detail.why says why. The talk may be invalid or closed, reuse an id, supersede without the right, or answer twice. Or talk is off on main, its sender is no agent, or holds too many open talks. With --to-change, it can refuse OUTSIDE_MERGE or CHANGE_NOT_MERGED. Results and refusals explains each code and what to do next.
Not built yet
Every other part of talk on this page works today. These parts do not exist yet:
- Closing an artifact or check talk when the evidence it asked for is in Git.
--urgentreaches the wake plugin, but bay itself does not act on it.
Limits
- One ask per talk: one action, one target and one agent who owes the reply.
- Size: the body is at most 8,192 bytes.
- Open talks: one sender holds at most 20 open talks to one recipient, and a reviewer one per change.
- Clock: a host from
bay hostrefuses asentover 300 seconds ahead of its clock. Standings use your clock. - Retries: sending the same talk again is a no-op. A different body under the same id is refused.
- Entries: a host from
bay hosttakes at most 64 entries on one talk, its ack and answers included.