Streaming Input changedagent-sdk/streaming-vs-single-mode
Nearest release: v2.1.251, published 3 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+0added
Lines−38removed
From line
15
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits4to this page, all time
### How It Works
The whole hunk
from line 15, old and new numbered
/
from line 15
1515
1616It allows the agent to operate as a long lived process that takes in user input, handles interruptions, surfaces permission requests, and handles session management.
1717
18### How It Works
19
20```mermaid theme={null}
21sequenceDiagram
22 participant App as Your Application
23 participant Agent as Claude Agent
24 participant Tools as Tools/Hooks
25 participant FS as Environment/<br/>File System
26
27 App->>Agent: Initialize with AsyncGenerator
28 activate Agent
29
30 App->>Agent: Yield Message 1
31 Agent->>Tools: Execute tools
32 Tools->>FS: Read files
33 FS-->>Tools: File contents
34 Tools->>FS: Write/Edit files
35 FS-->>Tools: Success/Error
36 Agent-->>App: Stream partial response
37 Agent-->>App: Stream more content...
38 Agent->>App: Complete Message 1
39
40 App->>Agent: Yield Message 2 + Image
41 Agent->>Tools: Process image & execute
42 Tools->>FS: Access filesystem
43 FS-->>Tools: Operation results
44 Agent-->>App: Stream response 2
45
46 App->>Agent: Queue Message 3
47 App->>Agent: Interrupt/Cancel
48 Agent->>App: Handle interruption
49
50 Note over App,Agent: Session stays alive
51 Note over Tools,FS: Persistent file system<br/>state maintained
52
53 deactivate Agent
54```
55
5618### Benefits
5719
5820In streaming input mode, you work in a persistent session with these capabilities:
No line in this hunk matches that.