← ClaudeAtlas

aio-message-bridgelisted

Give Claude Code an event loop. A local HTTP + WebSocket relay plus the Monitor tool let anything OUTSIDE Claude — a CLI in another terminal, a mobile app, a webhook, another running program, a web page — push events to Claude mid-task and receive pushes back, in real time. Inbound: the external client POSTs an event, the relay prints a MSG:: line to stdout, the Monitor tool surfaces it as a notification. Outbound: Claude POSTs a push, the relay broadcasts it over WebSocket to every connected client. The protocol is generic and language-agnostic; a ready-to-run reference relay is included. Use when an external process or device needs a live two-way channel to Claude, when you need a webhook or event source to wake Claude, or when you want to "give Claude an event loop". "external to Claude bridge", "Monitor + WebSocket relay", "wake Claude from outside", "kết nối bên ngoài với Claude", "cầu nối tương tác với Claude".
aiocean/claude-plugins · ★ 3 · AI & Automation · score 65
Install: claude install-skill aiocean/claude-plugins
# aio-message-bridge — give Claude Code an event loop ## The problem this solves Claude Code runs in a turn-by-turn loop. It has no event loop: it cannot `addEventListener`, cannot hold a socket open and react to frames as they arrive, cannot block on `await nextEvent()`. So how does something *outside* Claude — a program in another terminal, a phone, a webhook from a SaaS, a button in a web page — drive Claude's behavior *while a task is in progress*, and how does Claude push updates back to it live? ## The pattern — an asymmetric two-channel bridge One local process (the **relay**) fronts two channels. They are **not symmetric**, and the asymmetry is the entire lesson: ``` EXTERNAL CLIENT RELAY (one process) CLAUDE ──────────────── ─────────────────── ────── POST /api/event ──────────────▶ prints MSG::{json} ──stdout──▶ Monitor (HTTP, fire once) to stdout notification reads WS frames ◀──WebSocket─── broadcast "events" ◀────────── POST /api/push (server→client push) (curl, any shell step) ``` - **External → Claude (inbound).** The client makes a one-shot **HTTP POST** to `/api/event`. The relay prints exactly one sentinel line — `MSG::{instance,type,payload}` — to its **stdout**. The **Monitor tool** (which launched the relay) turns each stdout line into a **notification**. That notification