Explainstuff.mebeta
All concepts
AI-Driven Developmentbeginner6 min

What is an Agent?

An agent is a model given a goal and tools, running in a loop until the job is done.

Ask a language model a question and it hands back text. Useful — but it can't check whether its answer is right, look something up, or change anything. It guesses once and stops. An agent is what you get when you let that same model keep going.

One-shot call vs. an agent

A one-shot call is a vending machine: prompt in, text out, done. An agent is more like an assistant you've handed a goal. It can pick up a tool, use it, look at what came back, and decide what to do next. The difference isn't a smarter model — it's giving the model the ability to act and to react to what it sees.

The agent loop

Every agent runs the same cycle. Given a goal, the model decides on an action, takes it (usually by calling a tool), then observes the result. That observation goes back into the model, which decides the next action. The loop repeats until the goal is met — then it stops. The diagram below traces one trip around that loop.

The agent loop
loop
Goal
Model decides
Tool acts
Observe result
Done
Decide, act, observe, repeat. The packet circles back to the model each turn — the loop keeps going until the goal is met, then exits to Done.
Note

In our stack — Claude Code is the harness that runs this loop. Anthropic's Claude model is the brain that decides each action; the loop keeps going — read a file, run a test, edit code — until your task is finished.

When you want an agent

Reach for an agent when the work is multi-step and the next step depends on the last result — fixing a failing test, researching across many sources, refactoring a codebase. If you can't script the steps in advance because you don't yet know what you'll find, that's exactly the gap an agent fills.

Key takeaways

  • A plain model call returns text; an agent takes actions in the world.
  • An agent = a model + a goal + tools + a loop that repeats until done.
  • Each turn the agent decides an action, takes it, observes the result, and decides again.
  • Agents handle multi-step, open-ended work where the next step depends on the last result.

Keep going