Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add latestaiagents/agent-skills --skill agent-sdk-streaminggit clone --depth 1 https://github.com/latestaiagents/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/latestaiagents/agent-skills/agent-sdk-streaming)<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/agent-sdk-streaming"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/agent-sdk-streaming/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/agent-sdk-streaming"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/agent-sdk-streaming.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00094 | $0.01556 |
| Opus 5 | $0.00047 | $0.00778 |
| Sonnet 5 | $0.00019 | $0.00311 |
| Haiku 4.5 | $0.00009 | $0.00156 |
Grade A, and why
agent-sdk-streaming scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 209 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent SDK Streaming
Streaming is the difference between "this agent works" and "this agent feels alive". Stream text as it generates, show tool activity, and never block the UI on a long tool call.
When to Use
- Building any interactive agent UI
- Long-running agents where users need to see progress
- Debugging "why does my agent hang?" (often: you're not reading the stream)
Event Types
The SDK emits a typed stream of events. Core types:
| Event | When | UI treatment |
|---|---|---|
assistant with text block |
Model generates text | Append to current message bubble |
assistant with thinking |
Extended thinking | Show "thinking..." spinner |
assistant with tool_use |
Model decides to call tool | Show tool badge ("calling web_fetch...") |
user with tool_result |
Tool returned | Show result or just acknowledge |
system with progress |
Tool progress notification | Update progress bar |
result |
Turn complete | Remove spinner, finalize |
TypeScript Streaming
import { query } from "@anthropic-ai/claude-agent-sdk";
const ui = new ChatUI();
for await (const msg of query({ prompt, options: { model: "claude-sonnet-4-6" } })) {
switch (msg.type) {
case "assistant": {
for (const block of msg.message.content) {
if (block.type === "text") ui.appendText(block.text);
if (block.type === "thinking") ui.showThinking(block.thinking);
if (block.type === "tool_use") ui.showToolCall(block.name, block.input);
}
break;
}
case "user": {
for (const block of msg.message.content) {
if (block.type === "tool_result") ui.showToolResult(block.tool_use_id, block.content);
}
break;
}
case "result": {
ui.finalize(msg.result);
break;
}
}
}
Text Deltas vs Messages
Some SDK versions emit full messages (with cumulative text) rather than deltas. Handle both:
let lastText = "";
// on assistant text:
const newText = block.text.slice(lastText.length);
ui.appendText(newText);
lastText = block.text;
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 209 lines · 94 tokens per session scan A e9a72bf4aa0a
agent-sdk-streaming is a skill published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 94 tokens to every session and 1,556 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
ai-core-web-vitals
A diagnostic assistant for Core Web Vitals, Google's measures of page loading speed, responsiveness, and visual stability. It is intended for technical, product, marketing, and software work.
ai-design-taste-frontend
A frontend visual-quality reviewer that examines whether an interface looks polished and coherent. It produces visual or creative diagnoses, prompt or storyboard ideas, and publishing checks.
ai-extract-design-system
A visual-quality review assistant for examining a product or software interface and its design patterns.
ai-frontend-design
A visual-quality review assistant for checking whether a design is ready to publish.
mcp-app-scaffolding
Scaffolds MCP App project structure with correct directory layout, dependencies, entry points, and framework-specific templates. Handles React (useApp hook), Vanilla JS, Vue, Svelte, Preact, and Solid.
moai-design-tools
Design tool integration specialist covering Figma MCP, Pencil renderer, and Pencil-to-code export. Use when fetching design context from Figma, rendering Pencil designs, or exporting to React/Tailwind code.