What is an agent?
A short explainer for my post on running a team of AI agents.
Each agent is one copy of Claude Code running in a terminal window. Claude Code is Anthropic's program for writing code with Claude. A program like this is often called a harness. The AI model on its own can only read text and write text. The harness gives it the capability to do things on a computer.
It works as a loop:
- Claude Code sends the model everything: its instructions and the whole conversation so far.
- The model replies. Either it writes some words, or it asks to use a tool.
- Claude Code checks the request is allowed, then runs it.
- The result, such as a file's contents or a command's output, is added to the end of the conversation. Then it goes round again.
- When the model replies with only words instead of asking for a tool, the job is finished, and the agent stops.
One job can take hundreds of rounds. The agent only knows what is in its conversation, which consists of a rulebook, a brief and a startup note, plus any previous context. It's also why a long conversation gets expensive: every round sends the whole thing again.
Claude Code lets you plug your own scripts into the loop. These are called hooks. This team uses four: one when the agent starts (the startup note), one before each command (the guard), one on every step (a status card) and one when the agent tries to stop (the stop gate, which checks whether it should really stop or go back to work).
The agents run with Claude Code's permission prompts switched off, because a prompt asking "may I run this?" stops all work when nobody is at the keyboard. Instead, the guard hook blocks the risky commands, and the rulebook says each agent only changes its own repository.