Course contents
Concept · 6 hands-on exercises

Meet your coding agent

See what a coding agent does inside each turn, choose how much it may do without asking, and read a diff well enough to catch surprises.

In Module 2 you treated the agent as a black box: prompt in, website out. To build anything bigger, you need to see inside the box. What does the agent do between your prompt and its reply? What is it allowed to do without asking? And how can you tell, without reading every line of code, whether a change is the one you asked for?

Inside one turn

When you send a prompt, the agent doesn't write its answer in one go. It runs a loop of small steps. It reads your request and the project's instruction file, looks around the project (listing folders, opening files, searching for words), and plans. Then it acts: it edits a file or runs a command, reads the result, and decides the next step. One prompt can take dozens of these steps, and you can watch each one scroll past.

Put it in orderExercise 1 of 6

Put the steps of one agent turn in order.

  1. Plan the change
  2. Look around: list folders, open files, search for words
  3. Read the result and compare it with the goal
  4. Edit a file or run a command
  5. Read your prompt and the project's instruction file
  6. Report back, or loop to the next step

Watching the steps teaches you a lot. If the agent edits a file it never opened, it's guessing. If it runs the same failing command three times, it's stuck and needs a hint. If it says it tested something but no command ran, ask it to show you.

Quick checkExercise 2 of 6

The agent says “I've updated the hours and tested the page,” but you saw no command run and no browser open. What's the right response?

Permission modes

Every agent lets you decide how much it may do without asking. Approving every action is the safest setting and the slowest. Letting it run freely is fast and risky. Most tools now also offer a middle setting, where routine actions run on their own and a safety check stops anything risky. The names differ between tools; the idea is the same.

ToolHow to switchModes, as of November 2026
Claude CodeShift+Tab during a sessionManual (asks before most actions), accept edits, plan, and auto, where a background safety check approves or blocks each action. New sessions start in auto mode since v2.1.283.
CursorRun mode in Agent settingsAuto-review (sandboxed commands plus a safety check), Allowlist (only actions you've listed run without asking), Run Everything
Codex/permissions in a sessionChoose what Codex is allowed to do without asking
App buildersNot neededThe agent works in the builder's cloud and changes only your project there
Explore: What runs, what asks, what's blockedExercise 3 of 6
Mode

The agent reads and proposes a plan. Nothing changes until you approve it.

  • Read index.htmlRuns on its own
  • Edit styles.cssBlocked
  • Start a local preview serverBlocked
  • Install a new package from the internetBlocked
  • Push your commits to GitHubBlocked
  • Delete the project's .git history folderBlocked
1run on their own
0need your approval
5blocked

An illustrative model. Each tool draws these lines a little differently, so check what yours does.

Move the controls and watch what changes.

Quick checkExercise 4 of 6

You're new and want to learn what the agent actually does. Which mode teaches you the most in your first sessions?

One useful detail from Claude Code's documentation: in auto mode, boundaries you state in the conversation count. Tell it “don't push until I've reviewed the change,” and its safety check blocks matching actions until you lift the boundary. Whatever your tool, say your limits out loud; it costs one sentence.

Keep the guardrails on
Some tools have a mode that runs everything with no checks at all. Claude Code's docs say its bypassPermissions mode is for isolated containers and virtual machines only. In August 2025, malicious versions of the popular Nx package showed why: according to Nx's own postmortem, they looked for AI coding tools on victims' computers, ran them with permission checks switched off, and used them to hunt for secrets.

Reading a diff without reading code

A diff shows what changed. Lines starting with + (often green) were added; lines starting with - (often red) were removed. You don't need to understand every line to review one. Ask four questions: Are these the files I expected? Is the change about the right size for what I asked? Did anything disappear that shouldn't have? Is anything new that I didn't ask for, such as a web address, a password or a package?

Spot the problemsExercise 5 of 6

You asked the agent to “add our social media link to the footer.” Click the lines in its diff that don't belong.

index.html0 of 3 found
You make the callExercise 6 of 6

The helpful install

You ask the agent to add a photo carousel to the bakes section.

  1. The agent proposes installing a carousel package, a build tool and a CSS framework “to do this properly.”

Check your understanding
Q1. You can't read most of the code in a diff. Which question matters most?
Q2. Why do many tools now offer an auto mode with safety checks?
· Work through the 6 remaining exercises above (stuck? each one can show you the answer).
· Score 100% on the quiz.
Vocabulary in this lesson

Plain-English definitions from the AI Coding Dictionary.