Agent Communication
Structured inter-agent protocol for reliable delegation.
1 skill · 1 tool
A structured protocol that lets agents delegate work to each other with clear handoff, status tracking, and delivery verification.
What it does
Every agent message ends with exactly one terminal marker, so a caller always knows whether the
work is done, blocked, or needs input. The canonical marker set — definitions and semantics — is
owned by the devbot:agent-communication skill; this page does not restate it.
One rule is checked mechanically. On session.idle the module’s hook re-validates the last
assistant message with --require-wait: a [WAITING_FOR_PTY] whose message started no wait — no
completed pty_spawn, no bash/shell with background: true — fails with that reason. The flag
is opt-in because only a caller holding the message’s tool parts can judge it; a text-only
invocation keeps marker-only semantics. The same pass names the marker the message actually ends on
(the one leading the last line), so a caller never has to re-derive it.
When the claim has nothing behind it
An unbacked claim is not only logged. The host that can reach the agent says so, in the same execution, so the turn is never taken as final.
| Host | What it checks | What it does |
|---|---|---|
| opencode v2 | the host’s own list of running work | steers a synthetic message into the same execution |
| Claude Code | --require-wait over the transcript |
answers the Stop with the sentence as guidance |
The v2 pass decides the wait from what the harness says is still running, so it infers nothing from
the message’s tool parts; it reads the message only to see which marker ends the turn, and it stays
quiet when the host reports no background state at all. There is no nudge limit — a turn that repeats
the claim is corrected again. On Claude Code the platform itself stops honouring consecutive Stop
continuations past its own limit: the hook still runs, but its guidance is no longer acted on. A v2
host has no such ceiling, so an agent that never starts the wait keeps being steered.
The validator reports this case as exit 3. Both 1 and 3 are findings — the idle pass marks the
message checked on either — and 3 names this one specifically, so a caller can tell an unbacked
claim from any other failure. Hosts that can only log still do exactly that.
Reporting to herdr
Inside a herdr pane the same idle pass publishes that marker to the pane as
display-only metadata — the devbot token, e.g. devbot=NEEDS_INPUT — so the workspace manager can
show how a turn ended. It is metadata on purpose: a state report would take the pane’s lifecycle
authority, rename its agent, and strand the pane as unknown on release. The token is cleared when
the turn does not end on a marker — the validator still accepts one quoted mid-body, but only the
marker leading the last line is published — and it is left alone when the validator invocation
itself fails. The report is skipped entirely outside a herdr pane (HERDR_ENV/HERDR_PANE_ID) or
when herdr cannot be reached — a herdr failure never affects a turn. A subagent session never
publishes: it shares the pane, so its marker is not the pane’s turn end.
The pass runs on opencode v1 through this module’s hook. A v2 host skips module plugin hooks, so
the harness ships agent-communication-idle, a v2 adapter package that wraps the same pass against a
v2 context, and agent-communication-wait-nudge, which carries the nudge above. On Claude Code
the Stop hook hands its transcript to tools/claudecode-idle.sh, which rebuilds the last assistant
turn, validates it, answers an unbacked wait with guidance, and publishes the same token — there is
no plugin API to wrap there.
A turn that pauses also labels the pane’s idle state: working (pty) for [WAITING_FOR_PTY] and
unfinished for [PARTIAL], with every other marker clearing the label. This is the state’s text,
not the state: herdr’s own integration keeps idle/working/blocked, refuses a working claim
from a source that does not hold the pane, and strands a pane whose authority is taken, so devbot
moves the words and leaves the state alone. The label is only visible in a sidebar row that carries
state_text — the default rows show the state icon and the agent name.
Protocol rules
- Post-delegation verification — the orchestrator checks that deliverables exist on disk before
accepting
[FINISHED]. - Prompt-opener gate — file-producing agents must open with
Write <path> <verb>…or block immediately. - First-tool-call invariant — the first tool call must be the declared write; no reads before.
- Stall ceiling — the same subagent returning
[PARTIAL]twice escalates to the human.
How it is used
devbot (pair programmer) and teamlead (orchestrator) use agent-communication whenever they
delegate to a subagent, so handoffs are verified rather than assumed. The protocol is applied by the
agents that load this skill; the agent-communication tool validates a saved message against it on
demand.
Contents
| Type | Name | Purpose |
|---|---|---|
| Skill | devbot:agent-communication |
Load at session start in every project that runs subagents. Use when delegating to or receiving work from a subagent, or when phrasing a message to the human — verdict first, tone matching the conclusion. |
| Tool | agent-communication |
Validates a saved message against the protocol |
Configuration
No project configuration is required — the module is wired by installation alone.