← See all modules
Bonus 1Full course

An AI agent

Give the AI tools and let it work in a loop, choosing its own steps, with limits.

5 lessons · 105 min

What you'll build

You turn Mini Macro into an agent. Instead of one question and one answer, the AI works in a loop: it looks up food names by barcode in a public database, works out what's left for today's goal, and suggests the next meal, choosing on its own which tools to use. And it stops when it's done, within the limits you set.

  • The loop, inside outAsk, run the tool, return the result, repeat. You write every part.
  • Your own toolsYou decide what the AI can do, with functions you write yourself.
  • With a handbrakeStep, cost, and time limits, with stopping checks on the server.

What you'll learn

  • What makes an agent different from a single API call
  • Defining tools the AI can call (tool use)
  • Writing the agent loop, from the first request to the final answer
  • When to stop: step, cost, and time limits
  • What an agent should never be allowed to do on its own
  • How tools, subagents, hooks, and skills appear in Claude Code

The lessons

0 of 5 lessons complete
  1. 1What is an agentA goal, tools, and a loop you control.🔒
  2. 2Tools for the AIDescribe what can be requested; validate what will run.🔒
  3. 3The agent loopKeep the history, run tools, and return each result with its ID.🔒
  4. 4Agents with limitsLimit calls, tools, time, and spend; test when things go wrong.🔒
  5. 5Agents in Claude CodeRecognize the loop, subagents, and hooks in the agent you already use.🔒