Loading video player…

How a Model Becomes an Agent

A language model only predicts text. A coding agent turns that text into actions in your project. In this video, you watched one real session as a loop of tool calls and results.

Key Points

  • In a chat, you’re the loop. You paste files into the request, copy the code the model returns into a file, run it, and paste back any errors. The model never sees your folder.
  • An agent program does those steps. It runs on your machine, inside your project folder, between you and the model. With your task, it sends a list of the tools it offers, such as listing files, reading a file, writing a file and running a command.
  • A tool call is a reply that asks for a tool. Instead of answering, the model’s reply can ask for a tool, with the details filled in. The agent program runs it for real and adds the result to the next request.
  • The result decides the next step. The loop repeats until the model replies with an answer, or stops to ask you because the model has a question or the program wants your approval for a write or a command. The session in the video never stopped to ask. Yours may, depending on your settings.
  • The program carries the session. A model keeps no memory between calls, so the agent program sends your task, each tool call and its result with each request. In a short session like this one, that’s all of them.
  • Its reach comes from its tools, its folder and what you tell it. A file in another folder is almost certainly left alone when the agent’s file list doesn’t show it and your task doesn’t name it. Your browser and a terminal in another window aren’t in the request either.
  • The agent works in its folder, but it can reach past it. In the video’s session, the second tool call also searched the folder above, and every folder in it, for a file of instructions, unasked. How far an agent may reach depends on your agent’s settings, which you’ll choose in a later lesson.

The Session, Step by Step

The session in the video was recorded in December 2026 and redrawn as plain steps. Agents and their tool sets change, but the loop’s shape doesn’t. Your agent’s session would differ in its details. It worked in the game group’s warm-up folder, which held sound-sheet.md (the letters, with the hard consonants k, t, d and g, and the two sound rules) and words.txt. This was the task:

Language: Text
Write a Node script, check-words.js, that checks every word in
this folder's word list against the sound rules, and run it to
show which words break a rule.

The model asked for four tool calls before it answered:

  1. List the files: sound-sheet.md and words.txt came back.
  2. Read both files (and search the folder above for a file of instructions): the sound sheet and the five words came back.
  3. Write check-words.js: the agent program created the file, on disk, in the folder.
  4. Run the script: its output came back.

Here’s what the run printed:

Language: Text
nolem: Rule 1: Every word ends in a vowel.
sadku: Rule 2: No two hard consonants in a row.
Checked 5 words: 2 failed, 3 passed.

With that result in the next request, the model replied with an answer instead of a tool call: two of the five words break a rule. That ended the loop. sadku breaks the second rule because d and k are both hard consonants.

A coding agent is a model with tools, in a loop, inside your project folder. Next is Exercise: Run a Toy Agent Loop, the course’s first coding exercise. It runs in your browser, with a stand-in model. You’ll work out what a pretend session on the game group’s folder can and can’t reach.

00:00 A model only predicts text. So how does a coding agent read your files and run your scripts? One real session shows how. The game group’s warm-up folder holds two files: the sound sheet, with its two rules, and a list of five words.

00:16 Which words break a rule? With a chat, you’d paste both files into your request. The model replies with code, as text. You copy it into a file, run it, and paste back any errors.

00:31 Every step that touches your folder is yours. The model never sees the folder.

00:38 A coding agent hands those steps to a program. The agent program runs on your machine, inside your project folder, between you and the model. With your task, it sends the model a list of the tools it offers, such as listing files, reading a file, writing a file, and running a command.

00:58 Now the model’s reply can ask for a tool, with the details filled in, instead of answering. That request is called a tool call.

01:08 Here’s one real session, redrawn as plain steps. Yours would have the same shape and different details.

01:15 Your task goes first: write a Node script that checks every word in the list against the sound rules, and run it. The model hasn’t seen the folder yet, so its first reply asks to list the files.

01:29 The agent program lists them, and two names come back. Those two names decide the next step. The model asks to read both files, and back come the sound rules and the five words.

01:42 With the rules and the words in the next request, the model asks to write a new script file. The agent program creates it, on disk, in your folder. Next, it asks to run the script.

01:55 The output comes back: nolem breaks the first rule, and sadku breaks the second.

02:01 Then the model replies with an answer instead of a tool call: two of the five words break a rule. That cycle is the agent loop. The model asks for a tool call, the program runs it, and the result goes into the next request.

02:16 The model keeps no memory, so the program sends your task, each tool call and its result every time. The loop ends when the model answers. It stops to ask you when the model has a question or the program wants approval for a write or a command.

02:32 This run never asked.

02:36 That session also shows the agent’s reach. The model worked from what its tools returned and what your task said. Say the group keeps newer words in another word list, in a different folder.

02:48 You give the agent the same task. Your turn: pause the video and predict. Will the agent check the words in that other file?

03:02 Almost certainly not.

03:05 Its file list showed only this folder, and your task doesn’t name that file, so nothing points to it. But the folder isn’t a wall. In this session, the second tool call also searched the whole folder above for a file of instructions, unasked.

03:21 How far it may reach is a setting you’ll choose in a later lesson. The same goes for your browser or a terminal in another window. If no tool returns it and you didn’t say it, it isn’t in the request.

03:36 A coding agent is a model with tools, in a loop, inside your project folder.

03:42 Each result decides the next step, until the model answers or the loop stops to ask you. What the agent can find out or change comes from its tools, its folder and what you tell it.

03:55 Next is Exercise: Run a Toy Agent Loop, the course’s first coding exercise. It runs in your browser, with a stand-in model. You’ll work out what a pretend session on the game group’s folder can and can’t reach.

Become a Member to join the conversation.