claude-agent-sdk-demos: Reference implementations showcasing Claude Agent SDK ca

Project Overview

Anthropic’s Claude Agent SDK Demos repository sits at an interesting intersection: it’s not a library you import, but a collection of reference implementations showing what the SDK can actually do. With 2,301 stars on GitHub[1], it’s clearly drawing attention from developers eager to see Claude in action beyond simple chat interfaces. The demos range from trivial (hello-world) to genuinely sophisticated (a multi-agent research system that spawns parallel subagents). What’s notable is the explicit warning that these are for local development only — Anthropic is drawing a clear line between inspiration and production readiness. The TypeScript codebase[1] reflects the SDK’s primary language, though the patterns shown could inform implementations in other languages. The research agent and email agent demos, in particular, reveal the SDK’s design philosophy: agents as composable, tool-using systems rather than monolithic prompts.

What It’s For

This repo is primarily educational, serving developers who want to understand the Claude Agent SDK’s capabilities through concrete examples rather than abstract documentation. The research agent demo is the standout — it demonstrates a pattern where a coordinator agent breaks a complex query into subtopics, dispatches parallel researcher subagents to search the web, then synthesizes findings into a structured report. This is exactly the kind of multi-agent orchestration that many teams are trying to build. The ask-user-question-previews demo is another hidden gem, showing how to render tool options as rich HTML previews via WebSocket — a pattern that’s surprisingly absent from most agent SDK examples. Where this repo falls short is in its lack of production considerations: there’s no error handling patterns, no retry logic, no rate limiting examples. Teams looking to deploy agent systems will need to layer those concerns themselves.

How to Use It

Each demo lives in its own directory with independent setup instructions, so the workflow is choose-and-run. The project uses Bun as its primary runtime, though Node.js 18+ also works. After cloning, you navigate to a specific demo (e.g., cd research-agent), set up your Anthropic API key, and follow that demo’s README. The research agent demo is the most involved — it demonstrates a coordinator agent that uses the SDK’s tool-calling to spawn subagents, each with their own web search capability. This pattern of agent decomposition is the key architectural insight: rather than one massive prompt, the system delegates subtasks to specialized agents that report back. The ask-user-question-previews demo shows a different pattern: it opts into an HTML preview format and uses WebSockets to render tool options as styled cards in the browser, which is useful for any application where users need to make informed choices beyond plain text.

Clone the repository to access all demo applications

git clone https://github.com/anthropics/claude-agent-sdk-demos.git

Run the multi-agent research system that coordinates parallel subagents for topic research

cd research-agent && bun install && bun run start

Recent Updates

Latest Release: Initial release (2025-01-01)

Repository creation with initial demos including email agent, research agent, and hello world examples

The repository has seen steady community engagement since launch, with issues and discussions reflecting developer interest in extending the demos for production use. The addition of the V2 Session API examples (hello-world-v2) suggests Anthropic is iterating on the SDK’s core interaction model, moving toward more explicit send/stream patterns over the earlier query-based approach.


Sources & Attributions

[1] 2,301 stars on GitHub — anthropics/claude-agent-sdk-demos