Layered flow of one agent run: three sequential messages.stream calls to the Anthropic API, with client tools running in the gaps between them, all feed a server-side translation layer that emits one continuous EventSource stream to the browser.
BROWSER
one EventSource stream
thinking
tool status
edits
complete
TRANSLATION LAYER · SERVER
Dispatcher
consumes SDK events,
walks tool_use blocks
Tool handlers
execute client tools
between API calls
SSE manager
emits UI-shaped events
replay buffer
ANTHROPIC API
messages.stream
message_stop
client tools run here
messages.stream
message_stop
client tools run here
messages.stream
message_stop
▶ Step through a run
↺ Reset
Hover any element for detail, or step through a run.
Three
messages.stream
calls — and the client-tool pauses between them — collapse into
one ordered stream
to the browser.