Anthropic Stream Event Viewer

Anthropic Stream Event Viewer

Parse Anthropic message_stream typed events — message_start, content_block_*, thinking, tool_use, message_delta, message_stop — into a structured conversation viewer.

Message

ID
msg_01XYZ
Model
claude-opus-4.7
Role
assistant
Stop reason
tool_use
Model is requesting a tool call; supply tool_result and resume.

Usage

Input
42
Output
89
Cache write
0
Cache read
1,240

Reconstructed content blocks (3)

[0]thinking
The user asked about caching. I should explain the difference between cache_creation and cache_read.
[1]text
Prompt caching has two phases: write and read.
[2]tool_useget_pricing
accumulated input_json:
{"model":"sonnet"}
{
  "model": "sonnet"
}

Event counts

content_block_delta5
content_block_start3
content_block_stop3
message_start1
message_delta1
message_stop1

Event timeline

#typesummary
0message_startmodel=claude-opus-4.7
1content_block_startidx=0 type=thinking
2content_block_deltaidx=0 delta=thinking_delta
3content_block_deltaidx=0 delta=thinking_delta
4content_block_stop
5content_block_startidx=1 type=text
6content_block_deltaidx=1 delta=text_delta
7content_block_stop
8content_block_startidx=2 type=tool_use name=get_pricing
9content_block_deltaidx=2 delta=input_json_delta
10content_block_deltaidx=2 delta=input_json_delta
11content_block_stop
12message_deltastop_reason=tool_use
13message_stop

What This Tool Does

Anthropic Stream Event Viewer is built for deterministic developer and agent workflows.

Parse Anthropic message_stream typed events — message_start, content_block_start/delta/stop, tool_use, thinking, message_delta, message_stop — into a structured viewer with stop_reason and usage breakdown.

Use How to Use for execution steps and FAQ for constraints, policies, and edge cases.

Last updated:

This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.

Agent Invocation

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/anthropic-stream-event-viewer/

For automation planning, fetch the canonical contract at /api/tool/anthropic-stream-event-viewer.json.

How to Use Anthropic Stream Event Viewer

  1. 1

    Drop the message_stream log

    Paste a raw Anthropic SSE capture — the typed event names like message_start, content_block_delta, and message_stop must remain on their own lines, with JSON payloads on data lines.

  2. 2

    Read the message header

    The Message panel surfaces the message id, model, role, and stop_reason as soon as those events arrive. A short note explains every stop_reason value (end_turn, tool_use, max_tokens, refusal, pause_turn).

  3. 3

    Walk reconstructed content blocks

    Text, thinking, and tool_use blocks are reassembled from their deltas. tool_use blocks show the accumulated partial_json and parse it once it becomes valid JSON so you can verify tool inputs end-to-end.

  4. 4

    Audit usage and the timeline

    The Usage panel separates input, output, cache_creation_input_tokens, and cache_read_input_tokens. The event timeline lets you click any event to see its full JSON payload for deeper debugging.

Frequently Asked Questions

Which events does it understand?
All Anthropic message_stream typed events: message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop, ping, and error. Unknown event types render as raw JSON for inspection.
How are content blocks reconstructed?
text_delta, thinking_delta, and input_json_delta payloads accumulate against the index from each content_block_start. tool_use input_json is rendered raw and re-parsed once it becomes valid JSON so you can verify tool arguments.
What does the usage panel show?
input_tokens, output_tokens, cache_creation_input_tokens, and cache_read_input_tokens — the four counters Anthropic emits. Cache write and cache read are colored differently so you can audit prompt-cache effectiveness in one glance.
Does it send my data to a server?
No. The viewer parses your SSE log, reconstructs content blocks, and renders usage entirely in your browser. Stream contents never leave your device.
How does it differ from a generic SSE replayer?
It speaks Anthropic's typed event vocabulary. Stop reasons get plain-English notes, tool_use input_json reassembles into valid JSON, and the four-channel usage breakdown is specific to Claude prompt-cache accounting.