Step-by-step agent tutorials

Build production agents, step by step.

Clean, copy-paste tutorials for building AI agents: first-class code blocks, real eval results, and no fluff. Follow a path or jump straight to the step you need.

$ npm i && copy-paste the next step

Learning paths

Curated tutorial sequences

Each path is an ordered run of copy-paste tutorials. Start at step one or drop in wherever you are.

Featured tutorials

Single, self-contained walkthroughs you can finish in one sitting.

Intermediate9 min

Claude Agent SDK: tools vs allowedTools, and what a subagent definition silently accepts

allowedTools auto-approves, tools restricts. That half is documented. What is not: an AgentDefinition has no allowedTools field, and the SDK forwards one verbatim to the CLI anyway, unvalidated.

Intermediate10 min

Bisecting a Claude Agent SDK behaviour change: why grepping the bundle dates it wrong

A grep bisect tells you when today's code landed, not when the behaviour changed. Here is the argv-capture harness that dates it properly, and the worked example where grepping made a maintainer look wrong and running the versions proved him right.

Intermediate11 min

Claude Agent SDK skills: "docs:*" throws, "pdf-*" does not

The skills option validates every name before the session starts, and its wildcard guard tests for exactly two endings. Eight of eleven wildcard shapes get through, become a Skill(name) rule that names no skill, and say nothing. Measured first-party on 0.3.272, with the bisect.

Beginner7 min

Unknown hook type: Claude Agent SDK 0.3.257 Drops the Hook, Not the File (2026)

Since @anthropic-ai/claude-agent-sdk 0.3.257 a malformed hook entry is deleted from settings.json and the rest of the file loads normally, so the hook just never runs. PreToolUse and PermissionRequest are the two exceptions, where the whole file is voided. Bisected against 0.3.252, with a runnable detector.

Beginner6 min

No Matching Version Found for @anthropic-ai/sdk: There Is No 1.x on npm (2026)

npm error notarget No matching version found for @anthropic-ai/sdk means you asked for a major that does not exist. Anthropic ships two SDKs on unrelated version lines: Python is on 1.5.0, npm has never left 0.x. Read from both registries, with the caret trap that follows.

Beginner8 min

Invalid http_client argument: anthropic 1.x Runs on httpx2, and Two Cases the Guard Misses (2026)

TypeError: Invalid http_client argument means the anthropic Python SDK moved to httpx2 in 1.0.0. The rename is one import. The parts nobody mentions are that the guard printing that message only exists from 1.4.0, and that it cannot see your respx or OpenTelemetry layer at all (2026).

Pick your stack

Tell us your model provider and runtime, and we'll surface the tutorials that match.

From the notebook

The latest tutorials, fresh off the press.

Tutorials

Claude Agent SDK skills: "docs:*" throws, "pdf-*" does not

The skills option validates every name before the session starts, and its wildcard guard tests for exactly two endings. Eight of eleven wildcard shapes get through, become a Skill(name) rule that names no skill, and say nothing. Measured first-party on 0.3.272, with the bisect.

11 min read29

Found a bug or want a topic covered?

Found a bug in a tutorial, want a topic covered, or shipping something with these patterns? Send the details. Code snippets and repro steps welcome.

Get in touch