streaming-api-patterns

streaming-api-patterns is a skill for Claude Code from ArieGoldkin/claude-forge. It costs 30 tokens per session (1,532 once invoked), scanned A, a copy of streaming-api-patterns, MIT.

A guide to building real-time data delivery with SSE, WebSockets, and the Streams API. SSE sends updates from a server to a browser, WebSockets allow two-way communication, and streams handle data as it arrives.

In plain words
What is it for?
Use it when building live notifications, streamed language-model responses, or other services that need reconnection and backpressure handling.
Why use it?
It helps avoid stalled connections, lost updates, and inefficient handling of long-running or continuously arriving data.

Skill for Claude Code

Written for Claude Code: paths in frontmatter.

Part of the atk plugin — 16 skills, 25 commands, 1 agent, 1 hook shipped together

Good fit Use it when building live notifications, streamed language-model responses, or other services that need reconnection and backpressure handling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ariegoldkin/claude-forge/streaming-api-patterns
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 ArieGoldkin/claude-forge --skill streaming-api-patterns
Clone the repo
git clone --depth 1 https://github.com/ArieGoldkin/claude-forge

Made for: Claude Code.

Or install atk, the plugin that ships this one along with the rest of its 16 skills, 25 commands, 1 agent, 1 hook.

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 streaming-api-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/ariegoldkin/claude-forge/streaming-api-patterns/github.svg)](https://agentmods.dev/skills/ariegoldkin/claude-forge/streaming-api-patterns)
Your own site
<a href="https://agentmods.dev/skills/ariegoldkin/claude-forge/streaming-api-patterns"><img src="https://agentmods.dev/badge/skills/ariegoldkin/claude-forge/streaming-api-patterns/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 streaming-api-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/ariegoldkin/claude-forge/streaming-api-patterns"><img src="https://agentmods.dev/badge/skills/ariegoldkin/claude-forge/streaming-api-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,532 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.
Origin 91% copy Near-identical to another mod 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.00030 $0.01532
Opus 5.5 $0.00012 $0.00613
Sonnet 5.5 $0.00006 $0.00306
Haiku 4.5 $0.00003 $0.00153

Measured 3mo ago against content hash f0c8d546fcab, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

streaming-api-patterns 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 3mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (templates/sse-endpoint-template.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Origin

This is a copy

91% identical to streaming-api-patterns — 20 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/ai-toolkit/skills/streaming-api-patterns/SKILL.md · 255 lines

How it starts

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

Streaming API Patterns

Overview

Modern applications require real-time data delivery. This skill covers Server-Sent Events (SSE) for server-to-client streaming, WebSockets for bidirectional communication, and the Streams API for handling backpressure and efficient data flow.

Core Technologies

1. Server-Sent Events (SSE)

Best for: Server-to-client streaming (LLM responses, notifications)

// Next.js Route Handler
export async function GET(req: Request) {
  const encoder = new TextEncoder()

  const stream = new ReadableStream({
    async start(controller) {
      // Send data
      controller.enqueue(encoder.encode('data: Hello\n\n'))

      // Keep connection alive
      const interval = setInterval(() => {
        controller.enqueue(encoder.encode(': keepalive\n\n'))
      }, 30000)

      // Cleanup
      req.signal.addEventListener('abort', () => {
        clearInterval(interval)
        controller.close()
      })
    }
  })

  return new Response(stream, {
    headers: {
      'Content-Type': 'text/event-stream',
      'Cache-Control': 'no-cache',
      'Connection': 'keep-alive',
    }
  })
}

// Client
const eventSource = new EventSource('/api/stream')
eventSource.onmessage = (event) => {
  console.log(event.data)
}

2. WebSockets

Best for: Bidirectional real-time communication (chat, collaboration)

// WebSocket Server (Next.js with ws)
import { WebSocketServer } from 'ws'

const wss = new WebSocketServer({ port: 8080 })

wss.on('connection', (ws) => {
  ws.on('message', (data) => {
    // Broadcast to all clients
    wss.clients.forEach((client) => {
      if (client.readyState === WebSocket.OPEN) {
        client.send(data)
      }
    })
  })
})

// Client
const ws = new WebSocket('ws://localhost:8080')
ws.onmessage = (event) => console.log(event.data)
ws.send(JSON.stringify({ type: 'message', text: 'Hello' }))

3. ReadableStream API

Best for: Processing large data streams with backpressure

Read the full file on GitHub · 255 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3mo ago First seen · 255 lines · 30 tokens per session scan A f0c8d546fcab

Subscribe to this mod's changes

streaming-api-patterns is a skill published in the GitHub repository ArieGoldkin/claude-forge (7 stars, last pushed 3mo ago), licensed MIT. It adds 30 tokens to every session and 1,532 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 91% identical to streaming-api-patterns, differing in 20 lines, and is treated as a copy.

Related

streaming-api-patterns compared with skills from other repositories

streaming-api-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
streaming-api-patternsArieGoldkin/claude-forgeSkill73mo agoMITA30Claude Code
inference-serving-sglangdavila7/claude-code-templatesSkill35ktodayMITA76Claude Code, Codex
amazon-location-serviceawslabs/agent-pluginsSkill957todayApache-2.0A107Claude Code
amplify-workflowawslabs/agent-pluginsSkill957todayApache-2.0A214Claude Code
aws-lambda-durable-functionsawslabs/agent-pluginsSkill957todayApache-2.0A109Claude Code
api-gatewayawslabs/agent-pluginsSkill957todayApache-2.0A108Claude Code
aws-lambdaawslabs/agent-pluginsSkill957todayApache-2.0A74Claude Code