streaming

Stream Claude API responses progressively via Server-Sent Events with delta types.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires llm-integration.

What problem does it solve?

This Skill enables real-time, progressive delivery of AI responses from Claude, improving user experience for long-running generations, tool use, and extended thinking by displaying output as it's generated.

Core Features & Use Cases

  • Real-time Output: Stream text, tool use, and extended thinking content as it becomes available.
  • Event-Driven Processing: Handle different SSE event types (content_block_delta, message_delta) for granular control.
  • Robust Error Handling: Implement retry mechanisms with exponential backoff for API resilience.
  • Use Case: You're building a chatbot that generates complex reports. Use this skill to stream the report content word-by-word to the user interface, providing immediate feedback and a more engaging experience, rather than waiting for the full response.

Quick Start

Use the streaming skill to generate a short story and display the output in real-time.

Frequently Asked Questions about streaming

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

FAQPage Schema
How do I stream real-time responses from the Claude API to a user interface?▼

Stream real-time responses using Server-Sent Events (SSE) to progressively deliver Claude's output as it's generated. This enables word-by-word text delivery, live tool-use execution, and extended thinking visualization, improving user engagement without waiting for complete message generation.

What are the different SSE event types I need to handle for streaming?▼

Handle three main delta types: text_delta for streamed text content, input_json_delta for tool parameters, and thinking_delta for extended thinking output. Each event type requires distinct buffering and parsing logic to safely reconstruct content blocks without interrupting JSON structures mid-stream.

Can I use streaming with tool use in Claude API integrations?▼

Yes. Streaming supports tool-use workflows by delivering tool calls progressively and buffering input_json_delta events until complete, preventing JSON parsing errors. This enables real-time visibility into multi-step tool-assisted tasks without blocking on full response generation.

How do I handle streaming errors and ensure reliable API delivery?▼

Implement retry mechanisms with exponential backoff to handle transient failures. Gracefully manage connection drops and partial messages by validating event structures and maintaining state across reconnections for robust real-time delivery.

What client languages does Claude API streaming support?▼

Streaming via SSE supports Python and TypeScript clients, enabling cross-platform real-time output delivery. Both language implementations handle event parsing, delta reconstruction, and asynchronous processing patterns natively.

When should I use streaming instead of waiting for complete responses?▼

Use streaming for long-running generations, complex report generation, interactive chatbots, and extended thinking workflows where immediate user feedback improves perceived performance. Avoid streaming for simple, fast responses where latency is negligible.