
A warm welcome to the course. Discover what the Claude Agent SDK is, preview the three complete agents you will build, and understand why autonomous AI agents are a skill worth learning right now.
Learn what the SDK is, what makes it different from the raw Anthropic API, and how it compares to Claude.ai, the Client SDK, and Managed Agents.
Meet the four components — your Python code, the SDK relay, Claude the reasoner, and Claude Code the executor — and understand the THINKING vs DOING distinction.
A detailed walkthrough of the 10-step agent loop, the five message types you will see in your code, and why understanding this loop makes you a better agent developer.
A quick orientation to the course resources. Learn how to find Colab notebook links in the Resources, understand the difference between Starter and Solution notebooks, and see how each notebook is structured — self-contained setup cells, inline comments, and markdown cells that guide you through the code
Get your coding environment ready in minutes. Set up Google Colab, add your Anthropic API key to Colab Secrets, install the SDK, and verify everything is working.
Write your first autonomous agent. Learn async/await in Python and run your first query() call in Google Colab.
Learn the four message types in the agent stream — SystemMessage, AssistantMessage, UserMessage, and ResultMessage — and extract the final result cleanly.
Build your first complete agent from scratch. The File Explorer Agent explores a directory, reads every file, and produces a clean summary report.
A calm walkthrough of every common error beginners hit — API key issues, SDK not installed, runtime restarts, asyncio errors, and invalid model names.
A focused deep dive into the three core file tools. Learn what each one does, when to use it, and the critical difference between Write and Edit.
Give your agent terminal superpowers. Learn how Bash runs any shell command and how Monitor watches a live process and reacts to output line by line in real time.
Teach your agent to find things. Glob finds files by pattern, Grep searches inside files with regex. Includes a beginner-friendly regex introduction and a combined demo.
Your agent goes live on the internet for the first time. WebSearch finds current information, WebFetch retrieves full page content. Includes a combined research workflow demo.
Build human-in-the-loop agents that pause mid-task and ask clarifying questions. Includes the complete HTTP connection, streaming input, and keep-alive mechanism explained clearly.
The Section 3 payoff. A multi-tool agent that searches a codebase for TODOs, asks the user how they want the report, and produces a clean prioritised summary.
Learn the complete 6-gate permission evaluation flowchart, the difference between allowed_tools and disallowed_tools, the five permission modes, and the bypassPermissions gotcha.
Build a read-only agent and two auto-edit configurations running the same task. See why multiple permission combinations can produce identical results through different gate paths.
Learn how PreToolUse hooks work and build automated blocking rules for dangerous Bash commands, sensitive path writes, and out-of-bounds file access — with live trigger demos.
The course capstone. A production-safe agent that reviews code for quality and security issues with three stacked layers of protection and human-in-the-loop interaction.
Hooks let your own Python code run at key moments in the agent loop, before a tool runs, after it returns, when a prompt is submitted, and more. In this lecture you learn which hook events the Python SDK supports, how a hook callback and a matcher fit together, and how a hook's response can allow, deny or change what the agent does.
After this lecture you will be able to choose the right hook event for a job and explain how hooks sit around the agent loop.
A PostToolUse hook runs after a tool finishes, which makes it the natural place to record what your agent actually did. In this hands-on lecture you write a hook callback, attach it to specific tools with a matcher, and log every tool call the agent makes.
After this lecture you will be able to build an activity log for any agent and read the tool name, input and response that a PostToolUse hook receives.
PostToolUse hooks can do more than watch. In this lecture you use one to change the output a tool returns, such as masking sensitive values before they go any further, and another to stop an agent run once a limit is reached. You also see what happens when a hook returns the wrong shape, and why you should always confirm results against the files on disk.
After this lecture you will be able to modify tool output from a hook and stop a run from a hook.
A UserPromptSubmit hook runs when a prompt is sent to the agent, before the agent starts working on it. In this lecture you use it to add extra context to a prompt, so the agent can answer questions that depend on information it was never given. You compare an agent with no hook against the same agent with context injected, and then make the injection conditional.
After this lecture you will be able to inject context into prompts and decide when a hook should add it.
In this capstone for the section you combine two hooks into one agent. A PreToolUse hook guards a protected folder, and a PostToolUse hook records every file the agent changes. You then check the results against the real files, so you do not have to trust the agent's own summary.
You code along in the starter notebook, and the solution notebook is there as a reference.
After this lecture you will be able to build an agent that blocks changes to protected files and keeps a reliable audit log of everything it changed.
Every time your agent runs, the SDK saves the conversation to a transcript file on disk. In this lecture you capture the session ID from a finished run, find the transcript, and look inside it. You also use the SDK’s session functions to list saved sessions, read their details and replay their messages.
After this lecture you will be able to explain what a session is, locate its transcript, and inspect saved sessions with the Python SDK.
A session is only useful if you can come back to it. In this lecture you capture a session ID, resume that exact conversation in a new run, and see the agent remember what it already learned. You then continue the most recent conversation without an ID, and use a client object for multi-turn conversations.
After this lecture you will be able to resume a past conversation by ID, continue the most recent one, and choose the right approach for your agent.
Sometimes you want to try a second idea without losing the first. Forking branches a session into a new one, so both conversations continue from the same starting point without affecting each other. In this lecture you fork a live session, prove the original is untouched, and then create a fork offline from a chosen message in the saved history.
After this lecture you will be able to fork a session, tell a fork apart from a resume, and branch from an earlier point in a conversation.
A session remembers the conversation, but it does not undo what the agent did to your files. File checkpointing does. In this lecture you turn it on, let the agent edit files, and rewind them to an earlier point. You confirm the result by checking the files on disk. You also see which changes checkpointing tracks and which it cannot, including a demo with shell commands.
After this lecture you will be able to enable file checkpointing, rewind an agent’s file changes, and know where its limits are.
Long conversations grow, and growth costs tokens and money. In this lecture you check how much of the context window a session is using and estimate what a run costs. You also see how a resumed session reports its spend, compact a conversation, and set limits on turns and budget so a run cannot get out of hand.
After this lecture you will be able to monitor context usage, read cost figures from a run, compact a long session, and put guardrails on an agent.
Put the whole section to work on one small Python project with a hidden bug. In a single session you analyse the code, fix the bug with file checkpointing on, rewind the fix and try a different one, and fork a read-only branch to double-check. You check progress with real test runs on disk and track context and cost as you go, then finish with a summary report.
After this lecture you will be able to combine sessions, resuming, forking, checkpointing and cost tracking in one multi-turn agent workflow.
Explore Google's Agent Development Kit as a complementary course to Claude, offering a different ecosystem and tools for a broader, well-rounded understanding of modern agentic AI development.
AI agents are how software gets built next. This course teaches you to build them — from scratch, in Python, using the Claude Agent SDK.
The Claude Agent SDK is the same technology that powers Claude Code — Anthropic's AI coding assistant used by hundreds of thousands of developers worldwide. This course gives you programmatic access to that same engine, so you can build autonomous agents that read files, run commands, search the web, ask users questions, and complete complex multi-step tasks — without writing a single line of tool execution logic yourself.
What You Will Build
By the end of this course you will have built three complete agents from scratch:
File Explorer Agent — autonomously explores a directory, reads every file, and produces a clean summary report. Your first complete autonomous agent.
Codebase TODO Summarizer Agent — searches an entire codebase for TODO comments, filters results by priority based on your preferences, and produces a structured report. Uses Glob, Grep, Read, and AskUserQuestion working together.
Safe Code Review Agent — the course capstone. Reviews code for quality issues and security vulnerabilities — hardcoded credentials, SQL injection, poor error handling — without being able to modify a single file. Three layers of production safety built in.
What You Will Learn
Section 1 — The Big Picture Understand exactly how the Claude Agent SDK works under the hood before writing a single line of code. The four components, the agent loop, pipe communication between the SDK and Claude Code, and session management. This mental model makes everything else in the course click.
Section 2 — Your First Agent Everything runs in Google Colab — no local setup required. Write your first query() call, master async/await in Python, read and filter the agent message stream, and build your first complete agent. A dedicated troubleshooting lecture covers every common error you might hit.
Section 3 — Built-In Tools Deep Dive A systematic tour of every built-in tool the SDK provides:
File tools — Read, Write, Edit — including the critical Write vs Edit distinction
Shell tools — Bash for terminal commands, Monitor for live process output
Search tools — Glob and Grep with a beginner-friendly regex introduction
Web tools — WebSearch and WebFetch for live internet access
User interaction — AskUserQuestion with the complete human-in-the-loop flow explained clearly — including how the HTTP connection, streaming input, and keep-alive mechanism work together
Section 4 — Permissions & Safety Control exactly what your agent is allowed to do. The complete 6-gate permission evaluation flowchart. The difference between allowed_tools, disallowed_tools, and the five permission modes. How to use PreToolUse hooks to automatically block dangerous operations. By the end of this section you will know how to build agents that are safe enough for production.
How This Course Is Delivered
Every coding lecture runs in Google Colab — click the link in the course resources and you are coding immediately. No local Python setup, no virtual environments, no dependency headaches. Each lecture comes with a solution notebook hosted on GitHub.
The course uses claude-haiku-4-5 by default — the fastest and most cost-effective Claude model — keeping your API costs low while you learn. You can switch to any Claude model with a single variable change.
Requirements
Basic Python — functions, loops, variables
A Google account — for Colab
An Anthropic API key — API usage is billed by Anthropic, so you may need to add credit to your Console account. The course uses the lowest-cost Claude model by default.
Why Learn This Now
AI agents are moving from demos to production. Developers who can build, control, and constrain autonomous agents have a genuine skill advantage. The Claude Agent SDK is production-grade, actively maintained by Anthropic, and powers one of the most widely used AI coding tools in the world. This course gives you a solid foundation — built on real code, real agents, and real production-safety patterns.