Most "build your first agent" tutorials start with a framework and four new vocabulary words before you've written anything that does something. This one skips that, it's just the goal, tool call, observe, decide loop, built by hand, no framework.
Step 1 - Define the goal, not the steps
Bad: "Read note-1.txt, then read note-2.txt, then summarize each one."
Good: "Look at every file in ./notes. For each one that describes an unresolved question, draft a short reply and save it to ./drafts with the same filename."
Step 2 - Give it exactly two tools
- read_file(path)
- write_file(path, content)
Step 3 - Add the loop
A hard step limit matters more than picking the "best" model. Without one, a small misunderstanding early in the run can turn into a long, expensive loop of the model trying to correct a mistake it doesn't realize it made.
Step 4 - Log every step
The first time an agent does something unexpected, the log is the only way you'll figure out why.
Step 5 - Run it and read the log, not just the output
The full walkthrough with code, plus the follow-up on frameworks (LangGraph vs CrewAI vs AutoGen vs Claude Agent SDK), is here:
Top comments (0)