Arm the voice bridge in the current Claude Code session — subscribe to the user's spoken replies coming from the Claudio Code phone app through their own relay. Trigger words: "arm the voice bridge", "/voice-bridge", "подключи рацию".
2 stars
0 votes
0 copies
1 view
Added November 7, 2026
ai-agentsgoshellbashdebugginggit
Works with
claude code
Security analysis
B88/100
criticalSends environment variables or credentials to an external URL
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Voice Bridge?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/1nspectorcat-voice-bridge)
---
name: voice-bridge
description: Arm the voice bridge in the current Claude Code session — subscribe to the user's spoken replies coming from the Claudio Code phone app through their own relay. Trigger words: "arm the voice bridge", "/voice-bridge", "подключи рацию".
---
# Voice bridge (Claudio Code)
Subscribes THIS session to the user's spoken replies. Without it the phone can play
answers but nothing the user says reaches the session.
## How it works
The relay keeps one queue per session id. `GET /consume?...&session=<sid>` returns the
queued text **once** and empties the queue, so exactly one poller per session may run.
This skill starts that poller as a persistent background monitor.
## Arming it
1. **Session id** — take it from the path of the session's scratchpad directory
(`.../<project>/<SESSION_ID>/scratchpad`).
2. **Relay address, token, certificate** — read `~/.claude/voice/bridge/config.json`
(fields `url`, `token`; the certificate is `cert.pem` in the same folder — copy it
from the server, it is the same file the installer generated).
3. **Pick up leftovers.** Look into `~/.claude/voice/inbox/` for `msg_<SESSION_ID>_*.txt`.
Those are messages a previous poller fetched but never handed over (it was killed
between `consume` and printing). The relay hands a queue over only once, so these
would be lost otherwise. Read each file, delete it, treat the text as a user message.
4. **Start the poller** (paths below are POSIX; on Windows use Git Bash style paths such
as `/c/Users/<you>/.claude/...`):
```
Monitor(
description: "voice bridge: spoken replies from the phone",
persistent: true,
timeout_ms: 3600000,
command: D=~/.claude/voice/inbox; L=~/.claude/voice/bridge_life.log; mkdir -p "$D"; SID=<SESSION_ID>; NF="/tmp/vb_nonce_$SID.txt"; BRIDGE_T0=$(date +%s); date +%s%N > "$NF"; NONCE=$(cat "$NF"); printf '%s ARMED %s\n' "$(date -u +%FT%TZ)" "$SID" >> "$L"; R=unknown; while :; do [ "$(cat "$NF" 2>/dev/null)" = "$NONCE" ] || { R=nonce-superseded; break; }; AGE=$(( $(date +%s) - BRIDGE_T0 )); [ $AGE -lt 21600 ] || { R=six-hour-timer; break; }; out=$(curl -s -m 8 --cacert ~/.claude/voice/bridge/cert.pem "<URL>/consume?token=<TOKEN>&session=$SID" || true); if [ -n "$out" ]; then F="msg_${SID}_$(date +%s%N).txt"; printf '%s\n' "$out" > "$D/$F"; printf 'VOICE_MSG %s/%s\n' "$D" "$F" || { R=dead-pipe; break; }; fi; sleep 3; done; printf '%s DIED %s reason=%s lived=%ss\n' "$(date -u +%FT%TZ)" "$SID" "$R" "$(( $(date +%s) - BRIDGE_T0 ))" >> "$L"
)
```
5. Tell the user in one line that the bridge is armed.
## Why the loop looks like that (each guard was paid for in lost messages)
- **Nonce file.** Pollers outlive the Claude Code process that started them. Zombies keep
consuming their dead session's queue and throw the text away — once there were 24 of
them and they ate a full day of messages. Every arming writes a fresh nonce; the
previous loop for the same session sees the mismatch and exits within three seconds.
Key the nonce by SESSION ID, not by project — one project can hold several sessions.
- **Dead pipe.** Printing with `|| exit` kills a loop whose parent is gone.
- **Six-hour self-expiry.** A zombie that escaped both guards still dies on its own.
Count with your own `BRIDGE_T0`, never with `$SECONDS`: that is the age of the *shell*, which
the harness reuses. In a long session `$SECONDS` is already past six hours and every
fresh loop dies on its first iteration — the bridge looks armed and is in fact dead.
Give that variable a long, unique name: a short `T0` can already exist in the reused shell,
and the fresh loop then inherits a stale value and dies immediately, logging "lived 21600s"
one second after it started. After arming, check the life log for an ARMED line with a
current timestamp — two seconds of verification against an hour of silent breakage.
- **Text travels as a file.** A background console mangles non-ASCII on stdout (Cyrillic
came out as `????`). The event line carries only an ASCII path; the text is UTF-8 in
the file. Delete the file after reading it, or the next arming replays the message.
- **Life log.** Every arming and death writes a line with the reason, so "the bridge died"
can be diagnosed instead of guessed.
## If Monitor expires after 30 minutes
Some Claude Code versions stop a Monitor after 30 minutes. Re-arming it in a loop wakes the session
for nothing and burns usage. Instead run the same loop with Bash `run_in_background: true`, and make
it exit on the first message: in the `if [ -n "$out" ]` branch, after printing the path, write the
reason to the life log and `break`. The session wakes on the task-completion notice, reads the file,
handles it, deletes it and arms the loop again. Nonce, six-hour timer and life log stay the same.
Messages that arrive during the few seconds of re-arming wait in the relay queue and are not lost.
## Handling events
`VOICE_MSG <path>` — read that file, treat each line as an ordinary user message, answer
normally (your answer is spoken back by the Stop hook), then delete the file.
Speech recognition is imperfect: interpret typos and glued words by meaning; if the
meaning is critically unclear, ask back in one short sentence.
## Safety: a code word for destructive requests
The microphone is open outdoors. Other people's speech and recognizer hallucinations
**do** end up in the transcript — verified in the logs. The token protects against a
foreign *device*, not against a foreign *voice* next to the microphone.
Therefore: irreversible actions requested by voice — deleting or overwriting files,
destructive git, anything touching servers, money, or sending data outside — run **only**
if the user's phrase contains a code word agreed in advance. No code word: do not act,
ask back naming the operation. The word covers ONE operation, not the session.
Do not print the code word in answers: they are read aloud into a headset in public, so
speaking the password gives it away. Ask for it by name-free phrasing ("say the code word").
## Debugging
- Relay status: `curl -s --cacert cert.pem "<URL>/status?token=<TOKEN>"` — connected
sessions, phones, recent answers.
- Bridge alive? The session must appear in `sessions` there. If it does not, the poller
is dead — check `~/.claude/voice/bridge_life.log` for the reason.