streaming

Stream Claude API responses in real time via Server-Sent Events.

18|2|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/markus41/claude --skill streaming-markus41
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: streaming
Source: https://github.com/markus41/claude/tree/main/.claude/skills/streaming
Command: npx skills add https://github.com/markus41/claude --skill streaming-markus41

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables real-time, progressive responses from the Claude API, allowing for dynamic and interactive user experiences by handling Server-Sent Events (SSE).

Core Features & Use Cases

  • Real-time UI Updates: Display responses as they are generated, improving perceived performance.
  • Progressive Output: Show text, tool use, and extended thinking incrementally.
  • Efficient Handling: Manages SSE event flow, including deltas and stop events, for both text and tool calls.
  • Use Case: Building a chatbot interface where messages appear word-by-word, or a code generation tool that shows code snippets as they are produced.

Quick Start

Use the streaming skill to stream a response from the Claude API for the prompt "Write a short story."

Frequently Asked Questions about streaming

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle Server-Sent Events for real-time Claude API streaming?

Real-time Claude API streaming uses Server-Sent Events (SSE) to progressively display text, tool use, and extended thinking. You must parse various SSE event types and delta types while accumulating tool JSON to build interactive applications.

What is the best way to show progressive text output from the Claude API?

Progressive text output is achieved by processing SSE deltas from the Claude API. This approach allows chatbot interfaces to display messages word-by-word and code generation tools to show snippets as they are produced, improving perceived performance.

How do I manage tool use accumulation during Claude API event handling?

Tool use accumulation during Claude API event handling requires applying critical rules for assembling tool JSON from SSE deltas. You must intercept specific event types and progressively concatenate the delta fragments to form complete tool calls.

Does the streaming Skill support connection management and error handling for SSE?

Yes, the streaming Skill provides robust error handling and connection management for SSE streams. This ensures stable real-time processing of text, extended thinking, and tool use deltas while managing network connections for interactive applications.

When do I need to use SSE streaming instead of standard API responses?

You need SSE streaming when building interactive applications requiring real-time UI updates, such as chatbot interfaces or code generators. It enables dynamic user experiences by displaying progressive output as responses are generated rather than waiting for completion.

Can I stream extended thinking and tool use simultaneously from the Claude API?

Yes, you can stream extended thinking and tool use simultaneously by handling the SSE event flow from the Claude API. The streaming mechanism processes both delta types incrementally, allowing real-time display of thought processes alongside tool execution.