Tutorials · Claude Agent SDK4 parts · 2 hours 20 min · Updated 16 October 2026

Building agents with the Claude Agent SDK

A four-part course that takes you from your first agent to production operations and the 2026 catalog of agentic design patterns, with runnable code in Python and TypeScript and the real output of every run.

Every part reads two ways. Developers follow the code, the captured run and the walkthrough. Readers who do not code expand the Plain-English version at the top of each section. Nothing here is hypothetical: each script in the examples folder was executed, and the output you see is the output it produced.

Start with part 1 →Read as one page

Parts
Four, each self-contained
Code
32 Python demos, one TypeScript agent, every captured output
Verified
Python SDK 0.2.159 (Claude Code CLI 2.1.281) · TypeScript SDK 0.3.301 (CLI 2.1.301)
Level
Starts from zero; part 4 is for people who already run agents
Infographic: the four parts of the Claude Agent SDK tutorial on one track, with reading time, sections, word count, demos, a headline result and the SDK features each part teaches; 2 hours 20 minutes and 33 runnable demos in all.

Parts

4 parts · 2 hours 20 min · 21,525 words

Build an agent

What an agent is, how the loop works, and how to give it tools, boundaries and memory.

Operate and architect

Running agents safely at scale, then the design patterns that make them reliable.

About this tutorial

Read me first

The Claude Agent SDK is Claude Code packaged as a library: Anthropic's own coding agent, driven from your Python or TypeScript program. This tutorial covers it end to end in four parts, from your first agent to production operations and the design patterns that make agents reliable.

The code. All 32 Python scripts, the TypeScript agent, the tiny sample project they run against and the captured output of every run are in the examples folder, browsable file by file or as one zip. Running a demo costs a few cents to about thirty cents; the graph, voting and debate demos spawn several agents.

How it was verified

Versions and method

Every script was executed against claude-agent-sdk 0.2.159 for Python (which bundles Claude Code CLI 2.1.281) and @anthropic-ai/claude-agent-sdk 0.3.301 for TypeScript (CLI 2.1.301), and the output quoted in each part is the captured stdout of that run, kept in examples/outputs/. Model names, session IDs, costs and the tool list in that output depend on your Claude Code version and configuration, so yours will differ in those details. Behaviour that differs between the two SDKs is called out where it appears, and part 3 ends with a side-by-side cheat sheet.

When the SDKs change in a way that affects a part, that part is re-verified and the date at the top of the page moves. Corrections are welcome on LinkedIn.