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:
| Type | When |
|---|---|
snapshot | Sent on connect — full state of sessions, approvals, recent events. |
session_update | A session changed (state, last activity, etc.). |
event | A new hook event was recorded. |
approval_pending | A new permission request needs a decision. |
approval_resolved | A request was resolved (with decision and resolved_by). |