11 11. AI-Assisted Development: From Chatbots to Coding Agents
In just a few years, AI help for programmers grew from chatbots that write snippets into coding agents that work inside your project. This page explains what changed, what makes a tool an “agent”, and the habits that separate careful AI-assisted work from guesswork. It also explains why the rest of this book teaches the command line, Git, and the web.
11.1 From chatbots to coding agents
As of Oct 6, 2026 · Official docs: Claude Code overview
AI help for programming comes in four stages. Each stage lets the AI see more of your project and do more on its own. The stages overlap in time (GitHub Copilot’s autocomplete appeared in 2021, before ChatGPT was released in late 2022), and all four are still in use today.
| Stage | What the AI sees | What the AI does | Your job |
|---|---|---|---|
| 1. Chat, copy, paste (e.g. ChatGPT, claude.ai) | Only what you paste into the chat | Writes code in a chat window | Copy the code into your files, run it, paste any errors back |
| 2. Autocomplete (e.g. GitHub Copilot) | The file you are typing in | Suggests the next line or function as you type | Accept each suggestion (usually with Tab) or ignore it |
| 3. AI editors (e.g. Cursor) | Many files in your project | Proposes changes across several files | Accept or reject each change, then run and test the code |
| 4. Coding agents (e.g. Claude Code) | Your whole project, plus the output of the commands it runs | Reads files, edits them, runs commands such as tests, checks the results, and repeats | Give clear instructions, decide what it may do without asking, review the result |
The big jump is stage 4. In stages 1-3, you run the code, read the error, and report back to the AI. An agent closes that loop itself. Today, many editors and chat apps include agents too; the next chapter, The AI Coding Tool Landscape, surveys the current tools.
11.2 What makes a tool an agent
As of Oct 6, 2026 · Official docs: How Claude Code works · Glossary
An agent is an AI system that can take actions, look at what happened, and decide what to do next. A coding agent has three ingredients:
- A large language model (LLM) that reads the situation and decides the next step (see How Large Language Models Work).
- Tools: actions the model is allowed to request, such as “read this file”, “edit this file”, “run this command”, or “search the web”. The model only asks; the program around it carries out the action and sends back the result.
- A loop: the model keeps choosing actions and reading the results until the task is done or it needs your input.
You: "The signup test is failing. Please fix it."
|
v
+-> The model decides the next step ---------> Tool call: run the tests,
| read a file, edit a file ...
| |
+---- The result goes back to the model <--------------+
(repeat until done, then report back to you)
The program that wraps the model, supplies its tools, runs them, and manages what the model sees is called the harness. As Anthropic’s glossary puts it, Claude Code is the harness and Claude is the model inside it. Asked to “fix the failing tests”, Claude Code might run the test suite, read the error output, search for the relevant files, read them, edit the code, and run the tests again to verify the fix. You can interrupt and redirect it at any point.
Because an agent runs real commands on your computer, it needs rules about what it may do without asking you. In Claude Code these rules are called permission modes (see Permissions, Modes, and Safety).
11.3 Vibe coding vs. AI-assisted engineering
As of Oct 6, 2026 · Official docs: Best practices for Claude Code
In February 2025 the AI researcher Andrej Karpathy coined the term vibe coding: you describe what you want, accept whatever the AI writes without reading it (“forget that the code even exists”, in his words), and judge the result only by whether the app seems to work. He called it “not too bad for throwaway weekend projects” (background).
Vibe coding is fine for a quick experiment. For anything other people will use, it is risky: nobody understands the code, nothing checks that it is correct, and security holes go unnoticed. AI-assisted engineering keeps the speed but adds discipline:
| Vibe coding | AI-assisted engineering | |
|---|---|---|
| What to build | The AI fills in the gaps | You write it down first (a spec) |
| Reading the code | Rarely | You review every change |
| “It works” means… | It seemed fine when you clicked around | Tests and other checks pass, and you tried it yourself |
| Safety net | Hope | A Git commit after each working step |
| Good for | Throwaway prototypes, exploring ideas | Anything real: class projects, products, client work |
11.3.1 Spec-driven development
A spec (short for specification) is a short document that says what to build before any code is written: who it is for, what it must do, what is out of scope, and how you will check that it works. Product managers call a business-oriented version a PRD (product requirements document). In spec-driven development you write the spec first, then have the AI build from it one piece at a time. The Claude Code docs suggest a handy trick for larger features: ask Claude to interview you about your idea, then have it write the spec to a file such as SPEC.md.
A spec does not need to be long. Here is one for a small club app:
# Spec: Club Event Sign-up (version 1)
Who it's for: members and organizers of the Finance Club (about 60 people)
Problem: sign-ups happen in a group chat and get lost
Must have:
1. A page that lists upcoming events
2. A sign-up form for each event (name, email)
3. An organizer page, behind a password, that shows who signed up
Out of scope for now: payments, email reminders
Done means:
- A new sign-up appears on the organizer page
- The form rejects an email address without an @
- Visitors who are not organizers cannot see the sign-up list
Notice the last section: each line is something you (or the agent) can actually check. That is what turns “build me an app” into work an agent can verify.
11.3.2 Context engineering
A model only knows what is in its context window, the text it can see at once (see How Large Language Models Work). Context engineering means choosing that text on purpose: the spec, a project instruction file (such as CLAUDE.md or AGENTS.md, which the agent reads at the start of a session), the files that matter, the exact error message, a screenshot. With too little context the AI guesses; with too much it gets distracted. The Claude Code docs warn that performance drops as the context window fills up. Anthropic’s engineers describe context engineering as curating “the optimal set of tokens” for the model (Effective context engineering for AI agents).
11.4 A disciplined workflow
As of Oct 6, 2026 · Official docs: Best practices for Claude Code
Whatever tool you use, careful AI-assisted work follows the same cycle. Anthropic’s advice for Claude Code is to explore first, then plan, then code, then commit, and above all to give Claude a way to verify its own work. This book uses five steps:
- Plan. Decide what you want (write a spec for anything big). Let the agent read the relevant code and propose a plan before it changes anything, and correct the plan.
- Build. Have the agent implement one small, well-defined step.
- Verify. Give the agent a check it can run, such as tests, a build, or a screenshot of the page in a browser, and ask for the evidence (for example, the test output). Then try it yourself.
- Review. Read the diff, the list of exact changes. Do you understand each change? Did it touch files it shouldn’t have? Did it “fix” a problem by hiding it?
- Commit. Save the working step with Git, with a clear message, so you can always return to it. Then start the next step.
The more specific your request, the less you have to correct afterwards:
| Vague request | Specific request |
|---|---|
| “make the signup page better” | “On the signup page, show an error under the email box when the address has no @. Add a test for this, run the tests, and fix any failures.” |
| “the build is broken” | “The build fails with this error: [pasted error]. Find the cause, fix it, and run the build again to confirm. Don’t just silence the error.” |
Think of the AI as a very fast junior developer. It works quickly, knows a lot, and never gets tired. But it doesn’t know your unwritten requirements, it can be confidently wrong, and it sometimes takes shortcuts. Like a good manager, give it clear instructions and review its work. This is what people mean by keeping a human in the loop. And you remain responsible for everything you submit or ship: “the AI wrote it” is no excuse for a bug, a security hole, or an academic-integrity problem. The full Claude Code version of this workflow is in Working Effectively with Claude Code.
11.5 Benefits and limitations
| Benefits | Limitations and risks |
|---|---|
| Speed: boilerplate, prototypes, and routine changes in minutes | Wrong but plausible: code that looks right but has subtle bugs, or uses functions and packages that don’t exist |
| A patient tutor: explains unfamiliar code, error messages, and frameworks | Security: insecure code, secrets (such as API keys) leaked into files, and agents tricked by instructions hidden in a web page or file they read (prompt injection) |
| Debugging help: reads errors and traces them to the cause | Missing context: the AI doesn’t know requirements that exist only in your head |
| The tedious parts: tests, documentation, commit messages | Cost: agents read many files and take many steps, so they use far more tokens (the units AI usage is measured in) than a chat answer. That shows up as usage limits on a subscription or as a bill on a pay-per-use plan. |
| Access: people who are not professional programmers can build working prototypes | Over-reliance: if you never read the code, you can’t fix it when the AI can’t |
Hallucinations and privacy are covered in more depth in Limits, Risks, and Responsible Use, and legal questions in Legal and Ethical Questions About AI.
11.6 Why the command line, Git, and the web still matter
If an AI writes the code, why learn the basics? Because your job shifts from typing code to directing and checking the AI’s work, and you can’t check what you don’t understand. That is why this book is organized the way it is:
| Part of this book | Why it matters when an AI writes the code |
|---|---|
| The Command Line (Bash) | Coding agents live in the terminal and run shell commands for you. Before you let one run rm -rf build, you should know what that does. |
| Git and GitHub | Git is your undo button and your review tool: it shows exactly what the agent changed and lets you return to any earlier version. |
| How the Web Works | To ask for a web app, and to spot a bad design, you need the vocabulary: front end, back end, database, API, hosting. |
| Claude: The Big Picture and Claude Code Essentials | How our main AI tool works, what it costs, and how to stay in control of it. |
11.7 Key takeaways
- AI help grew from chat and autocomplete to AI editors and agents that read files, run commands, check the results, and repeat.
- Agent = LLM + tools + a loop. The program around the model is the harness.
- Vibe coding is fine for throwaway experiments. Real projects need a spec, verification, review, and Git.
- Work in small steps: plan, build, verify, review, commit.
- Treat the AI like a fast junior developer: clear instructions, careful review. You remain responsible for the result.
Practice Questions
Easy
Question 1 · Short answer
What three ingredients turn a large language model into a coding agent?
Question 2 · Matching
Match each stage of AI help with its description.
| Stage | Description | |
|---|---|---|
| 1. Chat, copy, paste | A. Suggests the next line as you type; you accept or ignore it | |
| 2. Autocomplete | B. Reads files, runs commands, checks the results, and repeats until done | |
| 3. AI editor | C. Writes code in a chat window; you move it into your files yourself | |
| 4. Coding agent | D. Proposes changes across several files of your project for you to accept or reject |
Question 3 · Multiple choice
Which description best fits vibe coding?
- Writing a detailed spec before asking the AI for any code
- Accepting the AI’s code without reading it, and judging it only by whether the app seems to work
- Using AI only for autocomplete, never for whole features
- Having a classmate review every change the AI makes
Question 4 · True or false
A coding agent can only suggest code. You always have to run the tests yourself and tell it the results.
Question 5 · Fill in the blank
A short document that describes what to build (who it is for, what it must do, what is out of scope, and how to check that it works) is called a ________. A business-oriented version is often called a ________.
Question 6 · Short answer
In the world of AI agents, what is a harness? Give an example.
Medium
Question 7 · Scenario
Sam pastes an error message into a chatbot, copies the suggested fix into his file, runs the program, gets a new error, and pastes that one back too. Which stage of AI help is this? What would be different with a coding agent?
Question 8 · Ordering
Put these steps of the disciplined workflow in order: Commit · Verify · Plan · Review · Build
Question 9 · Rewrite the prompt
Users report that logging in with a correct password sometimes shows “Invalid password”. Rewrite this vague request so the agent knows exactly what “done” means: “fix the login page”.
Question 10 · Multiple choice
Which of these is the best example of context engineering?
- Asking the same question three times, hoping for a better answer
- Pasting all 300 files of a project into one prompt, “just in case”
- Giving the agent the spec, the exact error message, and the two files involved, and keeping standing project rules in an instruction file such as
AGENTS.md - Choosing the AI tool with the biggest advertising budget
Question 11 · Short answer
AI-written code is sometimes “wrong but plausible”. Give two ways this can happen and one habit that catches such errors.
Question 12 · Matching
Match each part of this book with the reason it matters when an AI writes the code.
| Part | Why it matters | |
|---|---|---|
| 1. The Command Line (Bash) | A. Shows exactly what the agent changed and lets you go back to any earlier version | |
| 2. Git and GitHub | B. Gives you the vocabulary to describe and judge a web app’s design | |
| 3. How the Web Works | C. Lets you understand a command before you allow it to run | |
| 4. Claude Code Essentials | D. Teaches how our main agent works and how to stay in control of it |
Question 13 · True or false
If an AI wrote the code, the AI company is responsible for any bugs or security problems in your app.
Hard
Question 14 · Scenario
Maria vibe-coded a club event sign-up app over a weekend. It “works” when she clicks around. Now she wants to put it online and collect real members’ names and email addresses. List at least four risks and what she should do before launching.
Question 15 · Compare
When might autocomplete be a better choice than a coding agent, and when is the agent the better choice?
Question 16 · Long answer
“Now that AI writes the code, Git matters more than before.” Explain why you agree or disagree.
Question 17 · Scenario
The agent finishes and reports: “Done! All tests pass.” What should you check before you commit? Give at least four checks.
Question 18 · Find the problem
Sam types one request into his coding agent: “Build my whole online store with payments, user accounts, and an admin dashboard.” Two hours later he commits all 80 changed files at once with the message stuff. Identify at least three problems with this workflow and say how to fix each one.
Question 19 · Short answer
Why does an agent session usually use far more tokens than asking a chatbot a single question? Give two ways to keep usage down.
Challenge
Question 20 · Hands-on
Write a one-page spec for a small app you might build this semester (for example, a study-group finder). Include who it is for, three to five must-have features, what is out of scope, and a “done means” list of checks. Then list three things you would put in the project’s instruction file (CLAUDE.md or AGENTS.md).