Skip to main content

WebSocket

The desktop UI connects to ws://127.0.0.1:<port>/ws and receives a live stream of events plus snapshots — sessions, approvals, the audit log — without polling.

You don't need to talk to the WebSocket directly to use ccmon — this page is here for completeness.

Why WebSocket

  • Live updates — events appear in the UI as fast as the hooks fire, with no polling loop.
  • Single connection — sessions, approvals, audit log, and event stream all flow over one socket.
  • Lower overhead — the UI receives diffs, not full snapshots, on most updates.

Message shape

Every frame is JSON with a type discriminator. The main types you'll see:

TypeWhen
snapshotSent on connect — full state of sessions, approvals, recent events.
session_updateA session changed (state, last activity, etc.).
eventA new hook event was recorded.
approval_pendingA new permission request needs a decision.
approval_resolvedA request was resolved (with decision and resolved_by).