TheSyart/claude-agent-examples

Claude Agent examples - from simple to complex

What it solves

Many tutorials treat AI agents as a black box or rush to wrap them in heavy frameworks. This project tears the agent apart and rebuilds it step by step in plain Python, so you can actually understand how each piece works — the main loop, memory, tools, planning, sub-agents, team coordination, MCP, and hooks. Each later step keeps everything from the previous step and adds exactly one new capability, making the learning curve gentle and explicit.

How it works

The teaching path starts with a single API call (step01) and then adds, in order: a loop without memory, chat history, system prompts, tool use, skills, a memory system, a todo-list planner, sub-agents, an agent team, MCP servers, and hooks that intercept or audit agent behavior. Every step exists as both a standalone Python file (in build-agent-example/code/) and a matching explanation document (in build-agent-example/doc/) that uses a uniform structure: problem, solution, how it works, changes, try it. The repository also includes demo resources for skills, memory templates, a local MCP time server, ten HTML lecture decks (PPT), and timestamped transcripts of the first seven Bilibili videos.

Beyond the twelve code steps, the project explains Computer Use — browser and desktop control with an observe–judge–execute–observe loop — via lecture slides only; the real implementation lives in the companion project TheSyart/emperor-agent, which organizes all those components into a fuller local agent with a web UI, streaming, and telemetry.

Who it’s for

This is for developers and learners who want to understand the internals of AI agents rather than just use a ready-made framework. If you are comfortable with basic Python and want to see how an agent is built from a single model call up to multi-agent collaboration, this course is for you. The included PPTs and transcripts also make it usable for self-study, review, or recording your own explanations.

Highlights

  • A strictly cumulative teaching path: step11 = step10 + MCP, step12 = step11 + Hooks.
  • Each step keeps a single-file Python script that is easy to read and run.
  • Covers the full agent lifecycle: main loop, memory, tools, skills, planning, sub-agents, team coordination, MCP, and hooks.
  • Includes demo memory files and skill definitions (e.g., memory/history.jsonl, memory/MEMORY.md, skills/red-braised-pork/SKILL.md) that the later steps read and write.
  • Provides HTML lecture slides and timestamped video transcripts for deeper study.
  • Points to a practical follow-up project (Emperor Agent) that combines all the learned pieces into a real-world local agent.

Related

  • Project
  • Project
  • Project
  • Project