Answer: Call `run.stream()` on the `Run` returned by `agent.send()` and iterate it with `for await`, switching on `event.type` to handle events such as "assistant", "thinking", "tool_call", and "status". For lower-level per-token updates, pass `onDelta` and `onStep` callbacks to `send()`. Status: Confirmed Entry: tool/cursor/features/stream-messages Revision: 1 Digest: sha256:c624e1bd344a3fa0 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:12:10Z Last changed: 2026-11-13T03:12:10Z Last verified: 2026-11-20T12:40:53Z Next check: 2026-11-21T12:40:53Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of stream method | stream(): AsyncGenerator; | [1] | 2026-11-20 streaming example | for await (const event of run.stream()) { | [1] | 2026-11-20 event types handled | case "assistant": | [1] | 2026-11-20 raw delta callback | onDelta | [1] | 2026-11-20 step callback | onStep | [1] | 2026-11-20 usage stream event | event.type === "usage" | [1] | 2026-11-20 Sources: [1] Anysphere. "cursor.com/docs/sdk/typescript.md". https://cursor.com/docs/sdk/typescript.md Role: primary. Accessed: 2026-11-20T12:40:53Z Quote: "stream(): AsyncGenerator;" (Supports: stream method) Quote: "for await (const event of run.stream()) {" (Supports: streaming example) Quote: "case "assistant":" (Supports: event types handled) Quote: "pass `onDelta` and `onStep` callbacks to `send()`" (Supports: raw delta callback) Quote: "onStep: ({ step }) => {" (Supports: step callback) Quote: "if (event.type === "usage") {" (Supports: usage stream event) Snapshot SHA-256: c9e134cfe90fbd451316dd97f8a332e7e6c2a1c159e3491a2b03d32790252bf2 (captured 2026-11-13T03:12:08Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:12:10Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:40:53Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:40:53Z Last attempt: 2026-11-20T12:40:53Z Notes and limitations: Extracted automatically from a single official source (section "Sending messages"). Related: https://latestn.com/tool/cursor/features/supported-hook-events Which hook events does Cursor support, such as preToolUse, afterFileEdit, or stop? https://latestn.com/tool/cursor/features/view-commit-history-and-filter-author How do I view commit history and filter commits by author in Cursor Origin? https://latestn.com/tool/cursor/features/voice-chat-requirements What are the requirements to use voice chat in Cursor? https://latestn.com/tool/cursor/features/share-canvas How do I share a Cursor canvas with teammates? https://latestn.com/tool/cursor/features/share-linux-agent-desktop How do I share the agent desktop on a Cursor Linux worker? https://latestn.com/tool/cursor/features/start-voice-chat How do I start a voice chat in Cursor? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:12:10Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/cursor/features/stream-messages/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/cursor/features/stream-messages POST: https://latestn.com/dispute/tool/cursor/features/stream-messages with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/cursor/features/stream-messages?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I stream messages and handle stream events from a Cursor SDK agent run? Revision 1, last verified 2026-11-20T12:40:53Z. https://latestn.com/tool/cursor/features/stream-messages (accessed 2026-11-21T09:53:21Z). @misc{LatestN_tool_cursor_features_stream_messages_r1, title = {How do I stream messages and handle stream events from a Cursor SDK agent run?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/cursor/features/stream-messages}}, note = {Revision 1; digest sha256:c624e1bd344a3fa0; last verified 2026-11-20T12:40:53Z; accessed 2026-11-21T09:53:21Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/cursor/features/stream-messages