Back to library
AI
tutorial

Eliminate UI Lag with Real-Time Agent Streaming Deltas

Enable event deltas to show real-time stream previews of agent responses.

Use the 'event_deltas[]' parameter when streaming agent events to provide immediate visual feedback. This allows users to see text as it is generated rather than waiting for the entire message to finish.

Claude

The Scenario

You are building a customer support dashboard where an AI agent solves complex tickets. You want the user to see the agent typing in real-time so they don't think the system has crashed while Claude 'thinks.'

Before & after

The old way

Developers had to wait for the complete 'agent.message' event to arrive before displaying any text to the user. For long tasks, this could create a lag of 10–20 seconds where the UI looks frozen.

With AI

By using the 'event_deltas[]' parameter, you can stream content instantly as it's generated. This makes the experience feel immediate, reducing the perceived wait time to under 1 second.

The Prompt

I am using Claude Managed Agents. How do I implement the new 'event_deltas[]' query parameter on the 'GET /v1/sessions/{session_id}/events/stream' endpoint to show real-time text previews to my users? Provide a code snippet in [LANGUAGE, e.g., Python or Node.js].

Claude Managed Agents now support streaming deltas, allowing you to show the AI's 'thinking' or partial text responses in real-time. This is critical for maintaining user engagement during complex, multi-step agent tasks.

Source

Claude Platform - Claude Platform Docs
"Claude Managed Agents session event streams now support event deltas to preview agent message text as it is generated."