Opening page of chapter 2, The agent loop, with its Verification status: draft box
A book page with the safe calculator code listing
Exercise 1 from the book: Predict, Run, Observe, Explain, Record
Interview bank page with questions 27 and 28 and model answers

Build AI agents from the loop up

A course and a 427-page book for developers. You write the agent loop yourself, then add tools, memory, retrieval, evals, security and a shipped capstone. Examples use the Claude API in Python.

Get early access, $29 Read chapters 00–02 free

A page from chapter 8, Reliability and security, with its status box and the list of what you will be able to do
A page from chapter 8, Reliability and security.

Between a tutorial and a bootcamp

Free courses show you one framework for an afternoon. Bootcamps cost $800 to $2,000 and run on someone else's schedule. This course sits in between. It is long and text-first, so you can study it properly. It doesn't depend on any framework, so what you learn transfers. And you run all of it on your own machine, with your own API key.

12chapters

200,000words, about

77exercises and a capstone

119interview questions with model answers

137glossary terms

4 to 6months at 10 to 15 hours a week

The course map page: Start here, with the three parts that work together
Start here: the course map, from the book.

Twelve chapters, in study order

Choose a chapter to see what you will be able to do, the skill employers ask for, its exercises and where it stands.

  1. 0 Build in public

    Capture work as you go and turn it into credible posts.

    Employer skill
    Communication, portfolio
    Exercises
    Templates
    Status
  2. 1 Foundations

    Call an LLM API, read every part of the response, estimate cost, get validated structured output.

    Employer skill
    LLM fundamentals, API use, prompting
    Exercises
    6
    Status
  3. 2 The agent loop

    Write the tool-using loop from scratch, design tools, bound the loop, read traces.

    Employer skill
    Tool use, agent design
    Exercises
    6
    Status
  4. 3 Software foundations

    Write typed, tested, async, logged, containerised Python.

    Employer skill
    Production Python, testing, deployment
    Exercises
    10
    Status
  5. 4 Context and memory

    Manage what the model sees: trimming, caching, compaction, retrieval, memory.

    Employer skill
    Context management, cost control
    Exercises
    7
    Status
  6. 5 Retrieval in depth

    Build and measure a full RAG system with chunking, hybrid search, reranking and citations.

    Employer skill
    RAG, embeddings, vector search
    Exercises
    13
    Status
  7. 6 Protocols and extensibility

    Build an MCP server, use skills and hooks, reason about the whole harness.

    Employer skill
    MCP, tool integration
    Exercises
    7
    Status
  8. 7 Multi-step patterns

    Choose and build workflows, orchestrators and sub-agents, and prove they beat a single agent.

    Employer skill
    Multi-agent orchestration
    Exercises
    7
    Status
  9. 8 Reliability and security

    Build evals, trace failures, red-team your agent, add defences.

    Employer skill
    Evals, observability, guardrails, safety
    Exercises
    8
    Status
  10. 9 Frameworks and tooling

    Read and use LangGraph and others, instrument with tracing tools, decide when a framework helps.

    Employer skill
    Framework literacy, observability tools
    Exercises
    4
    Status
  11. 10 Production

    Ship, monitor and maintain an agent others can rely on; write a postmortem.

    Employer skill
    Deployment, ops, the capstone
    Exercises
    Capstone in milestones
    Status
  12. 11 Career guide

    Position yourself, build a hiring-grade portfolio, pass the interview loop.

    Employer skill
    Getting hired
    Exercises
    9
    Status

Every exercise runs the same five moves

  1. Predict what will happen.
  2. Build it.
  3. Observe what actually happened.
  4. Explain the difference.
  5. Record it in your journal.

Principles

  • Build the loop yourself before using a framework.
  • Every run leaves a trace.
  • Bound everything: steps, tokens, money, permissions.
  • Treat tool output as untrusted data.
  • Measure; do not guess.
  • Write down failures.

Your journal entries then become the build-in-public posts that chapter 00 teaches you to write, which makes them a portfolio an employer can check.

Book page: Reading a trace, with an example trace file from a run of agent.py

The real loop, in about 25 lines

This is the function you write in chapter 2. Every run of it leaves a trace you learn to read.

def run(task: str) -> str:
    msgs = [{"role": "user", "content": task}]
    log("task", task=task)
    for step in range(MAX_STEPS):
        r = client.messages.create(model=MODEL, max_tokens=1024, tools=TOOLS, messages=msgs)
        log("model", step=step, stop_reason=r.stop_reason,
            usage={"in": r.usage.input_tokens, "out": r.usage.output_tokens},
            content=[b.model_dump() for b in r.content])
        msgs.append({"role": "assistant", "content": r.content})
        if r.stop_reason != "tool_use":
            return "".join(b.text for b in r.content if b.type == "text")
        results = []
        for b in r.content:
            if b.type != "tool_use":
                continue
            try:
                out, err = HANDLERS[b.name](b.input), False
            except Exception as e:  # tool errors go back to the model, it can recover
                out, err = f"error: {e}", True
            log("tool", step=step, name=b.name, input=b.input, output=out, is_error=err)
            results.append({"type": "tool_result", "tool_use_id": b.id,
                            "content": out, "is_error": err})
        msgs.append({"role": "user", "content": results})
    return "stopped: hit MAX_STEPS"

agent.py, function run, as it stands in the course repo. On the left, the page that teaches you to read its trace.

Files you keep, not a login

  • The book as a 427-page PDF, an EPUB and a single HTML file.
  • The source as Markdown: chapters and exercises, readable in any editor.
  • A Python project managed with uv, with offline tests you can run without an API key.
  • Reference solutions with tests, added as chapters are verified.
  • The interview bank, the glossary, and the concept guides on context engineering and harness engineering.
  • Every update until v1.0 and beyond, free. Changes are listed in a public changelog.
The safe calculator code listing, from the book
The interview bank, with model answers
Exercise 1: run the loop and read the trace
Chapter 2 opening, with the Verification status: draft box
The status box that opens chapter 2.

Checked in public, one chapter at a time

The course was drafted with AI assistance. Every fact in it has been checked against official documentation. The author is now running every listing and exercise against the live API, in public.

Each chapter opens with a status box. "Draft" means the facts are checked but the code has not yet been run end to end. "Verified" means it has, with real transcripts, measured costs and reference solutions. Today every chapter is a draft. Early-access buyers get each verified chapter as it lands.

    The status of each chapter is listed in the syllabus above.

    Who is behind it

    Drafted with AI assistance (Claude), then run, verified and edited by the author. Independent: not affiliated with, endorsed by or sponsored by Anthropic.

    Manuel Lorenzo

    Software engineer in Amsterdam, trading as NullTwenty. More at manulorenzo.me and nulltwenty.com.

    $29 now, $49 at version 1.0

    Includes

    • The full course
    • PDF, EPUB, HTML, Markdown
    • The Python repo and tests
    • Reference solutions as they land
    • Free updates

    One purchase gets the full course, every format, the code and every future update. The early-access price holds until every chapter is verified.

    Not included

    API usage. You pay Anthropic directly for your own calls. Most exercises cost cents, and a few cost a few dollars. Set a spend limit first.

    Get early access, $29

    Checkout opens soon. Email support@nulltwenty.com to hear when it does, and read chapters 00–02 free in the meantime.

    Checkout runs through Paddle, which acts as the merchant of record and handles VAT and invoices.

    Questions before you buy

    What do I need to know already?
    Basic Python: variables, functions, loops, running a script. Chapter 03 fills the software-engineering gaps (classes, tests, async, packaging) if you need it.
    What does it cost to run the exercises?
    You need your own Anthropic API key. Most exercises cost cents, and a few cost a few dollars. The course has you set a monthly spend limit before your first call.
    Is it tied to Claude?
    The examples use the Claude API, but the course teaches the loop, context, retrieval, evals and security in a way that transfers to any model. Chapter 09 covers LangGraph and other frameworks.
    Will it get me a job?
    It gives you the skills that agent-engineering postings list, and a portfolio that proves them. It cannot give you production experience or guarantee an offer, and chapter 11 says so plainly.
    Was it written by AI?
    It was drafted with AI assistance. Every fact was checked against official documentation, and the author is running and verifying every chapter in public. The status box at the top of each chapter tells you where it stands.
    How long does it take?
    Four to six months at 10 to 15 hours a week. Experienced developers go faster.
    What about refunds?
    Full refund within 30 days of purchase, no questions asked. Email support@nulltwenty.com or reply to your Paddle receipt.
    Can I share it with my team?
    The text is licensed to one learner. The code is MIT. For team licences, contact support@nulltwenty.com.
    How will the course keep up with a field that changes monthly?
    Each chapter lists its fastest-ageing facts (model ids, SDK versions, prices). Those are re-checked every quarter, and updates are free.

    Start with the first three chapters, free

    Read Build in public, Foundations and The agent loop. By the end you will have written a working agent. Then decide.

    Free sample as PDF, 60 pages Free sample as EPUB

    Read chapters 00–02 free Get early access, $29