realtime-websockets

realtime-websockets is a skill for Claude Code, Codex from nimadorostkar/Claude-Skills-collection. It costs 41 tokens per session (1,016 once invoked), scanned A, original, MIT.

Guidance for building live application updates with WebSockets or Server-Sent Events, technologies that keep a connection open so data can arrive without repeated requests. It covers reconnecting, recovering missed messages, scaling, and handling slow clients.

In plain words
What is it for?
Use it for live updates, chat, online presence, collaborative editing, streaming dashboards, protocol selection, multi-server scaling, and diagnosing dropped messages or memory growth.
Why use it?
Network connections drop frequently, especially on mobile devices. This helps the application restore the correct state after reconnecting and avoid lost messages or overloaded servers.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for live updates, chat, online presence, collaborative editing, streaming dashboards, protocol selection, multi-server scaling, and diagnosing dropped messages or memory growth.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nimadorostkar/claude-skills-collection/realtime-websockets
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nimadorostkar/Claude-Skills-collection --skill realtime-websockets
Clone the repo
git clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collection

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for realtime-websockets

README.md
[![agentmods](https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/realtime-websockets/github.svg)](https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/realtime-websockets)
Your own site
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/realtime-websockets"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/realtime-websockets/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for realtime-websockets

Your own site · 80×15
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/realtime-websockets"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/realtime-websockets.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,016 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.01016
Opus 5 $0.00020 $0.00508
Sonnet 5 $0.00008 $0.00203
Haiku 4.5 $0.00004 $0.00102

Measured 12d ago against content hash d040c8a9d6ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

realtime-websockets scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/backend/realtime-websockets/SKILL.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Realtime and WebSockets

Purpose

Build realtime features that behave correctly when the connection drops — which it will, constantly, on mobile networks. The hard part is not the socket; it is the state after the reconnect.

When to Use

  • Building live updates, chat, presence, collaborative editing, or streaming dashboards.
  • Choosing between WebSockets, SSE, and polling.
  • Scaling a socket server beyond one instance.
  • Diagnosing memory growth or dropped messages under load.

Capabilities

  • Protocol selection and trade-offs.
  • Connection lifecycle: handshake, auth, heartbeat, graceful close.
  • Reconnection with resume tokens and gap backfill.
  • Horizontal scaling with a pub/sub fan-out layer.
  • Backpressure and slow-consumer handling.

Inputs

  • Direction of data flow (server to client, or bidirectional).
  • Message volume, size, and acceptable latency.
  • Whether missed messages must be recovered or can be dropped.

Outputs

  • A protocol choice with a stated reason.
  • A reconnect path that restores correct state, not just a live socket.
  • A scaling design that works with more than one server instance.

Workflow

  1. Choose the simplest protocol that works — Server-to-client only? Use SSE: it is plain HTTP, reconnects automatically, and passes through proxies. Bidirectional and low-latency? WebSockets. Infrequent updates? Polling is not embarrassing.
  2. Authenticate at the handshake — Validate the token on connect; re-validate periodically for long-lived sockets. A socket opened an hour ago may belong to a revoked session.
  3. Heartbeat both ways — Ping/pong with a timeout. Without it, half-open connections accumulate and leak memory for hours.
  4. Design the resume — Every message carries a monotonic sequence number. On reconnect, the client sends its last-seen ID; the server replays the gap or tells it to resynchronize fully.
  5. Fan out via pub/sub — With more than one instance, a message published on instance A must reach a client connected to instance B. Redis pub/sub, NATS, or the broker you already have.
  6. Apply backpressure — Bound the per-connection send buffer. When it fills, drop the slow consumer rather than the server.

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 99 lines · 41 tokens per session scan A d040c8a9d6ce

Subscribe to this mod's changes

realtime-websockets is a skill published in the GitHub repository nimadorostkar/Claude-Skills-collection (26 stars, last pushed 24d ago), licensed MIT. It adds 41 tokens to every session and 1,016 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories