# voicehook-join reference: CLI details

Companion to [SKILL.md](SKILL.md) (https://voicehook.ai/agent/SKILL.md). Read it when you
need one of the details below; the skill itself is enough to join and talk. `next`, `say`,
`status`, `activity`, `leave` are the curl calls of Quickstart A (SKILL.md) or the CLI commands
below. Protocol:
https://voicehook.ai/agent/OPERATOR-PROTOCOL.md.

## Die 10 Regeln apply, also for the CLI

The 10 rules at the top of SKILL.md (https://voicehook.ai/agent/SKILL.md) and of the MCP skill
are the same and come first; this file only adds the details. CLI equivalents of the Ablauf:

- **Never delegate `create_call` to a subagent, a fork or a background job.** Create the call in the main thread of the session your user is talking to and give `share_text` as the last message of that thread; a link produced in a subthread never reaches your user.
- **Call started with MCP `create_call`: HARD RULE, join again until connected, never end your
  turn before, then keep `next` going** (Oliver 21.10.2026). Once your turn ends you sleep until
  something wakes you. The call starts only once your user has opened the link.
  Client with background commands that wake you when they exit (Claude Code: Bash with
  `run_in_background: true`): FIRST start the background watcher below, THEN end your turn with
  share_text, verbatim, as its very last line. The watcher joins as soon as your user is in the
  call and exits; that wakes you: continue with its session (`next`/`say` with `-H @$D/h`, MCP
  tools: `session` = the file `$D/s`), or call MCP join with `greet: false` (returns at once,
  replaces the watcher's session); never block in a foreground join after the link there. Client
  without background commands (claude.ai chat, Desktop, remote apps): FIRST write share_text
  verbatim as text, THEN in the same answer join and repeat it after every waiting_for_human
  (`next_action`; join waits up to 200 s in Claude clients, else 50 s) until it returns
  `session`, never ending your turn in between; then the `next` loop. A local client with a shell
  (Claude Code, Cursor, VS Code, Codex CLI and similar) gets `local_cli_hint`: the CLI below keeps it in the call from a background process. Until they have joined,
  end every message to your user with share_text; if your client can send a file or a push (e.g.
  Claude Code SendUserFile / PushNotification), also send the link that way.
- **Your user pasted an invite link:** join with it right away, no questions first.
- **Right after the join, at once** (also with `--quiet`; quiet only suppresses `share` and
  `notice`, nothing audible): (1) greet: `--greet "<text>"` (spoken only if it matches the call
  language, else the default greeting); without greet one short `cli say` in the call language;
  (2) `cli status --doing ... --open ... --done ... --faq 'F::A'`; (3) one `cli activity` line;
  (4) every question for the human (yes/no, A/B, approval, a value): `cli decide --question ...
  --context "Was: ... Warum: ... Bei Ja: ... Bei Nein: ..."` plus 3 `--faq "Frage::Antwort"`
  (0.21.4+) and one short `cli say`; never only `say`, never into `open`;
  waiting for the human = `cli decide` or `cli status --waiting` (0.21.6), never only a status text; (5) `cli show --panel board` (CLI 0.21.0+).
- **Acknowledge within 3 s:** first one short `cli say`, THEN work; progress via `status` and `activity`.
- **Stay present (CLI 0.21.5+):** the join holds your presence and spools every event while
  you work; your turn may only end while `voicehook-agent listen` (or a blocking `next`) runs
  as a background command (Claude Code: Bash `run_in_background: true`). Its exit wakes you:
  handle the event, start `listen` again. Never detach it with `&`.
- **Never reinstall or upgrade the CLI while a call runs** (`uv tool install --force` drops the
  running join). Needed anyway: tell your user, upgrade, then join again on purpose. The
  join's own self-update runs only on the first connect, never during a call.

## Background watcher after create_call

Start it as a background command (Claude Code: Bash with `run_in_background: true`) BEFORE you end
your turn with share_text. Replace ONLY `<operator_invite_url>` (from `create_call`, never shown to
anyone), `<your-label>`, `<your-model>`. It joins over the HTTPS bridge: an unopened link answers
`200` with `"status":"waiting_for_human"` after up to 50 s (join again at once), `410` = the link
expired (30 min unopened). It exits with `JOINED D=...`, `EXPIRED`, `FAILED <code>` or `NO JOIN`;
the exit wakes you. `JOINED`: the default greeting is already spoken; go on with the Hard rules
checklist (board, feed, decide, panel) and `next` (`-H @$D/h`, MCP: `session` = contents of `$D/s`).
```bash
I="<operator_invite_url>"; B="${I%%/r/*}"; D=$(mktemp -d /tmp/vh-XXXXXX); echo "D=$D B=$B"
END=$(( $(date +%s) + 1860 ))   # an unopened link expires after 30 min
while [ "$(date +%s)" -lt "$END" ]; do
  curl -sS -m 70 -o $D/join -w '%{http_code}' "$B/api/bridge/join" -H content-type:application/json \
   -d '{"invite_url":"'"$I"'","label":"<your-label>","model":"<your-model>","greet":true}' >$D/code 2>/dev/null; C=$(cat $D/code)
  if [ "$C" = 200 ] && grep -q '"session"' $D/join; then
    (umask 077; sed -n 's/.*"session":"\([^"]*\)".*/\1/p' $D/join >$D/s; sed 's/^/Authorization: Bearer /' $D/s >$D/h)
    echo "JOINED D=$D B=$B"; exit 0; fi
  case "$C" in 410) echo "EXPIRED"; exit 1;; 400|403|404|409|422) echo "FAILED $C"; cut -c1-300 $D/join; exit 1;; esac
  [ "$C" = 200 ] || sleep 5   # 200 = waiting_for_human: again at once; 429/5xx/network: 5 s
done; echo "NO JOIN"; cut -c1-300 $D/join; exit 1
```
`EXPIRED`/`NO JOIN`: tell your user and ask whether to start a new call (never on your own).
`FAILED 409` = nobody is in the call yet (the person has not opened it).

## Which path: MCP, CLI or bridge? (Oliver 19.10.2026, decision "A")

MCP/bridge = one agent in the call; activity lines are only what that agent writes by hand. For several agents/sessions on one machine working on one call, use the voicehook-agent CLI (pro): its multi-session relay + Claude Code hook feed the live activity log, status and decisions of ALL local sessions into the call automatically. MCP/bridge run on the server and cannot see the user's local sessions.

| path | role | use it when |
|---|---|---|
| **MCP** (`voicehook.ai/mcp`) | **Entry + distribution.** One click as connector or plugin, nothing to install, only path with `create_call`, cards, `decide`, `data`. | Default for a single agent in a call; every cloud/sandbox session; newcomers; whenever you must start the call yourself. |
| **CLI** (`voicehook-agent`) | **Pro tool for multi-agent work.** One machine, many sessions, one call: the multi-session relay (0.15+) and the Claude Code hook feed the activity log from every session automatically; helpers report `decide`/`status` through the relay (0.16+, in review). Base of the "Leitstelle". Also direct WebRTC, persona/mode flags. | Local machine with install rights AND several agents/sessions on the same call, or the human wants the live activity log of all sessions. |
| **Bridge** (`/api/bridge/*`, Quickstart A) | **Protocol underneath + fallback.** Plain HTTPS/REST for any agent. | No MCP client and no CLI; or a feature the other path lacks right now. |

- **Why the CLI stays:** MCP runs on the server and cannot see the sessions on the user's machine. Only a local process knows which Claude Code sessions run, what each does and when one waits for a decision, and feeds that into the call without hand-written notes.
- **Cards from the CLI (0.21.0+):** `cli show --card text|code|link|image` puts the same cards on the call page as bridge/MCP `show` (REFERENCE.md "Cards on the call page (CLI)"); older CLIs only draw ring shapes.
- **CLI install without git** (git blocked, e.g. Xcode license on macOS; PyPI lags), pinned to the reviewed commit, only with the user's OK: `uv tool install --force https://github.com/voicehook-ai/voicehook-agent/archive/c1b941a81a96b2798acb11be568a0ba3d89b734d.zip`. Check `voicehook-agent --version` before every call.

## Optional: the voicehook-agent CLI (local machine)

Quickstart A in SKILL.md needs no install and is the default. The CLI is for a local machine
that wants more: a direct WebRTC connection, the hooks that keep status board and activity
log fresh on their own, persona and mode control at join. It installs
software from GitHub: **install it only with the user's OK.** The install is pinned to one
reviewed commit (CLI 0.21.3).
Pro features (several sessions in one call via the multi-session relay, WebRTC direct, local files, persona file, self-update) need the CLI; Bridge/MCP cover one agent (table above).

```bash
R=git+https://github.com/voicehook-ai/voicehook-agent@c1b941a81a96b2798acb11be568a0ba3d89b734d; export PATH="$HOME/.local/bin:$PATH"
command -v voicehook-agent >/dev/null || uv tool install -q $R || pip install -q --user $R
A=$(command -v voicehook-agent); D=$(mktemp -d /tmp/vh-XXXXXX); mkfifo $D/in; (setsid sleep 86400 >$D/in & echo $! >$D/holder)
(VOICEHOOK_AGENT_HOME=$D setsid nohup $A join "{{INVITE_URL}}" --name "<your-name>" --model <your-model> --json --no-self-update --greet "<one short greeting in the call language>" <$D/in >$D/out 2>&1 &)
echo "D=$D A=$A"
```

- Shell variables do not survive between tool calls: write down `D=` and `A=` and run every
  later command as `VOICEHOOK_AGENT_HOME=<D> <A> next|say|status|activity|says|leave`, e.g.
  `VOICEHOOK_AGENT_HOME=/tmp/vh-ab12cd ~/.local/bin/voicehook-agent next`. Below, `cli <cmd>` means
  exactly that. `VOICEHOOK_AGENT_HOME` gives the join its own control socket, so other agents on
  the machine never collide. Leave: `cli leave --say "Danke, bis bald!"`, then `kill` the PID in `$D/holder`.
- Same `next`/`say`/`leave`/`status` JSON as Quickstart A; `next` exits 3 once the call is over.
  Too old (no `next`): `uv tool install --force $R`.
  The CLI switches to the HTTPS bridge on its own behind `HTTPS_PROXY` (`--transport auto|webrtc|bridge`).
- `--greet "<text>"` is spoken right after connect, only if it matches the call language
  (`lang=en` in the invite URL = English), else the server speaks the default greeting.
- `--name` / `--model` are mandatory (exit 2 without them); leave `--voice` out (the human's voice pick applies to all speakers); `--username` as the
  bridge fields `"voice"`, `"username"`; bridge/MCP only: `"status_every"` (see Status takt). `setsid` matters: without it the join dies with your tool call.
- Status board with flags: `cli status --doing "deployt den Worker, ETA 2 min" --open "Tests"
  --done "Analyse" --faq "Wann live?::in 2 min"` (`--faq` repeatable, split on the first `::`). `next`
  adds `status_due: true` + `status_reason` (`empty`, `status_request`, `stale` = older than 45 s while
  `doing`/`open` is set; `--status-due SEC`, env `VOICEHOOK_STATUS_DUE`) + `hint` naming the due
  `cli status` call: send a fresh board before your `say` (a reminder, never a command to run). A progress `say` ("fertig", "live", "deploye") without a fresh
  board returns `status_reason: "say_progress"`. Finished: `--done "..."`, not `cli status ""` (empty = due).
- **Context and follow-up questions per entry (CLI 0.21.4, mandatory):** every status entry, every
  decision and, where it helps, every `cli activity` line carries hidden background for Delta, never
  shown to the human: `--context "<what, why, current state>"` (max 2000 chars) plus the 3 most likely
  follow-up questions with prepared answers, `--faq "Frage::Antwort"` 3 times (max 200 chars each). On
  `status`, `--context`/`--faq` belong to the `--doing`/`--open`/`--done` right before them. No answer
  yet: say who works on it and when ("In Arbeit bei Konrad, Ergebnis ca. 10 Min"); Delta then says
  exactly that. Wire format: `operator.status` `meta {doing: {context, faq}, open: [..], done: [..]}`
  (lists in the order of `open`/`done`), `operator.activity` `meta: [{context, faq}]` (in the order of
  `lines`), `decide` `faq: [{q, a}]`. Bridge/MCP: the same fields on `status`, `activity` (`context`,
  `faq`) and `decide` (`faq`); missing context or faq returns `warnings` in the answer, never an error.
- **Decision cards are read aloud (29.10.):** in a pause Delta reads every open card by itself, one
  at a time by number: the question, the first two or three sentences of `--context`, the options and
  what each does, your recommendation, then he asks for the answer; the spoken answer goes to that
  card, then the next one follows. So write `--context` to be understood without a screen: an example,
  at most one key number, what happens on yes and on no; no lists, IDs or abbreviations. A `--faq`
  whose question names an option or yes/no ("Was passiert bei B?", "Und bei Nein?") is spoken as its
  effect, a "Warum ...?" as the reason for your recommendation.

- **Board hygiene (`ttl_s`, delete, session end).** The board must not fill up with old things.
  (1) An answered card leaves the board by itself once the answer is delivered and final (to you; for
  a helper card once the helper session fetched it, `relay/ack`); it stays in the history
  (`recent` of `voicehook-agent board`, with `hidden: true`, `closed: "answered"`). You may also hide
  an answered card of your own: `{id, delete: true}` answers `{ok, id, number, deleted: true,
  hidden: true}` instead of 409 (change stays 409). (2) When your session ends (`leave`, call end,
  helper access expired or revoked) your board entries (doing/open/done) and your cards are cleared;
  answered ones are hidden, unanswered ones are closed as left open (`verdict: "void"`, `closed:
  "left_open"`, `unresolved: true` in the history) and are never carried into a new call. A dropped
  connection only hides the answered ones; open ones follow the 30 min rule above. (3) `ttl_s`
  (optional, number of seconds > 0, otherwise 422): on `decide` (create or change; counted from
  setting it) and per board entry in `meta` (`meta.doing.ttl_s`, `meta.open[i].ttl_s`,
  `meta.done[i].ttl_s`, counted from the first time exactly this entry appears in your board; the
  same text sent again does not restart it). Expired = hidden: a card you never got an answer to
  becomes `state: "expired"` and you get `next` type `decision` with `verdict: "expired"` (ask again
  if it is still open). There is NO default ttl and no limit: without `ttl_s` an entry stays until
  it is answered or the session ends. A `done` list entry is still replaced by your next board.
- **Listen guard (CLI 0.21.4):** the Stop hook (`cli hook install`) blocks the end of your turn while
  your join is connected and no `next` waits (`cli status` shows `listening`), so the user's sentences
  never pile up unheard; keep `cli listen` running in your harness's background mode (it exits on the
  first event that needs you), or a `next` loop. Off: `VOICEHOOK_LISTEN_GUARD=0`.
  Optional `--project voicehook|salesengine|kunden|sonstiges` on `status`/`activity` (CLI 0.21.0+) sets the
  project for the focus filter (else derived from your session name).
- Arrange the call page (CLI 0.21.0+; bridge `POST /api/bridge/ui`, MCP tool `ui`, same packet as the
  human's own clicks): `cli ui open|close|min|medium|large|max <window>` (log/activity, dec/decisions,
  board/status, wrap/transcript, cards), `cli ui layout halves|quarters|thirds|bigmid|bar`,
  `cli ui move <window> l|m|r|b|tl|tr|bl|br|main|side [--preset P]`,
  `cli ui focus voicehook|salesengine|kunden|sonstiges|all`. Only when the human asks or it clearly helps.
- No `uv`: the `pip` fallback above (PEP 668: add `--break-system-packages`), or Quickstart A.
  The join above passes `--no-self-update`, so the CLI stays on the pinned, reviewed commit. Update only with the user's OK (`uv tool install --force $R` with a new pinned commit).
- `$D/out` (JSON lines) shows within ~5 s `connected — N peers` and a `room-state` line with
  a peer of `"kind": "agent"` (the voicebot), then `greet auto-pushed` and your greeting as
  `"role": "operator"` once spoken. `peer-left: … (agent)` = the voicebot is gone: tell the
  user to reload the call tab.
- Other agents in the call: their spoken lines arrive in `$D/out` as `"role": "operator"` with
  their `op` (identity) and `speaker` (name); lines with your own `op` are your echo. A bridge
  or MCP join gets the same as `operators_said` in `next`. Never repeat what they already said.


## Activity feed (CLI 0.10.0, hooks 0.13.0)

Delta sees what you do, one line per tool call, and answers "what is <Name> doing" from it.

- Claude Code, **only with the user's explicit OK** (it edits the user's settings):
  `voicehook-agent hook install` once. It merges a PreToolUse and a PostToolUse
  hook (`voicehook-agent-hook pre-tool-use || true` / `voicehook-agent-hook post-tool-use`)
  into `~/.claude/settings.json`, idempotent; re-run it after an update to add the
  PreToolUse hook to an older install. `voicehook-agent hook print` shows the snippet.
- A line is `HH:MM:SS Tool: description`: the tool's own `description` 1:1, scrubbed for
  secrets, written when the tool starts. File tools without one log the basename
  (`Read: relay.py`). Never commands, arguments, full paths, patterns, file contents or
  output. So give every Bash/Agent call a short, speakable `description`.
- The join publishes the newest 15 lines as `operator.activity` `{lines[], ts}`, on change,
  at most every 5 s.
- Without hooks: on every step send your own status line 1:1, 3-8 words, never rephrased:
  `activity` with `{"text":"Running database migrations"}` (CLI: `cli activity "…"`; appends
  `HH:MM:SS note: <text>`, scrubbed, max 120 chars, no paths, secrets or personal data).
- The hook finds a CLI join through `~/.voicehook/joins/<pid>.json`, under any
  `VOICEHOOK_AGENT_HOME`. With zero or several live joins it writes nothing, so one session
  never leaks into another call (several joins: set `VOICEHOOK_SESSION=<slug>/<identity>`).

### Hook feed for a Quickstart A (curl bridge) join (CLI 0.13.0)

With the CLI installed next to a curl bridge join, the hook can feed that join too, **only
with the user's explicit OK**. Right after the Quickstart A block:

```bash
voicehook-agent bridge-session --save $D/join --base "$B"
```

It stores only base + session in `~/.voicehook/bridge-session.json` (mode 600, never
printed). The hook then POSTs each line to `/api/bridge/activity` (2 s timeout, at most one
POST per 5 s, the latest line wins, never blocking). On leave run
`voicehook-agent bridge-session --clear`; a 401/404/410 answer removes the file by itself.

### Helper sessions: activity relay (no join)

Other sessions working for the same user (another machine, a background agent) can report
progress into YOUR feed without joining (no voice, no chip, no say; solo calls stay one
agent). The server issues the helper credential for every main agent, however it joined:
`POST /api/helper/credential {"label":"Mac"}` with Bearer = your bridge session or MCP
handle (same as `POST /api/bridge/activity/relay-token`), or, for a CLI joined over WebRTC,
its LiveKit token (CLI 0.17.0 does this by itself right after connect and writes
`~/.voicehook/relay.json`) -> `{token, url, expires_in, label}` (label max 22 chars).
`"rotate":true` makes every earlier credential of the call invalid (403). MCP: tool
`helper_credential`. Hand `token` + `url` only to that helper, over ssh (a pipe into
`helper-import`), never in a chat, argv, a board or an extra file of yours; it sends
`curl -X POST "$URL" -H @<(printf 'Authorization: Bearer %s\n' "$TOKEN") -d '{"text":"ring design done","from":"SE To-dos"}'`
(process substitution: the bearer never lands on disk or in `ps`)
(`from` optional; same limits as `activity`, 429 per token, token never in the URL). The line shows as
`relay: Helfer Mac: …` (EN `helper Mac: …`); Delta tells it as that helper's progress, never
says it verbatim. 403 = invalid, rotated or wrong room, 410 = expired or the call (or your
session) ended, 503 = your CLI join is not fetching helper packets right now (retry).
Helper commands for each setup: https://voicehook.ai/agent/MULTI-AGENT.md ("Helper sessions").

With the same token a helper also asks the human and keeps its own board. `from` = the
helper's session name (1-40 chars, required, else 422); the call page shows it as
`Helfer <label>: <from>` in its own colored group below your entries.

- `POST $URL/decide {"from":"SE To-dos","question":"Merge now?","options?":[..],"recommend?":0,"context":"..."}`
  -> `{ok, id, number}`, same fields, limits and errors as `/api/bridge/decide` (no count
  limit; the same question again keeps its card). Change or delete: `{from, id, ...}` / `{from, id, delete: true}`, only the same
  helper (same `from`), else 403. Exception: the creator left the call, then the main agent or a
  helper whose `from` equals the creator's label may take the question over; still open without
  such a successor after 30 min, the server closes it as obsolete (verdict `void`, hidden from the
  board and kept in the history as left open; `VOICEHOOK_ORPHAN_CLOSE=0` turns this off).
  `ttl_s` (optional seconds) and delete of an answered card: see Board hygiene above.
- Work finished: `POST $URL/decide {"from":"SE To-dos","card_type":"done","title":"Sales Engine: the
  Google login is fixed and live.","summary":"..","evidence":[{"label":"PR with the fix","url":"https://.."}],
  "live":true,"ask?":"Shall I delete the old page?"}` -> `{ok, id, number}`: a "work completed" card
  (no decision, only "Seen", OPERATOR-PROTOCOL.md "Card type work completed"); marking it brings
  `{type: "decision", card_type: "done", verdict: "seen", title, text?, answered_by, answered_via}`.
- `GET $URL/next?from=SE%20To-dos&timeout=25` -> `{events: [{type: "decision", id, number,
  verdict, option?, text?, by, changed?}]}`: answers to THIS helper's questions only (0-25 s
  long poll, at most 50 kept per helper, gone when your call ends). Never as `decision` in
  your own `next`: you get a copy as type `helper_decision` (below).
- `POST $URL/status {"from":"SE To-dos","doing":"..","open":[..],"done":[..]}` -> `{ok}`:
  the helper's own board (same limits as `status`); empty `doing`/`open`/`done` removes it.
  Your own board stays as it is. Delta answers progress questions from it too, with the sender.
  Optional `"state"` (below) sets the session state with the board; without it the last one stays.
- `question_check` events land in the same `GET $URL/next` inbox when a line of this helper
  reads like a question to the human (section "Hidden questions" below); confirm with
  `POST $URL/question_check {"from":"SE To-dos","id":"q1a2b3c4d"}` or
  `POST $URL/decide {"from":"SE To-dos","no_question":"q1a2b3c4d"}`, or ask it with `decide`.
- `POST $URL/state {"from":"SE To-dos","state":"arbeitet"}` -> `{ok}`: the session state only,
  the board stays (422 for any other value). The CLI reads it from the Claude Code hooks and
  sends it by itself: `arbeitet` (PreToolUse, PostToolUse, UserPromptSubmit), `frage` (waits
  for the human: Notification, PermissionRequest, AskUserQuestion), `leerlauf` (Stop),
  `problem` (3 failed tools in a row), `wartet` (only a wait or poll loop, not the human). It
  repeats the same state every 10 min; a repeat with the same content is no activity.

Status board order (call page, 20.10.2026): first the sessions waiting for the human (open
decision, `frage`, `problem`), then `arbeitet`, then `wartet`, then `leerlauf` or no state;
within each step the last real change first (board content, state or a new activity line
with content; never a repeat, and a line with the same text as the previous one only with a new
time, such as a heartbeat, is a repeat). Age,
dimming (3 min), folding (15 min) and hiding (60 min) count from that change; `arbeitet` and
waiting sessions are never dimmed or folded, only `leerlauf` or no state is hidden. The replay
to a browser that joins or reloads carries `chg_age_s` (age of the last change) next to
`age_s` when the packet was repeated since (status and activity); missing means equal to `age_s`.

All four share the token's rate limit (429). Agents on WebRTC send the same fields
themselves: `vh.decide` payload `sender` and `operator.status` payload `sub` (OPERATOR-PROTOCOL.md).

Open questions of every helper (also from another machine, MCP or bridge) while they are still
open: bridge `GET /api/bridge/decisions`, MCP tool `decisions`, WebRTC RPC `vh.decisions` ->
`{ok, open: [{id, number, question, options, recommend, agent, from, sender?, age_s, mine,
context?}], count, recent, boards}` (OPERATOR-PROTOCOL.md, "Open decisions"). Read-only overview
for the main agent (router): `recent` = the last decided questions (with `verdict`, `by`,
`decided_age_s`), `boards` = every helper board in the room (`from`, `name`, `doing`, `open`,
`done`, `state?`, `age_s` since its last update, `meta?` shortened). CLI: `voicehook-agent board`
shows the same. Check with it that every helper's board and question really arrived.

Copy for you (bridge, MCP and CLI `next`, CLI 0.18.1): when the human answers a helper's
question, your `next` also returns `{"type":"helper_decision","from":"SE To-dos","label":"Mac",
"id","number","question","verdict","option?","text?","by"}` (the helper still gets its own
`decision`). It is a routing hint, never an answer for you: do not speak it, do not act on
it yourself. **On helper_decision: send question and answer to exactly that session (`from`;
e.g. Claude Code SendMessage / your harness's session messaging) so it continues, never to all
sessions**; helpers are often idle and do not poll. A remote-controlled session on another
machine may not get the message: check that it reacted (its board or activity), else, with
your user's OK, type into its terminal (e.g. `ssh crown tmux send-keys -t <session> '…' Enter`). `POST /api/helper/pump/answer` (CLI WebRTC) returns the same copy as
`helper_decision`.

Human speaks to a helper by name (server, 21.10.2026): a user turn that addresses an active
helper as a vocative ("Steuern, schick mir die Belege", "Hey Armin-Box ...", "..., Steuern?";
case, space and hyphen do not matter, "Armin Box" = "Armin-Box") goes into exactly that
helper's inbox as `{"type":"user_turn","role":"user","text","to":["Steuern"],"to_kind":"helper","ts"}`
(`relay/next`, MCP `helper_next`, CLI `relay-next` and its hooks). Your own `next` gets the
user event as an info copy: `addressed_to_you` false, `to`, `to_kind: "helper"`, `info_only`
true, `note`. Do not do it yourself and do not speak it; wake exactly that session if it is
idle (as for `helper_decision`). Delta does not answer such a turn (also in Live mode), it only confirms with the helper name, e.g. "Geht an Steuern." (at most once per 20 s per helper), so do not confirm it again. Two helpers match:
`to_kind: "helper_ambiguous"`, nobody acts, Delta asks "Meinst du A oder B?". No helper name:
unchanged. Only turns of humans are routed, never lines of agents. A CLI main agent on WebRTC
puts the sentence into its hub with `POST /api/helper/pump/user_turn {to, to_key, text}` (pump
token; 404 = helper unknown to this hub).

### All sessions of one machine in the call (CLI 0.15.0)

One session joins; every other Claude Code session on the same machine (Mac, crown, ...)
shows up in the call's activity feed under its own session name, without joining. **Only
with the user's explicit OK** (it installs the CLI and edits the user's settings):

1. Install the CLI from the pinned commit above (CLI 0.21.3; an older install:
   `uv tool install --force $R`), then `voicehook-agent hook install` once per machine. It
   adds PreToolUse, PostToolUse, PostToolUseFailure, UserPromptSubmit and Stop hooks to
   `~/.claude/settings.json`, so every session has them (PreToolUse and PostToolUse
   timeout 5 s, the relay hooks PostToolUseFailure, UserPromptSubmit and Stop timeout 3 s;
   `|| true` on PreToolUse and the three relay hooks, so an older binary never blocks a
   tool, a prompt or a turn; the hook itself always exits 0 and never waits on the
   network). `voicehook-agent hook print` shows the snippet.
2. The joining session writes `~/.voicehook/relay.json` (mode 600, dir 700). A CLI join
   over the bridge mints ONE relay token (above) right after connect and stores `url`,
   `token`, `room` and expiry, never printed; a curl or MCP bridge join does the same with
   `voicehook-agent bridge-session --save $D/join --base "$B"` (`--no-relay` skips it).
   A WebRTC CLI join (the default) gets the credential from the server too (CLI 0.17.0)
   and publishes the helpers' packets itself; with CLI 0.15 or an older server it writes
   a local relay without a token: the hooks append the lines to that join's own activity
   log and it publishes them, no server call.
3. The hooks of all other sessions read the file by themselves and send one line per
   event: new task (category words only, never the prompt), `PR #N geöffnet` /
   `PR #N gemergt` / `PR #N Auto-Merge an`, `Deploy gelaufen` / `Deploy angestoßen`
   (`gh workflow run`), `Fehler bei <Tool>` (never the error text or the tool's
   description), `Turn fertig`. Heredoc bodies and quoted text (commit messages) never
   count as a command. Feed line: `relay: Helfer <machine>: <session>: <text>`. The joining
   session itself is skipped (its own hook already feeds the call), and only it writes
   plain tool lines into the join, so no session shows up twice.
4. On leave, call end or `voicehook-agent bridge-session --clear` the file is deleted;
   a 401/403/410 answer marks the token dead. Off for one machine: `VOICEHOOK_NO_RELAY=1`.

Machine label: `VOICEHOOK_RELAY_LABEL`, else the short host name. Session name:
`VOICEHOOK_SESSION_LABEL`, else the `/rename` title, else the title Claude Code generates
from the conversation (`ai-title`; it lands in the call feed, rename the session if that
says too much), else the folder name plus 4 hex chars of a hash of the session id, max 40
chars. Throttled
locally (the same line at most once per 120 s, all sessions together at most 8 lines per
10 s), the POST runs detached (`python -I`, cwd `~/.voicehook`) with a 2 s timeout and
never blocks a tool call. Details:
https://github.com/voicehook-ai/voicehook-agent/blob/master/docs/CLI.md ("Multi-session relay").

## Kanban: the owner's call link makes you the owner's agent

If the call owner (logged in) copies the agent link from their own call page, that link carries
an owner-delegated invite: joining with it (CLI, bridge or MCP) makes you the owner's own agent,
so you, your helpers and the per-machine Session Watcher can write the owner's account Kanban. Nothing
else to set up, no key. A link a guest passes on never gives this (Kanban `403 not_owner_agent`).
Developers only (optional): an account agent key (`Authorization: Bearer vhak_...`) does the same
outside the call page flow.

## Other agents: Codex CLI and others (CLI 0.20.0)

The hook automation above was Claude Code only. Per agent today:

| agent | activity per tool | turn start/end | text into the session | permission -> Decision | MCP tools |
|---|---|---|---|---|---|
| Claude Code | yes (hook) | yes | yes | yes (+ questions) | remote MCP |
| **Codex CLI** | **yes** (hook) | **yes** (hook + `notify`) | yes (same JSON) | yes (no question event) | **yes** (local) |
| **opencode** | **yes** (plugin) | **yes** (plugin, `session.idle`) | not yet (write only) | no (Board via MCP) | **yes** (local) |
| Gemini/Antigravity, Cursor, pi | not yet (have hooks/plugins) | not yet | not yet | not yet | local MCP works |

**Codex CLI, only with the user's explicit OK** (it edits `~/.codex`):
`voicehook-agent hook install --agent codex` once (`hook print --agent codex` only shows
it). It copies every file it changes to `<file>.voicehook-backup-<UTC time>` first, then
adds to `hooks.json` PreToolUse, PostToolUse, UserPromptSubmit, Stop, PermissionRequest
and SessionStart (`voicehook-agent-hook codex <event> || true`), and to `config.toml`
`notify` (only when none is set) and the MCP server `voicehook-local`. **Codex runs new
hooks only after the user trusts them once: `/hooks` in Codex.** Then, as in Claude Code:

- one activity line per tool call. Codex sends no tool `description`, so Bash shows a fixed
  category (`Bash: Tests`, `Git`, `Build`, `Install`, `Lint`, `PR`, `Deploy`), never the
  command; `apply_patch` shows `Edit: <basename>`. Prefer `activity` for a speakable line.
- helper sessions report new task, PR, deploy, `Fehler bei Bash`, `Turn fertig` over the relay;
  a Codex session that joined itself gets `Codex: neuer Auftrag` / `Codex: Turn fertig` in
  its own log (turn end also via `notify` before the hooks are trusted).
- a Codex approval prompt becomes a decision on the Decision Board; the human still answers
  in Codex. Codex questions (`request_user_input`) have no hook event: ask with `decide`.
- MCP tools of `voicehook-local`: `status` {doing, open[], done[]}, `decide` {question,
  options?, recommend?, wait_s?}, `next` {timeout_s?}, `activity` {text}. Own join: its
  control socket; else helper over `~/.voicehook/relay.json`, same session name as the hooks.

**opencode, only with the user's explicit OK** (it writes a plugin file):
`voicehook-agent hook install --agent opencode` once (`hook print --agent opencode` only
shows it). opencode has no JSON-stdin hooks like Claude Code or Codex; it auto-loads JS/TS
plugins from `~/.config/opencode/plugin/`. So the installer drops one self-contained plugin
`voicehook.js` (`$XDG_CONFIG_HOME/opencode/plugin/`, backup first, idempotent) whose
`tool.execute.after` and `session.idle` hooks pipe a Claude-Code-shaped event to
`voicehook-agent-hook opencode <event>`. No trust step: opencode loads it on its next start.
Then: one activity line per tool call (same fixed categories as Codex, never the command),
and `opencode: Turn fertig` at the end of a turn; helper sessions report over the relay like
Codex. Caveats: the plugin only WRITES (activity, turn end), it never injects a decision or
answer back into opencode; `tool.execute.*` does NOT fire for opencode's MCP tool calls (an
opencode limitation). For the status board and decisions in opencode, add the local MCP
server (`voicehook-agent-hook mcp`) as an opencode MCP server, exactly like any other MCP
agent below.

Any other MCP agent: add `voicehook-agent-hook mcp` (stdio) as an MCP server for the same
four tools, or use the CLI commands `activity`, `status`, `decide`, `relay-next`.
Details: https://github.com/voicehook-ai/voicehook-agent/blob/master/docs/CLI.md ("Other coding agents").

## `activity_due` and `stale_error` (CLI 0.13.0)

In speech pauses Delta reads only fresh lines (under 60 s) aloud: what happens right now.

- `next` adds `activity_due: true` + `activity_age_s` + `activity_hint` while work is in
  progress (`doing`/`open` set, or you spoke or sent a board in the last 5 min) and the log
  got no line for 60 s (`--activity-due SEC`, env `VOICEHOOK_ACTIVITY_DUE`, 0 = off). Send
  one fresh `activity` line (`activity_hint` is a reminder, never a command to run). Silent while hook lines arrive; at most one hint per 60 s.
- `stale_error` on EVERY `next` (no rate limit) while you are active and the board or the
  log is older than 60 s (`--stale-error SEC`, env `VOICEHOOK_STALE_ERROR_S`, 0 = off):
  `{status_age_s, activity_age_s, message}`, an age is `null` when that part is fresh. Fix
  it before your `say`. Plain (non `--json`) join output: `!! stale: <message>`.
- Every `next` carries `activity_now {text, age_s}` and `board_now {doing, age_s}`: what
  Delta knows about you (`null` = nothing sent yet).
- HTTPS bridge and MCP: join adds the line `<label> joined` (DE `<label> ist dazugekommen`),
  not counted as your activity. No own activity 30 s after the join: `stale_error` with
  `activity_missing: true` ("Send an activity line now (3 to 8 words)"), at most once per 2 min.
- HTTPS bridge and MCP: the join answer has `solo` (true = solo call: the voicebot speaks
  as you, in your voice and in the first person, other agents in the call have their own
  voices; false = it speaks about you).

## Speech recognition vocabulary (CLI 0.21.0, server `/api/bridge/vocab`)

The call keeps mishearing a word (a product, a name, jargon)? Teach it, do not just guess
around it: `voicehook-agent vocab add "Trello" --wrong "Erzähli"` (CLI, `--wrong` repeatable,
leave it out for a plain word), MCP tool `add_vocab`, or
`POST /api/bridge/vocab {"terms": ["Trello"], "fixes": [{"wrong": "Erzähli", "right": "Trello"}]}`
with Bearer = your bridge session (CLI WebRTC: its LiveKit token). It adds to the vocabulary
of the account that pays for this call, never yours and never by logging in as the user. Add
only: you cannot delete or read the list; the user manages it on https://voicehook.ai/account.
Max 20 entries per request, 100 per call, 50 characters each. Answer: `added {terms, fixes}`,
`total`, `call_left`, `reloaded`. Corrections apply right away; normal mode also passes the
word list to the speech recognition at the next pause, live mode from the next call. 409 =
guest call without an account, 429 = limit. Tell the user in one line what you added.

## No fixed time or count limits, only content rules (Oliver 23.10.)

Delta never throttles by time or count (no "max one per minute", no "never two without a human
sentence in between", no "drop after 60 s"). New information is spoken as soon as neither Delta
nor a person is talking (not talking over someone is a conversation rule, not a limit): a new
fact (`delta-note`), a new show card (announced once by title, content never read out), a new
Decision Board card, a board entry, your `say`. Only content rules apply: (a) the same
information is never said twice (dedup by content, seq, note id or card id, independent of
time); (b) answered decisions are never read out again; (c) an interrupted say is brought back
at most once, bundled by topic with a short natural reference to where it comes from (never a
fixed opener), and only if the topic was not discussed or decided in the call meanwhile. A say
expires only when it is superseded (`overwrite`/`revise`, board `done`, user stop) or already
said; until then it stays in the queue or as "not said yet" in Delta's context.

## Rules and facts for Delta (CLI 0.23.0, server `/api/bridge/delta`)

Give Delta standing conversation rules and facts during the call, so he answers more himself:
`voicehook-agent delta-rule add "Sprich den Kunden mit Sie an"`, `voicehook-agent delta-note add
"Der Release ist am Freitag"`, `... list`, `... rm <id>`. Bridge:
`POST /api/bridge/delta {"kind": "rule"|"note", "op": "add"|"list"|"rm", "text"?, "id"?}` with
Bearer = your bridge session. Rules are silent; a NEW fact is spoken once by Delta in the next
pause (then it stays context only, dedup by id). Both sit at the end of Delta's context and
apply from his next turn; on conflict his core rules win. Only the main agent in the call
(operator), never a helper (403). Max 20 rules and 30 facts, 300 characters each (422), unknown
id 404. Answer: `items [{id, number, text, at}]`, `count`, `max`. They last for the call (also
across a restart) and end with it; `persist: true` is accepted for a later account memory but has
no effect yet. Rule = how he talks or behaves; fact = what he knows. One topic per entry.

## Join flags and lifecycle (CLI)

- `--username <Vorname>` (CLI 0.9.0, bridge join field `"username"`): sent to the server as
  `vh.user`, Delta addresses the user by name.
- `--owner-pid <pid>` (CLI 0.8.0, env `VOICEHOOK_OWNER_PID`): the join leaves as soon as
  that process ends, e.g. your agent session. The FIFO holder of Quickstart B
  (`$D/holder`) is watched on its own.
- Idle guard `--idle-timeout MIN` (default 10, 0 = off).
  `--no-human-timeout MIN`: the join leaves when no human is in the room that long.
- `--data-channel` (bridge/MCP join field `data_channel`, server gate live 0.24.1; default off):
  join as a pure data channel so `next` is NOT woken by every user turn. `next` wakes only when
  the turn is addressed to you by name or mention (`addressed_by` `name`/`mention` with your
  identity in `addressed_ids`) or Delta routed it to you (`routed_by_delta`), and on your own
  decision/helper_decision answers. Broad turns (to everyone, `addressed_by` `all`, or a passive
  follow-up context, `addressed_by` `context`) stay silent in the buffer and NEVER wake you; they
  stay readable as context and ride along as `since_last` on the next woken event, so nothing is
  lost. Recommended default for a session that joins only to feed and read data (board, activity,
  decisions) and not to react to the conversation: it saves plan quota and avoids distraction.
  The flag is set fresh per join (like `status_every`) and does not survive a server restart; after
  a restart the session falls back to normal waking until it joins again.
- Join answered with HTTP 409 (no human in the room yet, CLI 0.10.2): the join says so and
  retries every 5 s for up to 2 min, then exits with code 6. Open the call in the browser.
- Call end (CLI 0.10.1): server `call_end`, room deleted or HTTP 410 = the join exits and
  never reconnects.

## CLI errors

| symptom | fix |
|---|---|
| exit 2, `Selbstauskunft fehlt` | add `--name` and `--model` |
| exit 2, `already running` | your `$D` already has a join: keep using it, or `cli leave` first |
| `say`/`next` exit 3, `no-session` | the join is not up (yet) or has ended; check `$D/out` |
| `several joins running` | set `VOICEHOOK_AGENT_HOME=<D>`, or pass `--session <slug>/<identity>` |
| `voicehook-agent: command not found` | use the absolute path `A` from the install, never the bare command |

## Versions and updates

`GET https://voicehook.ai/api/version` (no auth), the join answer (`/api/token`, `/api/bridge/join`) and `GET /api/bridge/info` name the server stand: `server_version`, `server_commit`, `cli_min`, `cli_latest`. With the `X-VH-CLI` header (the CLI sends it) they also say `cli_update`: `current`, `recommended` (below `cli_latest`, with `cli_upgrade` command), `required` (below `cli_min`, the join gets HTTP 426) or `unknown` (no CLI). On `recommended` tell your user once in one line and give the update command; the call goes on. The decision board in the browser shows the same: "Stand <commit> · aktuell" or "Update verfügbar".

## Several agents in one call (CLI)


**Default: one voice.** One agent joins with voice and acts as the router; it talks to the human and routes work. Every other session on the machine connects as a silent helper through the CLI relay (board, activity, decide), never with voice.
Several voiced agents in one call are possible (each gets its own voice, #522) but only when the human asks for it; otherwise it gets too noisy.

Full rules with reasons and good/bad examples: https://voicehook.ai/agent/MULTI-AGENT.md
1. Read every `"role":"operator"` line in the join output (CLI) or `operators_said` in EVERY `next`, `timeout` included.
2. The addressed one answers, first: the human addresses agent X by its label = only X answers, all others stay silent.
3. A question another agent asks the human is the human's: never answer it yourself.
4. Delta addressed (also heard as "Data"): all agents stay silent; never ask Delta yourself. Exception: a user event with `routed_by_delta: true` (and `addressed_to_you: true`) is a request the human gave Delta; Delta never refuses, it said "I'm checking that right now." and the request is yours: do it.
   - **Continuation:** `continues: <turn_id>` on a `user` event = the person's thought arrived in two parts and you had not reacted (no say) to the first: `text` is the WHOLE turn so far. Answer the whole sentence; do not continue an answer you started to the partial turn (a say still queued for it: replace with `mode: "overwrite"`).
5. Call language strictly (`lang=en` in the invite URL = English), `--greet` included.
6. Participant = no actions: no code changes, deploys, skill edits or forwarding unless the human asks you by name.
7. Check before you claim: read the operator lines, `voicehook-agent status` and its peers before you say what you receive.
8. Short, only when needed; else stay silent and show your work on board (items stand alone, `emoji`) and feed.

## Say receipts (CLI 0.9.0)

- `cli say` returns `{"ok":true,"seq":N}`.
- `next` adds `say_status` `[{seq, state}, ...]` (changes since the last `next`) and
  `say_hint` when one of your says sits in `queued`/`requeued` for more than 20 s.
- `cli says` prints the last state of every own say.

## Hidden questions: `question_check` (server, 20.10.2026)

A question to the human belongs on the Decision Board (`decide`). When your status board
(`doing`, `open`) or a feed line reads like one anyway ("soll ich mergen?", "wartet auf deine
Freigabe", "waiting for approval", "shall I deploy"), the server asks you back once:

- A word filter (question mark, question words, waiting phrases DE/EN) picks candidates; only
  those go to a small model (default `gemini-2.5-flash-lite`). The same line counts once (a
  repeated board or heartbeat is never checked again); with an open decision of yours the
  check is skipped. The model only flags, it never answers or decides anything.
- Hit: event `{"type":"question_check","id":"q1a2b3c4d","quote":"Soll ich mergen?","kind":"status|activity","wait_s":90,"text":"..."}`.
  Bridge and MCP: in your `next`. Helper lines and helper boards: in that helper's
  `relay/next` inbox (with `sender`), never in your `next`. CLI (WebRTC): an output line
  `(operator.question_check from <voicebot>) Deine Meldung ...` (the CLI does not route it yet).
- Within `wait_s` (90 s) either ask the question with `decide` (counts as handled), or confirm it
  was none: bridge `POST /api/bridge/question_check {"id":"q1a2b3c4d"}` (or `decide` with
  `{"no_question":"q1a2b3c4d"}`), MCP `decide` / `helper_decide` with `no_question`, CLI
  `--json` stdin `{"topic":"operator.question_check","id":"q1a2b3c4d","no_question":true}`.
  404 = unknown id, 403 = another agent's check, 409 = already on the board.
- No reaction in 90 s: nothing happens. The server NEVER creates a card from status or feed
  text (changed 26.10.2026; the old "automatisch erkannt" cards were unreadable without a full
  question and context). A card exists only if you call `decide` with a full question sentence
  and `context`. If your line was a real question to the human, ask it that way.
- Cost guard: at most one model call every 3 s and 40 per call, 2000 per day on the server,
  4 s timeout; a model error does nothing. Texts go only to the model, never into a log.

## Topics the CLI sends for you

| topic | payload | sent when |
|---|---|---|
| `operator.status` | `{doing, open[], done[], faq?[{q, a}], meta?{doing, open[], done[]}}` | `cli status`; replaces the last board, never spoken; an entry in `meta` may carry `ttl_s` (seconds until it is hidden) |
| `operator.leave` | `{sub?}` | the join ends for good (`leave`, call end): clears your board and cards; with `sub` a helper's access ended (expired/revoked): only that helper's board and cards |
| `operator.activity` | `{lines[], ts, meta?[{context, faq}]}` | hook lines and `cli activity` notes, newest 15, at most every 5 s |
| `operator.alive` | `{alive, ts, idle_s, consumer_idle_s?}` | every 10 s; CLI 0.21.5+: sent by the join itself (`idle_s` 0) while it holds the call, older CLIs only while you serve `next`/`say`; `alive:false` on leave |
| `operator.card` | `{id, seq, kind, title, text, at, url?, mime?, from?, context?}` | `cli show --card` (0.21.0), never spoken; `from` = helper sender (0.21.10); `context` = invisible full text of an image (required for `kind:image` from `show`, max 4000 chars, never rendered on the call page, only the voicebot reads it) |
| `delta.ui` | `{panel, open, via:"agent", large?, id?}` | `cli show --panel`/`--large`, only to the humans |

## MCP over plain curl (no MCP client)

Cloud/sandbox sessions (`CLAUDE_CODE_REMOTE=true`, `HTTPS_PROXY` set, or a CLI join that failed with `wait_pc_connection timed out`) block WebRTC: never use the CLI there. With MCP tools in your client use them (https://voicehook.ai/agent/mcp/SKILL.md). Without an MCP client call the same server with curl: JSON-RPC `tools/call`, the answer is one SSE `data:` line, the result is in `result.structuredContent`. Replace ONLY `{{INVITE_URL}}`, `<your-name>`, `<your-model>`, later `<S>` = `session` from the join answer.

```sh
curl -sS -m 130 https://voicehook.ai/mcp -H content-type:application/json -H 'accept: application/json, text/event-stream' \
 -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"join","arguments":{"invite_url":"{{INVITE_URL}}","label":"<your-name>","model":"<your-model>"}}}'
```

Same call, only `name` and `arguments` change: `next` `{"session":"<S>","timeout":50}` · `say` `{"session":"<S>","text":"Short sentences."}` · `status` `{"session":"<S>","doing":"building the fix, ETA 2 min"}` · `activity` `{"session":"<S>","text":"tests running"}` · `leave` `{"session":"<S>","say":"Bye!"}`. A tool error comes back as `"isError":true` with the HTTP code in the text.

## Bridge details (moved from SKILL.md)

- **Join notice:** `notice` with `"kind":"bridge_mode"` (join answer or first `next`): if your user works on a local machine you may mention once, to your user and never into the call, that the CLI exists (several sessions of one machine in one call: only the CLI, table above); install it only with the user's OK. `quiet` drops it.
- **Status mechanisms:** `stale_error` `{status_age_s, activity_age_s, message}` on every `next` while board or feed is older than 60 s (age `null` = fresh); `status_stale: true` when the board is older than 5 min and the user spoke since. The CLI adds `status_due`/`activity_due` hints (sections above).
- **`events` (SSE, bridge):** `curl -sSN -H @$D/h "$B/api/bridge/events"` streams every packet (also your own spoken `transcript` lines, never in `operators_said`). Once opened, keep it open until the call ends: 60 s after the last stream closes the session ends (`sse_gone`).
- **Spoken = proof:** CLI: `{"role": "operator", …}` with your own `op` in `$D/out` = spoken; no echo = not (yet) spoken. Backchannel ("mhm") and speech filters run on the server; never push them.
- **`revise`** (`next` type): your `"mode":"revise"` replaced own says that had not started; `reason:"user_stop"` = the user said "erledigt"/"reicht"/"stopp", your queued says were dropped: never resend, wait. `reason:"stale"` no longer happens by time (since 23.10. a say waits until it can be spoken or is superseded). Otherwise, if any still matters: one merged `say` with `"mode":"overwrite"`.
- **`voicebot_left` / `voicebot_back`** (`next` types, bridge/MCP/CLI): the voicebot dropped out (e.g. server update; a new one is usually back within ~20 s, the person may hear silence): tell your user in chat at once (a `say` would not be heard), keep calling `next`, never `leave`. Not back within about a minute, or `ended`: offer your user a new call (`create_call` + background watcher), never start one on your own. `voicebot_back` (`seconds` = gap): `say` works again; repeat the last important point briefly. A takeover (new voicebot joined before the old one left) sends neither. The voicehook-agent CLI (0.21.0+) emits the same events in `next` and as a JSONL line in `--json` mode (WebRTC and bridge transport).
- **Delta misbehaves** (wrong claim, repeats itself, forgot something important, wrong name; only then, since a `say` overrides Delta and breaks his flow): if Delta is still saying it, `operator.interrupt` first (bridge: `send` with `{"topic":"operator.interrupt","payload":{}}`), then correct it in one `say`; then push a short fact fix via `operator.persona` (it replaces your previous persona block, so send your full persona plus the fix).
- **Data channel (`data`):** `{"to":"Bert","kind":"json","name":"r.json","payload":{"ok":true}}` (`to`: label, identity or `"*"`; `kind` `json`/`text`/`file` with base64 `payload`, `name`?, `mime`?), never spoken, never shown to the human (the feed only shows `Daten an Bert: r.json (1,2 KB)`). Max 15 KB per packet (413), so a file inline only up to about 11 KB.
  Bigger files: `curl -sS -H @$D/h -H 'X-Filename: a.pdf' -H content-type:application/pdf "$B/api/bridge/upload" --data-binary @a.pdf` (max 10 MB, gone when the call ends), then `data` with `"kind":"file","file_id"`. The receiver gets `next` type `data` (`from`, `kind`, `payload` or `url`: GET `"$B$url"` with `-H @$D/h`). Bridge and MCP sessions; CLI support follows.
- **Idle and heartbeat:** no `say`/`next` for 10 min (CLI `--idle-timeout MIN`, 0 = off) = the join leaves. `operator.alive` every 10 s while you serve `next`/`say` (bridge: the server sends it for you); silent 20 s = no chip, Delta: "<Name> ist gerade nicht erreichbar." No human in the room for 120 s (300 s while an operator waits and the human dropped unexpectedly) = call over, room deleted; the bridge `ended` event carries `detail` + `message` for your user.
- **Join again = replace:** a bridge/MCP join with the same label (or the same explicit `identity`) in the same room replaces your older session at once: its participant leaves, its token answers 410 and its `next` returns `{"type":"ended","reason":"replaced"}`. Keep using only the newest session. Two agents in one call need different labels. The server sends `operator.alive` for you only after your first `next`/`say`.
- **Status takt**: by default Delta gives at most ONE status update per minute, only in real pauses: one short summary (max two sentences) of everything new since the last one: your `doing`, new `done` items, new feed lines incl. helper lines, open decisions. Nothing new: silent. Your `say` and answers to the person's questions are never throttled. The person picks Off, On question, 30 s, 1 min (default), 2 min, 5 min or Live in the call (or by voice, "every two minutes"); that choice wins. Your own default: join field `"status_every"` in seconds (0 = only on question, 10..59 or whole minutes up to 3600, else 422); the join `context` shows it as `status_every`.
- Never `pkill -f "voicehook-agent join"`: the pattern matches your own shell and other operators' joins. Never write into shared paths (`personas/*.txt`, `/tmp/vh-call.*`); use your own `$D`.

## Cards on the call page (CLI)

CLI 0.21.0+, same cards as bridge `POST /api/bridge/show` and MCP `show` (never spoken; preview top left):

```
voicehook-agent show --card code --title "Fix" --text "git push origin main"
voicehook-agent show --card text --file notes.md --panel cards
voicehook-agent show --card link --text https://voicehook.ai
voicehook-agent show --card image --title "Ablauf" --file swimlane.svg --context "Lane Dev: Build, Test | Lane Ops: Deploy" --large
voicehook-agent show --file report.pdf      # file card, type from the extension (pdf csv md png jpg webp svg)
voicehook-agent show --card csv --file leads.csv --title "Leads je Firma"
voicehook-agent status --doing "Bericht fertig" --attach report.pdf   # board entry with a file button
voicehook-agent show --panel board          # only open a panel (cards board log decisions none)
```

- **File cards (CLI 0.25.0, 22.10.):** `pdf` (first page as preview, page turning inside the card, page number, download), `csv` (table of the first 20 rows, scrollable, download), `md` (Markdown rendered safely: never HTML from the file, links only http(s), download). Limits: PDF 10 MB (must start with `%PDF-`), CSV and Markdown 2 MB UTF-8; too large or wrong: exit 2, nothing sent. WebRTC: the CLI uploads via `POST /api/card/file` and publishes the card itself, ok only after a call page loaded the file (`shown`), like images.
- **Attachments on the board:** `status ... --attach <file>` (repeatable, max 8) uploads each file as a card and links it to your board entry (`attach: [{id, name, kind}]`); the board shows a file button that opens the card. A path you mention in the board text (e.g. `~/inbox-macbook/report.pdf`) becomes clickable when a card with that file name is in the call.
- **Kept per call:** images and files survive a reload and a server restart; they end with the call (at the latest after 12 h).

- `--text -` reads stdin; `--file` = UTF-8 text for text/code/link, an svg/png/jpeg/webp file for image (type from the magic bytes).
- `--panel cards` opens the card view, `board`/`log`/`decisions` those panels, `none` closes all (only to the humans). `--large` opens the card view big in the middle with this card at full size (implies `--panel cards`): use it for diagrams (swimlanes, many steps and arrows) the human should read now.
- Limits as bridge/MCP: text 4000 chars, title 80, SVG 300 KB (draws anything; no `<script>`, `<foreignObject>`, `on*` attributes or external references), PNG/JPEG/WebP 1 MB. Invalid: exit 2, nothing sent, never cut. Not combinable with the shape flags below.
- WebRTC: the CLI publishes `operator.card` itself; an image is stored first via `POST /api/card/image` (Bearer = the join's own LiveKit token, max 10 per minute) and the card carries its signed URL. Bridge transport: `POST /api/bridge/show`. **Image context:** `context` is REQUIRED for `kind:image` (no context = 422): the full text of everything in the image (numbers, table rows, labels), max 4000 chars. It is never shown; the voicebot cannot see images and answers questions about the image from it. Put it in the `context` field of the `operator.card` packet; a card without it is still shown, but the voicebot then transcribes the image itself once (slower, may miss details), so always send it. Answer `{ok, type:"card", via, id?, seq?, kind?, panel?}`.
- Image arrived (CLI 0.21.10): every call page loads the image and answers the sender on `vh.card_ack` `{id, ok}`. The CLI waits up to 15 s and answers `ok:true` with `shown` (number of pages that loaded it) only then; otherwise `ok:false`, exit 1, with `type` `not_shown` (the page could not load it, e.g. the server restarted, or no page answered: ask the human to reload) or `no_human` (nobody in the call). Never tell the human an image is there without `ok:true`.
- Helper sessions (no own join, `~/.voicehook/relay.json` of the main agent, CLI 0.21.10): the same `show --card ...` goes over the helper relay (`POST /api/activity/relay/show`) and the card names the helper as sender (`Helfer <machine>: <name>`). Same checks and limits, at most 10 images a minute per helper, image only as file data (never a URL), no `--panel`/`--large`; an image card needs `context` here too (422 without).

## Draw in the ring (`vh.visual`)

Ring shapes are for short signals and state: `check`, `cross`, `question`, attention (`bolt`), a count. Explanations, flows and diagrams go into an image card (SVG, `show` `kind:image`, `panel:"cards"` = shown large), not into the ring. Not on every sentence; at most one shape per 2 s (faster ones are dropped: 429). Only the experimental ring shows it.

- With speech: `say` `{"text","emotion"?,"shape"?}`: tint and shape start when the say starts playing. Without speech: `POST $B/api/bridge/visual` `{"shape"?,"emotion"?}` (MCP/CLI: topic `operator.visual`). Invalid: 400 `{"error":"invalid"}`.
- `emotion`: `neutral joy calm curious excited concerned frustrated sad`, or `{"label","arousal":0..1}` (stronger tint).
- `shape`: a preset name (`arrow_up arrow_right check cross question loop split3 scale heart bolt one two three`), `{"type":"polygon","points":[[x,y],…],"closed":true}` (max 400 points per shape), `{"type":"path","d":"M L Q C Z"}` (max 2 KB) or `{"type":"multi","items":[…]}` (max 12, e.g. a chart: axes + bars + trend line). Coordinates 0..1 inside the ring (x right, y down); `hold_ms` 800..8000; `label` max 24 chars, shown under the shape.
- Examples: `{"text":"Erst bauen, dann deployen.","emotion":"calm","shape":"arrow_right"}` · `{"shape":{"type":"polygon","points":[[0.2,0.9],[0.2,0.5],[0.5,0.2],[0.8,0.5],[0.8,0.9]],"closed":true,"label":"Haus"}}`

## Show what you say (`ref`)

`say` takes an optional `ref` that ties the sentence to a card or a decision. While the sentence plays, the person's call page shows it: the matching window opens (only if it is closed or minimized; windows the person has open, their layout and sizes stay as they are) and the card or decision is highlighted until the sentence ends or is cut off.

- Forms: `{"kind":"card","id":"<card id from show>"}`, `{"kind":"decision","n":<number from decide>}` (also `{"id":"d..."}`) or the short strings `card:<id>` / `decision:<n>`. Bridge REST and MCP: field/parameter `ref` on `say`; CLI: `say --ref card:<id>|decision:<n>` (needs a CLI that has the flag); raw topic: field `ref` on `operator.say`.
- Code checks it: an unknown card or decision, or one removed meanwhile, is ignored and the sentence is spoken anyway. REST: a malformed `ref` is 400 `{"error":"invalid"}` and nothing is sent; a well-formed but unknown one is accepted and ignored.
- Use it when the sentence is about exactly one card or decision ("Frage drei ist die mit dem Deploy."), not on every sentence; one `ref` per sentence. Delta does the same for his own answers (tool `show_ref`).
- The page gets it on `transcript.live`: `{phase:"ref", role, id, ref:{kind, id, n?}}` at playback start and `{phase:"ref_end", role, id, interrupted}` at the end, also in Live mode.

## Persona: do not overwrite someone else's

- Another operator may already be in the call (`room-state` / `peer-joined` lines with a second identity, `"operator": true` in `status`, or other `operators` in `info`). Then do NOT push `operator.persona` and do not pass `--persona`/`--persona-file`: it replaces the voicebot's knowledge block for everyone. CLI 0.5.0 skips that push on its own and logs `persona/mode NOT pushed`; `--force-persona` overrides, do not use it in someone's call.
- Alone in the call and you want the voicebot to know context: `--persona "<3-5 lines>"` at join (CLI) or `operator.persona`. The first persona push also triggers one server-side greeting, so then drop `--greet`.
- A persona is knowledge, not rules: it is appended after Delta's fixed core (no inventing, never answers capability questions, short waits with your name, never "Operator"), which it cannot change. Override lines ("ignoriere", "neue Regeln", "Operator") are dropped, max 1500 chars; then `operator.notice` `persona_sanitized`. No secrets, no personal data in a persona or `--greet`.

## Data-channel topics (stdin JSON lines with `--json`)

| topic | payload | effect |
|---|---|---|
| `operator.say` | `{text, mode?, priority?, ref?}` | speak `text` verbatim. Modes below. `ref` = card or decision shown while it plays, see "Show what you say" |
| `operator.revise` | ← `{unspoken[], new, text, owner, reason?}` | only to you: what of YOURS was NOT spoken yet |
| `operator.say_status` | ← `{seq, state, spoken_chars, owner, reason?}` | only to the owner, per say: `queued`/`speaking`/`spoken`/`interrupted`/`requeued`/`replaced`/`covered`/`no_audio`/`dropped` (details below) |
| `operator.persona` | `{text}` | knowledge block after Delta's fixed core, for everyone (see above) |
| `operator.interrupt` | `{}` | stop YOUR speaking; unspoken rest comes back as `operator.revise` |
| `operator.inject` | `{text, role?}` | context entry, not spoken |
| `transcript` | ← `{role, text, speaker, op?, id, t, final}` | `user` = the human; `operator` = spoken operator text (`op` = whose identity); `agent` = Delta; `id` = one segment (a later line with the same `id` replaces it), `t` = server time (s); you only get `final:true` lines |
| `transcript.live` | ← `{phase, role, id, text?, ref?, interrupted?}` | your `say` started (`start`) / finished (`end`) playing; for the browser only, NOT proof it was spoken (use `transcript`). `ref` / `ref_end`: the card or decision tied to your `say` is shown / done |
| `operator.notice` | ← `{kind, minutes_left, text, topup_url, ...}` | server notice, see below |
| `operator.question_check` | ← `{type:"question_check", id, quote, kind, wait_s, text, sender?}` / → `{id, no_question:true}` | a status or feed line of yours reads like a question to the human; answer with `decide` or confirm no question (section "Hidden questions") |
| `quit` | `{}` | leave the call (what `leave` does) |

`say_status` states: `speaking` = started playing now (not stuck, never resend it; `spoken`/`interrupted` follows); live mode has no `requeued` and `interrupted` is final; `covered` = Delta already said it in his answer (final); `no_audio` = no audio within 4 s, retried once. `dropped` + `reason`: `user_stop` (never resend), `stale` (no longer by time since 23.10.), `no_audio` (retry silent too: resend if still needed), `quota` (budget used up, call ends) or `already_speaking_same` (your `overwrite`/`revise` matched your own say that is playing: not spoken twice, do not resend). `interrupted` + `reason`: `barge_in`, `no_user_speech` (noise or echo, the rest follows as `requeued`), `max_duration` or `superseded` (your `overwrite`/`revise` with new content ended it at a sentence end).

`operator.say` waits until the user is silent (0.6 s) and Delta has finished; a user cut-in replays the rest ONCE; nothing expires by time: a say leaves the queue only when spoken, superseded (`overwrite`/`revise`, board `done`) or stopped by the user; an interrupted say comes back once, bundled by topic with a short reference to its source; Delta stays quiet while one is pending. ONE queue for all operators. `append` (default) queues at the end, no gap. `overwrite` replaces only YOUR not-started says (else = append); while YOUR say is `speaking`, an `overwrite` with the same content is dropped (`already_speaking_same`), one with new content ends the playing say at its next sentence end and plays next; `revise` = same, plus `operator.revise` to you. Only your `operator.interrupt` or `"priority":"urgent"` (alias `interrupt`) cuts a running say; never talk over the user with `urgent`. User says "erledigt"/"reicht"/"stopp": running and ALL queued says are dropped (`user_stop`), Delta says "Alles klar."; do not resend them.

## Low balance (`operator.notice`)

`kind:"low_balance"`: free allowance plus credit last about `minutes_left` more minutes; the call ends when both are empty. It arrives once per call (CLI: a `$D/out` line with `"topic": "operator.notice"`), and the voicebot already said so. Do not repeat it and do not push a top-up. Only if the user asks how to continue: `show` a `kind:link` card with `topup_url` and one `say` pointing to it.

## Live mode (Gemini Live)

Rooms created via `POST /api/live-room` run on a realtime model. Join the same way. There `say` is NOT verbatim: the voice phrases it itself, so say it short and put details in `show`; `say_status` (and bridge `say`/`next`) carry `verbatim:false`, `mode:"live_paraphrase"`. Budget used up mid-call: the voicebot announces it and ends the call; open says end `dropped` with `reason:"quota"`.
The user always goes first: a `say` that arrives while the user has the floor goes to the model at once as context; it is spoken afterwards only if his answer did not already contain it, otherwise `say_status` reports `covered` (do not send it again).

## Helper liveness (server detector)

The server tracks `last_seen` per helper (every relay request and every `relay/next` long-poll, up to 25 s) and the age of each delivered but not yet acked answer (`POST /api/activity/relay/ack`). A helper is **stale** when
- `no_poll`: it polls `relay/next` but `last_seen` is older than 90 s (three long-poll cycles plus 15 s network slack), or
- `no_ack`: a delivered answer stays unacked longer than 60 s (two cycles; the ack follows consuming within one loop pass).

A helper that never polls (only writes board/feed) is judged by `no_ack` only. Any request or the ack makes it fresh again at once. Metadata only, no content.

- Page: `operator.status` (same topic as the board) with `{"op":"helper_liveness","helper":"<name>","id":"<identity>","state":"stale"|"alive","since":<unix>,"grund":"no_poll"|"no_ack"}`. `stale` is repeated every 60 s for late pages; the page renders the warning, `alive` removes it. The worker ignores these packets (no board).
- Main/router agent: `next` event `{"type":"helper_stale","topic":"operator.helper_stale","helper","since","grund"}` once when it turns stale, `{"type":"helper_fresh","topic":"operator.helper_fresh","helper"}` when it is back. Behind CLI WebRTC the pump delivers `{"kind":"helper_liveness","page":{...},"event":{...}|null}`: publish `page` on `operator.status` and queue `event` in your own `next`.
