Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Claude Agent SDK: Build Production AI Agents in Python
New
5 students

Claude Agent SDK: Build Production AI Agents in Python

Master the technology powering Claude Code — build and control autonomous AI agents in Python
Last updated 6/2026
English

What you'll learn

  • Understand how the Claude Agent SDK works under the hood — the four components, the agent loop, pipe communication, and session management
  • Write your first autonomous agent in Python using the query() call, async/await pattern, and message stream filtering in Google Colab
  • Use every built-in tool the SDK provides — Read, Write, Edit, Bash, Monitor, Glob, Grep, WebSearch, WebFetch, and AskUserQuestion
  • Build human-in-the-loop agents that pause mid-task, ask the user clarifying questions, and continue based on their answers using the can_use_tool callback
  • Control agent permissions precisely using allowed_tools, disallowed_tools, and the five permission modes — and understand the 6-gate permission evaluation flow
  • Block dangerous operations automatically using PreToolUse hooks — intercepting harmful Bash commands, sensitive path writes, and out-of-bounds file access
  • Build three complete agents from scratch — a File Explorer Agent, a Codebase TODO Summarizer Agent, and a Safe Code Review Agent
  • Apply production-safety patterns — multiple layers of protection including tool whitelisting, permission mode lockdown, and hook-based automated blocking

Course content

5 sections22 lectures3h 30m total length
  • Introduction8:55

    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.

  • What is the Claude Agent SDK?9:17

    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.

  • The Four Components9:35

    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.

  • The Agent Loop: Step by Step14:48

    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.

  • How to Access Course Resources & Notebooks5:28

    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

Requirements

  • Basic Python knowledge — you should be comfortable writing functions, loops, variables, and basic file operations. No advanced Python needed.
  • A Google account — all coding is done in Google Colab. No local setup, no installations, no configuration required.
  • An Anthropic API key — the free tier is sufficient for completing this course.
  • No prior AI or machine learning experience needed — this course starts from zero and builds up progressively.
  • No prior experience with the Claude API or any other AI SDK needed — everything is taught from scratch.
  • No powerful hardware required — everything runs in the cloud via Google Colab.

Description

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 — free tier is sufficient

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.

Who this course is for:

  • Python developers who want to build AI agents — you know the basics of Python and want to go beyond chatting with AI to actually building autonomous programs that take actions
  • Developers who have used Claude or ChatGPT and want to move from the chat interface to building programmatic agents that run without human intervention
  • Software engineers exploring AI automation — you want to automate repetitive development tasks like code review, file analysis, and codebase searching using autonomous agents
  • Beginners to the Anthropic ecosystem — you have heard about Claude, Claude Code, or the Anthropic API and want a structured, hands-on introduction to building with it in Python
  • Developers curious about Claude Code — you use Claude Code as a coding assistant and want to understand the technology powering it and build on top of it programmatically
  • This course is NOT for you if — you are looking for a course on using Claude Code as an interactive terminal tool, or if you want a general introduction to AI/ML concepts without writing code