Build your first agent
From empty repo to tool-loop in one hour - a guided walkthrough.
What you'll be able to do
You'll have a running agent that calls a single tool, processes the result, and answers. That's the smallest unit of a real agent - and everything else builds on top.
What you need
- Node 22 or newer
- An Anthropic API key (Sonnet 4.6 is enough)
- 60 minutes without interruption
The loop
An agent is fundamentally a while(true) with three phases:
- Observe - pack everything that has happened so far into the prompt.
- Decide - the LLM decides whether to call a tool or respond.
- Act - if tool-call: execute and append the result. Otherwise: done.
We'll build exactly that over the next hour - step by step.
This section belongs to the Pro tier. You get access to full code, deeper explanations, and rabbit-hole material.
See tiers →