Tutorials / Disciplined AI-Assisted Development · Lesson 4 of 14

On this page

    Agentic AI: Giving the AI Hands

    In lesson 03 the AI wrote code for a note-taking app. In a chat, that code is only text on a screen, and you are the one who has to do something with it. Newer programs let the AI do that part itself. They are called agentic, and they change both what the AI can do and how careful you need to be.

    Our goal: understand what it means for an AI to act as well as answer, how the loop inside an agent works, and why that makes being specific, and checking the result, matter more.

    Here is the route:

    1. The burden of a chat: you are the hands, and you cannot leave.
    2. Giving the AI hands: the agent, and four tools.
    3. The loop.
    4. Where you meet agents.
    5. More hands, more risk.
    6. Other hands, and where this is going.

    We leave out installing and using a real agentic tool (lesson 10), how to add more tools, and the full development process (lesson 06).


    You are the hands

    Think about using the code from lesson 03. You copy it from the chat into your project. You run it. It fails, so you copy the error back into the chat. The AI suggests a change, and you copy that into the project, run it again, and so on.

    Every step goes through you. The AI never sees your project. It only sees what you remembered to paste. And you cannot leave: nothing happens until you carry the next message across, so you sit there for the whole job.

    Busy the whole time, or free in between Chat you AI you AI you AI you copy, paste, run, copy, paste. You are busy at every step. Agent task works alone ok? works alone check You give the task, step in when asked, and check at the end.

    A chat does have a good side that we will keep coming back to: you see everything that goes in and out, and nothing changes until you decide. It also has a cost. It is slow, and it ties you to the keyboard.

    What if the AI could open the file itself, run the tests itself, and see the result?


    Giving the AI hands

    To do that, the model needs a program on your side. On its own, a model can only read and write text, and it usually runs on the provider's servers, so it cannot see your computer at all. An agent is the program on your computer that bridges the gap. It talks to the model over the network, and it runs tools on the model's behalf. The model thinks. The agent reaches. (Picture a brain, and the body that carries out what the brain decides.)

    The model, the agent and your project The model only reads and writes text on the provider's servers, reached over the network The agent a program on your computer, with tools: read write edit bash Your project files, tests asks result runs result The model thinks. The agent reaches.

    What the picture shows:

    • The model asks. It writes a request in an agreed format, such as "read the file search.js". It never touches your files itself.
    • The agent acts. It runs the request on your computer and sends the result back as more text.
    • The agent holds the rules. It decides what the model may touch, and it can ask you first. Pi and Claude Code are agents in this sense, and each one calls a model.
    • A tool is a small ability the agent has. With tools, the AI works on your real project directly, with no copying back and forth.
    • What the agent reads goes to the model over the network, so think before you let it read something private.

    💡 A simplification: this picture is simplified, and real agents are not this tidy. Some tools run as separate programs, some models run on your own computer, and the details change quickly. Keep the idea, not the exact boxes.

    A coding agent can be small. One minimal agent, called Pi, has just these four tools, and others have more. Bash is the strong one, because it can run anything the terminal can run. (The terminal is the text window where you type commands. Lesson 10 introduces it.)

    This changes your role. The agent takes over the doing, so your time goes further. You do not disappear. You step in:

    • when it asks for approval,
    • when it drifts off course,
    • at the end, to check the result.

    The agent takes the hands, not the responsibility.


    The loop

    An agent works in a loop. The model decides what to do, the program runs a tool, the result goes back to the model, and the model decides again. It stops when the model thinks the job is done.

    The agent loop 1. Decide picks a tool 2. Check some agents ask you 3. Run runs the tool 4. Result back to the model round and round, until the model decides it is done

    A chat has a single step: you ask, it answers. An agent can take ten steps, reading, trying, failing and adjusting, before it answers you.

    Here is one run. You ask: "Summarize notes.md and email it to me." This agent has been given an email hand as well as the core four (more on extra hands below). It is an illustration drawn by hand, not output from a real tool.

    The picture is a storyboard of one run, in four scenes. Every scene uses the same small map: you, the agent, the model, and the files and email. The numbers follow the order of events.

    One run, in four scenes The task goes in You Agent Model Files, email 1 2 1. you give the task 2. the agent passes it on, with the list of its tools The model asks to read You Agent Model Files, email 3 4 5 3. the model asks to read notes.md 4. the agent reads the file 5. and sends the text back The model asks to send You Agent Model Files, email 6 7 8 9 6. the model asks to send an email 7. the agent asks you: OK to send? 8. you say yes 9. the agent sends it Done You Agent Model Files, email 10 11 12 10. the agent reports: sent 11. the model says: done 12. the agent tells you

    Real runs have more steps, and the messages between the agent and the model are structured data, not plain sentences. This picture is simplified, but the shape is the same.

    Notice what happened. The model never touched a file or sent an email. It asked, and the agent did the work. Before the email went out, the agent stopped and asked you (scene three). You gave the task once and approved once, and you did none of the copying. That is the appeal of an agent.


    Where you meet agents

    Agents come in many shapes, and what differs is mostly the window you see them through. Some are command-line tools that you run in a terminal. Some live inside an editor such as VS Code. Some do both.

    Where agents live In a terminal Pi Aider Claude Code Inside an editor Cline Copilot (agent mode) Claude Code The same agent can have two windows. Underneath, it is always a program talking to a model.

    The differences are mostly about taste and setup. They also differ in how much they ask before acting. Cline, for example, is designed to show you actions for approval, while Pi, as we saw, does not ask by default. This course uses Claude Code for its examples from lesson 10, and the process works with the others. These products change quickly, so check each one's current documentation before you choose.


    More hands, more risk

    The loop removes the burden, and it is also where the extra risk comes from. You can walk away from the carrying, but not from the responsibility.

    Think of the difference between a consultant and a contractor. A consultant advises, and you do the work, so a vague brief gets you vague advice that you can ignore. A contractor does the work in your house, so a vague brief ("redo the kitchen") may mean they knock down a wall.

    A consultant and a contractor Chat: a consultant "Redo the kitchen." advice you can ignore You do the work. A wrong idea costs you little. Agent: a contractor "Redo the kitchen." knocks down a wall So: a clear brief, approvals for risky jobs, an inspection.

    Three things change.

    1. It can change things. A chat can only suggest. An agent can edit files, run commands and, depending on its tools, do far more.
    2. Mistakes compound. In the loop, every result becomes part of what the model reads next. If step 2 is wrong, steps 3 to 6 are built on it. By the time you look, the error may be buried under good-looking work.
    3. It moves faster than you read. Ten steps can happen while you look away.
    One wrong step, two situations Chat ok wrong you read it and decide Agent 1 2 3 4 5 each step builds on the wrong one

    Both lessons so far lead here. In lesson 03, a vague request got you the AI's most likely interpretation. In a chat, that is a wrong answer you can read and ignore. In an agent, it can become wrong changes, and the next steps build on them. So being specific matters more, not less, when the AI can act.

    Look at the check step in the loop picture. Some agents ask before a risky action, and some, such as Pi, do not ask by default. It is worth knowing which kind yours is.

    Some agents ask first, some do not Asks first Decide Ask you Run Does not ask (by default) Decide Run no question

    This is not a reason to avoid agents. It is the reason for the habits you will learn later in the course: permissions that ask before anything risky, work in small steps, tests that really run, and a person who reads every change before it goes in. The agent is useful because it acts. The process is what keeps its mistakes small.

    ⚠️ A common mix-up: "The agent ran the tests and they passed, so it is right." Tests only prove what they test. They can be wrong, or missing, or written by the same agent to match its own mistake. Lessons 12 and 13 come back to this.


    Other hands, and where this is going

    Read, write, edit and bash are the core. Agents can be given more hands:

    • Email: read a message, draft a reply, send it.
    • A browser: open a page, see the error on it, click through, and help you debug.
    • A calendar: look for a free slot and book it.
    • Images and video: bash can run command-line tools that cut, convert and resize them.
    Core hands, and more hands Core hands read write edit bash The agent More hands email browser calendar images, video

    You may see the name MCP (the Model Context Protocol). It is a common standard for plugging extra tools like these into an agent, so each one does not need its own custom wiring. We only need the name here.

    This is also where the training from lesson 03 comes in. Model builders now train models specifically for agent work, with examples of tool use and multi-step tasks. That is one reason agents have improved quickly. With the right tools, an agent can do a surprising amount of work for you, and what you can ask it to do is now limited mostly by what you can imagine, and what you can safely allow.

    The wider the reach, the more care you read it approvals,small steps,read the result the same habits,stricter Chat Four core hands More hands The wider the reach, the more the habits matter.

    That last part is the point. Every new hand is also a new way to go wrong. An email goes to the wrong person. A browser clicks the wrong button. Bash alone can delete files. The wider the AI's reach, the more the habits above matter: be specific, let it ask before risky actions, work in small steps, and read the result. That is why this course teaches a few habits first, and then a process. The habits start in the next lesson.


    Recap

    • In a chat, you are the hands. You carry everything across, and you cannot leave.
    • A tool is a small ability a program gives the AI. The four core ones are read, write, edit and bash. With them the AI works on your real project directly.
    • An agent is the program on your computer that talks to a model over the network and runs tools for it. The model only produces text. It writes a request for a tool, and the agent runs the tool and returns the result.
    • An agent works in a loop: decide, check, run, result, decide again.
    • Agents live in a terminal, inside an editor, or both. It is the same idea in a different window.
    • The agent takes over the doing, so your time goes further. You still step in when it asks, when it drifts, and at the end to check. Being able to walk away is the appeal and the risk. The agent can change things, mistakes compound, and it moves faster than you read.
    • Agents can be given more hands (email, a browser, a calendar, images and video). Each one widens what the AI can do, and what can go wrong.

    Questions to think about

    The answers are left out on purpose. Try them in your own words first.

    1. In a chat, why can you not leave the AI to work, and what changes with an agent?
    2. Who actually runs a tool when an AI "edits a file": the model or the program around it? Why does that matter?
    3. Why is bash the most powerful of the four core tools?
    4. Why is a wrong step 2 in an agent worse than a wrong answer in a chat?
    5. Every new hand makes the AI more useful, and riskier. Why does that make a repeatable process more important? (Lesson 06 answers this.)

    Next lesson: common ways of getting better AI results, in a chat or with an agent: making yourself clear, and five checks that show how it understood you.

    ← Getting Better AI Results by Being SpecificCommon Ways of Getting Better AI Results →