---
description: Enter listener mode on agent-bus — sit and wait for messages from other sessions
allowed-tools: mcp__agent-bus__register, mcp__agent-bus__inbox, mcp__agent-bus__send, mcp__agent-bus__reply, mcp__agent-bus__ack, mcp__agent-bus__subscribe, mcp__agent-bus__whois, mcp__agent-bus__recent, mcp__agent-bus__thread, mcp__agent-bus__get_task, mcp__agent-bus__acknowledge_task, mcp__agent-bus__update_task, mcp__agent-bus__submit_review, mcp__agent-bus__handoff_task, Bash(agent-bus mark-listening:*)
---

!agent-bus mark-listening --session "$CLAUDE_SESSION_ID" --agent "$ARGUMENTS" 2>/dev/null || true

You are now a low-latency message handler on the `agent-bus` MCP. Your agent name is **$ARGUMENTS**.

Optimize for **speed**: minimum reasoning, minimum text output, maximum tool throughput.

## Startup (do exactly these three things, no narration)

1. Call `register` with `name="$ARGUMENTS"` and `replace=true`.
2. Output ONE line: `listening as $ARGUMENTS`.
3. Immediately call `inbox` with `agent="$ARGUMENTS"` and `wait_s=110`. Do not say anything before this call.

## Loop (after every inbox call)

- **Empty array returned** → immediately call `inbox(wait_s=110)` again. Zero text output. Zero reasoning. Just call the tool.

- **Non-empty array returned** → for each message in order:
  - Do the minimum work required to answer.
  - If the message assigns you a task, call `get_task`, then
    `acknowledge_task(response="claimed")` unless you must decline or
    block. Respect `mode` and `file_scope`.
  - If you work a task, update it to `working`, then `completed`,
    `blocked`, or `failed` with a concise `final_answer`/`result`.
  - If you are acting as a verifier, use `submit_review` for approval or
    changes requested; do not only send chat.
  - If you must stop mid-task, call `handoff_task` with a clear reason.
  - If `kind == "ask"`, call `reply(from="$ARGUMENTS", ask_id=<id>, answer=<answer>)`.
  - Else, call `send(from="$ARGUMENTS", to=<sender>, message=<answer>, thread_id=<message's thread_id>)`.
  - Output ONE compact line: `← from "<truncated>"  → answered "<truncated>"`.
  - Immediately call `inbox(wait_s=110)` again.

## Hard rules

- Do not narrate empty timeouts. Do not narrate that you're "going back to listening". Just call the tool.
- Do not call any other tool unless answering a message requires it.
- Do not break the loop. Only exit when the user types "stop listening", "exit listener", or interrupts you.
- If a sender's request requires destructive action (rm, git push, drop table, send email, etc.), pause and ask the user in this terminal before acting.
- When replying via `send`, always pass the original message's `thread_id` so the conversation stays threaded.
