Module 3: From Chatbots to Coding Agents
Module 3: From Chatbots to Coding Agents
Description
Modules 01 and 02 gave you the context: the paradigm changed, and LLMs are the engine behind that change. But there's a leap that the previous modules mentioned without explaining in depth: how do we go from a model that generates text to an agent that reads files, runs commands, and modifies your project?
That leap is the topic of this module. And it's not an incremental leap — it's a change of category.
A chatbot like ChatGPT answers questions. A coding agent like Claude Code, Cursor, or Copilot Agent acts on your codebase. The difference isn't cosmetic. It's the difference between a cookbook and a chef in your kitchen: both know how to cook, but only one chops the ingredients, lights the fire, and tastes the broth.
By the end of the 5 capsules, you'll be able to define a coding agent by its 4 components, trace the agentic loop in a real session with any tool, and distinguish a chatbot from an agent with technical judgment — not with marketing.
Where We Are in the Guide
Module 01: The paradigm shift ✅ Completed
Module 02: How LLMs work ✅ Completed
Module 03: From chatbots to coding agents ← YOU ARE HERE
Module 04: The agent's toolbox
Module 05: The developer as director
Module 06: The fundamental workflow
Module 07: Project: Build a mini-agent
This is Module 03 of 7 — the bridge between the theory (how models work) and the practice (how coding agents use those models to work on your code).
The Evolution in Three Acts
The story of AI for code has three distinct moments:
ACT 1: THE CHATBOT (2022-2023)
→ Question-answer about code
→ "How do I do X in Python?"
→ The developer copies, pastes, adapts
→ The model doesn't see your project
→ Stateless: each question starts from zero
ACT 2: THE ASSISTANT (2023-2024)
→ Smart autocomplete in the editor
→ Contextual suggestions (it sees the open file)
→ Reactive: it suggests as you type
→ Limited: only the current file, not the project
→ Classic Copilot is the canonical example
ACT 3: THE AGENT (2024-2026)
→ Observe → Think → Act → Observe
→ Reads multiple files, runs commands, modifies code
→ Proactive: it decides what to do, not just suggests
→ Multi-step: it solves complex tasks in several steps
→ Claude Code, Cursor Agent, Copilot Agent
What changed between each act
Chatbot → Assistant:
+ Context of the current file
+ Integration in the editor
= Still reactive, still limited
Assistant → Agent:
+ Access to the whole codebase (not just the file)
+ The ability to execute actions (not just suggest)
+ Autonomy to decide what to do
+ An iterative loop (observe the result → adjust)
= A CHANGE OF CATEGORY
One Task, Two Tools: The Bug in /payments
To make the difference between chatbot and agent concrete, consider a typical task:
"There's a bug in the
/paymentsendpoint. It's returning 500 when the amount exceeds 1000 USD. Find it and fix it."
This task is attempted with two different approaches:
Approach A: ChatGPT (chatbot)
00:00 → Developer opens ChatGPT.
"I have a bug in my /payments endpoint. It returns 500 with
amounts > 1000."
00:30 → ChatGPT asks: "Can you paste me the endpoint's code?"
01:00 → Developer copies the controller file and pastes it.
02:00 → ChatGPT suggests 4 possible hypotheses. But it can't see
the validator, or the model, or the tests. It asks for more code.
08:00 → Developer pastes validator + model + 2 more files.
15:00 → ChatGPT proposes a solution based on one hypothesis.
Developer copies the snippet to their editor, pastes it, runs the tests.
22:00 → Tests are still red. The hypothesis was incorrect.
35:00 → Developer does several more rounds of copy-paste-test.
45:00 → Bug fixed. The developer is the human agent connecting
the model to the system.
Approach B: Claude Code or Cursor Agent (coding agent)
00:00 → Developer in their terminal: "There's a bug in /payments with
amounts > 1000. Find it and fix it."
00:15 → The agent decides what to do (autonomy):
→ Reads the /payments endpoint (reads files directly)
→ Reads the validator it uses
→ Reads the Payment model
→ Runs the existing tests
→ Sees which one fails with amount > 1000
01:30 → The agent identifies the bug: the validator uses Decimal but
the model receives int, there's a silent overflow.
02:00 → The agent edits the file with the fix.
03:00 → The agent runs the tests. They pass.
04:00 → The agent reports: "Bug fixed. The validator was converting
Decimal to int before passing it to the model. The tests pass."
06:00 → Developer reviews the change, commits.
Same underlying model (an LLM). Same problem. Radically different results.
Why? The chatbot only knows how to generate text. The agent can:
- Read files without you pasting them (Capsule 04 — tool calling)
- Decide what to read without you telling it (Capsule 02 — autonomy)
- Iterate in a loop observing results (Capsule 03 — agentic loop)
- Reason out loud before acting (Capsule 04 — ReAct pattern)
- Modify your project directly (Capsule 04 — tool calling)
The 5 capsules of this module give you the mental model to understand — and then build, in Module 07 — the system that makes Approach B possible.
Why This Module Matters
If you don't understand how an agent works, you can't use it well
ANALOGY:
You can drive a car without understanding the engine.
But you can't drive a race car without understanding:
→ How it responds at speed
→ What happens when you brake in a curve
→ When the engine has traction and when it skids
Coding agents are the race car:
→ You can use them without understanding them (vibe coding)
→ But to use them WELL you need to understand:
→ What they can do (tools)
→ How they reason (agentic loop)
→ When they fail (limitations)
→ How they direct their own work (ReAct)
The data: agent mode is the new norm
Some numbers that contextualize why this module is a priority, not optional:
| Metric | Value | Source |
|---|---|---|
| Adoption of Agent Mode among developers (vs chat-only) | 64% (Oct 2025) | GitHub Octoverse 2025 |
| Tasks solved in a single interaction by coding agents | 38% | Cursor Engineering Blog 2026 |
| Developers who use at least one coding agent weekly | 62% | Stack Overflow Survey 2025 |
| Fortune 500 companies with formal adoption of coding agents | 71% | Deloitte Tech Trends 2026 |
The paradigm of "pasting code into a chatbot" is being replaced by agents integrated into the development flow. If you don't understand how they work, you're stuck in the previous paradigm.
The direct connection with the project
In Module 07, you'll build a mini coding agent. To build it, you need to understand three things this module explains:
- What an agent is — the technical definition you'll implement (Capsule 02)
- The agentic loop — the cycle your mini-agent will execute (Capsule 03)
- Tool use — the functions your agent will be able to invoke (Capsule 04)
Prerequisites
Required knowledge:
- ✅ Module 02 completed (how LLMs work: tokens, context window, next-token prediction)
- ✅ Having used some coding agent at least once
Recommended:
- ✅ Access to a coding agent for the observation exercises (Claude Code, Cursor, Copilot — any of them)
Module Roadmap
Capsule 01 — Module introduction (this capsule)
Context and motivation. The evolution from chatbot to agent. The scenario that anchors the module.
Capsule 02 — What an agent is
A precise definition: LLM + tools + loop + autonomy. The chatbot → assistant → agent spectrum. What Claude Code, Cursor, and Copilot Agent have in common.
Capsule 03 — The agentic loop
The observe → think → act → observe cycle explained step by step. Stop conditions. Single-turn vs multi-turn. How the agent decides when to finish.
Capsule 04 — Tool use and the ReAct pattern
Tool calling as a technical breakthrough. How the LLM "decides" which tool to use. The ReAct pattern (Reason + Act). Chain-of-thought reasoning applied to code tasks.
Capsule 05 — Coding agents vs chatbots
A direct, technical comparison. Why ChatGPT isn't a coding agent. A comparison table. Implications for the way you work.
Progression map
Capsule 01 (this) → The evolution: from text to action
Capsule 02 → Technical definition of "agent"
Capsule 03 → The loop that makes them work
Capsule 04 → Tools and reasoning
Capsule 05 → Chatbot vs agent: the difference that matters
Difficulty: ⭐⭐ ────────────────────────▶ ⭐⭐⭐
What You'll Achieve in This Module
By completing the 5 capsules:
- Explain precisely what a coding agent is (not just "AI that codes")
- Describe the agentic loop step by step — the mechanism every agent shares
- Understand tool calling — how a text model "uses tools"
- Distinguish a chatbot from an agent with technical judgment, not marketing
- Prepare the foundation for the Module 07 project
The before and after
BEFORE the module:
→ "A coding agent is AI that writes code"
→ "Claude Code and ChatGPT are more or less the same thing"
→ "I don't know how the agent decides what to do"
→ "Tools, loop, ReAct... they're buzzwords"
AFTER the module:
→ An agent = LLM + tools + agentic loop + autonomy
→ Chatbot and coding agent are different categories
→ I understand the observe → think → act → observe cycle
→ I know how tool calling and the ReAct pattern work
What This Module Does NOT Cover
| Topic | Where it's covered |
|---|---|
| Specific tools (file R/W, shell, search) | Module 04 |
| How to direct the agent (mental models) | Module 05 |
| The R→P→E→V workflow | Module 06 |
| Implementing a real agent | Module 07 |
| LLMs in depth (tokens, context, etc.) | Module 02 |
This module is the bridge: from "how the model works" (M02) to "how the agent works" (M03), which then leads to "what tools it has" (M04) and "how I direct it" (M05-06).
Key Concepts You'll See
| Concept | What it means | Capsule |
|---|---|---|
| Agent | LLM + tools + loop + autonomy | 02 |
| Agentic loop | Observe → Think → Act → Observe | 03 |
| Tool calling | The LLM requests to run a function | 04 |
| ReAct | Reason + Act: think before acting | 04 |
| Chain-of-thought | Step-by-step reasoning | 04 |
| Autonomy | The agent decides what to do without explicit per-step instruction | 02-03 |
| Spectrum | Chatbot → Assistant → Agent | 02, 05 |
Traps to Avoid While Taking This Module
Five predictable misunderstandings worth anticipating.
1. "If it says 'agentic' in the marketing, it's an agent"
No. "Agentic" has become a marketing term applied to products with very different levels of autonomy. Some products called "agents" are barely assistants with a bit more context. Capsule 02 gives you the 4 technical components that separate a real agent from an assistant with good UX. Use them as your criterion.
2. "Tool calling means the LLM runs code directly"
No. The LLM only returns text that says "I want to use tool X with these arguments." The one that executes the tool is the system that orchestrates the model (the harness). This distinction matters because it explains why the agent can request tools that don't exist, fail to execute them, or be blocked by permissions. Capsule 04 develops it in detail.
3. "More autonomy = better agent"
Not always. More autonomy means more decisions made without your supervision, which is useful for clear tasks and dangerous for ambiguous tasks. An agent that makes 30 decisions in 5 minutes without checks can deliver 30 errors quickly. Capsule 05 connects this with Module 05 (the developer as circuit breaker).
4. "I want the official definition of an agent"
There isn't one. "Agent" describes a spectrum, not a binary category. Anthropic, OpenAI, Google, and academia have slightly different definitions. What matters isn't the canonical definition — it's that you know how to identify the functional components (LLM + tools + loop + autonomy) in the product in front of you. If all four are there, it's an agent; if one is missing, it's something else.
5. "Capsule 04 (ReAct) sounds academic, I'll skip it"
It's the capsule that connects "the agent thinks" with "the agent acts." Without ReAct, you don't understand why the agent sometimes "explains before doing" and sometimes dives straight in. If you skip it, capsule 05 (chatbot vs agent) loses its technical explanation. Read it even quickly — the concepts are simple once you see them applied.
Diagnosis: What's Your Starting Point?
Five questions that calibrate you before starting. Answer mentally and compare at the end of the module.
Question 1: If you had to explain to a non-technical colleague the difference between ChatGPT and Claude Code, what would you say?
If your answer was "ChatGPT is chat, Claude Code is for code": you're missing the concept of an agent. Claude Code and ChatGPT can use the same underlying model — the difference is that Claude Code has tools, a loop, and autonomy. Capsule 05 formalizes it.
If you said something like "one only generates text, the other acts on files": you're on the right track. The module gives you the technical vocabulary for that intuition.
Question 2: Do you know what the "agentic loop" is and could you draw it?
If not: Capsule 03 gives it to you. It's the central concept of the module. Without understanding it, you can't implement the Module 07 project.
If yes: can you explain what makes the loop end? When is it single-turn vs multi-turn? If you hesitated, Capsule 03 formalizes those details for you.
Question 3: When an agent "decides" which tool to use, who really decides: the model, the system, or the user?
This question separates whoever understands tool calling from whoever uses it by intuition. The short answer: the LLM produces a structured message requesting a tool with arguments; the system (harness) executes or rejects it. Capsule 04 develops this protocol.
Question 4: Have you seen an agent enter an "infinite loop" or make many bad decisions in a row? Why do you think it happened?
If you've seen the pattern: note a case. Capsule 03 explains the stop conditions and why they sometimes fail. Capsule 05 explains why an agent without good calibration amplifies errors.
If you haven't seen it: you probably haven't let an agent work autonomously long enough. The Module 07 project will give you that context.
Question 5: What do you think is the technical difference between an agent and a chatbot that calls functions?
Hint: a chatbot with function calling has LLM + tools, but it's missing the iterative loop (observe → think → act → observe) and the autonomy to decide what to do without explicit per-step instruction. Capsule 02 develops this distinction.
If you hesitated on 3 or more: this module is a priority. If you answered them all with confidence, use it as a review and focus on Capsule 04 (ReAct), which tends to have gaps even in experienced developers.
How to Work Through This Module
- Capsule 02 defines. It establishes the precise terminology you'll use for the rest of the guide.
- Capsule 03 is the most technical. The agentic loop is the central concept — understand it well.
- Capsule 04 connects two ideas. Tool calling + ReAct = how the agent thinks AND acts.
- Capsule 05 is practical. It helps you calibrate expectations: what to ask a chatbot vs an agent.
Estimated time:
Capsule 01 (this) → 5 min
Capsule 02 → 10 min
Capsule 03 → 12 min
Capsule 04 → 12 min
Capsule 05 → 10 min + exercises
Total: ~50-60 minutes
Evidence of Success
Before moving on to Module 04 (The agent's toolbox), you should be able to:
- ✅ Define a coding agent by naming its 4 components (LLM + tools + loop + autonomy)
- ✅ Draw the agentic loop and explain when it ends
- ✅ Explain tool calling without marketing: who requests, who executes, who returns the result
- ✅ Identify the ReAct pattern in a real transcript from your favorite coding agent
- ✅ Distinguish a chatbot, an assistant, and an agent with technical judgment (not by the brand)
- ✅ Articulate why an agent can fail in ways a chatbot can't (loops, bad decisions, side effects)
If any of these aren't met at the end, go back to the corresponding capsule. Module 04 (the specific toolbox) and Module 07 (building a mini-agent) assume that the 6 points are in place.
Summary
This module transforms your understanding from "AI that generates text" to "an agent that acts on your codebase."
What it covers:
- The technical definition of a coding agent (the 4 components)
- The agentic loop (observe → think → act → observe)
- Tool calling and the ReAct pattern
- The real difference between a chatbot, an assistant, and an agent
What it produces:
- Technical vocabulary to distinguish a real agent from a product with "agentic" marketing
- The ability to trace the agentic loop in any tool you use
- A direct conceptual foundation for the Module 07 project
Why it matters:
- You can't direct what you don't understand
- Module 07 will ask you to implement an agentic loop
- Knowing how the agent reasons is the foundation for directing it well (Modules 05-06)
- The difference between Approach A and Approach B in the opening scenario is exactly what this module teaches
Next capsule: 02 — What an agent is. We start with the precise technical definition: the 4 components that separate a real agent from anything else.
Additional Resources
- Anthropic: Building Effective Agents — Anthropic's perspective on agents and design patterns
- Yao et al.: ReAct Paper — The original ReAct pattern paper (synergizing reasoning and acting)
- Lilian Weng: LLM Powered Autonomous Agents — An excellent technical survey on agent architectures
- GitHub Octoverse 2025: AI Adoption — Data on Agent Mode adoption and AI tools on GitHub
- MIT Missing Semester 2026: Agentic Coding — A practical academic perspective
- Agentic Coding: How Agents Work — Developer-oriented documentation