Day 1, 25 minutes · advanced
Why it matters
On site you have to predict what a coding agent will do before the client watches it do it. Someone in the room will want to know what it can touch, what it reads, and who said yes to each command. If the honest answer is "I am not sure", you lose the room.
A coding agent is a model, a set of tools and a loop that keeps going until the task is done. Once you can see that loop, you can predict it, slow it down and explain it in plain words to a client who has never used one.
In this lesson you give an agent one small task, a single failing test in a throwaway folder, and you watch every turn of the loop. At the end you have a one-page trace: every step, the tool it used, what it read or ran, and where it stopped to ask you. You also decide which permission setting you would use on a client laptop, and why.
The loop in plain words
The agent loop works like this. A model reads what it has. It picks a tool: read a file, run a command, edit a file. It looks at the result and decides the next step. It repeats until it thinks the task is done, or until it needs you.
A chat assistant has the same model but no hands in your project. It can read what you paste and answer. So in a chat tool you do the running yourself, and you become part of the loop.
What is sent on every turn
The context window is everything the model can see at one moment. It is put together again on every turn of the loop, and it holds:
- the system instructions of the tool, with the list of tools the agent may use
- the project instruction file, if the folder has one: a file of rules for the project that the agent reads at the start
- the conversation so far
- the results of earlier tool calls: file contents, command output, errors
So the agent does not remember your project between turns. It sees it again, through this list.
Permissions
A permission mode decides what the agent may do without asking you. Every coding tool in this course has one, with its own names and its own default. On your own laptop a mode that never asks feels fast. On a client laptop the agent runs with your access: their network, their repositories, and anything in your environment. This course uses one rule: on a client machine, start in the mode that asks, and allow a command only after you have read it.
The steps
- Make a throwaway folder called
agent-trace/with the two files below. They are small on purpose, so you can also paste them into a chat tool.
import re
ORDER_ID = re.compile(r"WH-\d{5}")
def find_order_id(text):
"""Return the first order id in the text, or None."""
match = ORDER_ID.search(text)
return match.group(0) if match else None
Save that as orders.py. Save this as test_orders.py:
import unittest
from orders import find_order_id
class FindOrderIdTest(unittest.TestCase):
def test_finds_id_in_a_sentence(self):
self.assertEqual(find_order_id("Where is order WH-10432?"), "WH-10432")
def test_accepts_lower_case(self):
self.assertEqual(find_order_id("status of wh-10432 please"), "WH-10432")
def test_returns_none_without_id(self):
self.assertIsNone(find_order_id("Where is my order?"))
if __name__ == "__main__":
unittest.main()
- Run
python -m unittestonce yourself (usepython3ifpythonis not found). Three tests run and one fails:test_accepts_lower_case. Now you know what the agent should find. - Pick the permission mode before you start: the one that asks before edits and commands. You want to see each step, not only the result.
- Give the task: make the failing test pass by changing the code, never the test. Ask the agent to say each step before it takes it. Pick your tool below and follow the steps. A word on cost before you pick: the Claude Code, OpenAI Codex and Gemini CLI tabs are written for a paid plan, a company licence or a paid key, in every lesson. In this lesson the Cursor and GitHub Copilot tabs work on a free plan with limited usage. From day 2 on, each guide says where a feature may need a paid plan.
- Write a row for every step while it runs. Every permission prompt gets a row, also the ones you said no to.
- Read the transcript afterwards: the full record of the session, which usually shows more than the screen did. Fill the gaps in your notes.
- Write
trace.md. One page, one row per step:
| Step | Tool | What it read or ran | Asked permission |
|------|-------------|-------------------------|------------------|
| 1 | read file | test_orders.py | no |
| 2 | run command | python -m unittest | yes, I said yes |
| 3 | edit file | orders.py | yes, I said yes |
In a chat tool the Tool column often says "me": you ran the test and pasted the result.
Check your trace
- All three tests pass in the last row, and
test_orders.pyis unchanged. - Every command the agent ran is in the trace, with its result.
- For each row without a permission prompt, you can say why the tool did not ask.
That last point is the question a client will ask first.
Same loop, different defaults
- Claude Code: recent versions start in auto mode. Manual mode asks before most edits, shell commands and network access.
- OpenAI Codex: recommends the Auto preset in a Git folder and read-only in a folder without version control. Read Only asks before edits and commands.
- Gemini CLI: Default mode asks before every shell command and most write tools. Since 18 June 2026 Google sends free and Google AI Pro or Ultra users to Antigravity CLI, so Gemini CLI needs a company licence or a paid API key.
- Cursor: Auto-review is the default since version 3.6 and lets allowed calls run without asking. Allowlist with an empty list asks first, though with sandboxing on some commands can still run without a prompt.
- GitHub Copilot CLI: asks you to trust the folder, then asks before commands. Yes allows one command once.
On a client laptop
Write down the mode you would use there, what it may do without asking, and who approves the rest. Keep to the client rules from the first minute: made-up data only, no secret in a prompt, a file or the repository, and a person approves every write.
Keep trace.md. When a client asks what the agent will do, show the trace before you show the agent. The next six days build on this loop: a prototype in the first meeting, project instructions, skills and hooks, connections to client systems, evals, and a run that works without you.
Deeper dive
Today's actions
Ticks are not saved without an accountDo it in your tool
Claude
- Run
python -m unittestonce inagent-trace/and copy the output. One of the three tests fails. - Start a new chat in Claude. Paste the prompt below and paste the text of
orders.py,test_orders.pyand the test output under the matching lines. The upload list names no .py files, so paste them as text.Here is a failing test, the function it tests and the test output. Explain in three sentences why the test fails. Then show the smallest change to orders.py that fixes it. Do not change the test. Tell me the exact command I should run to check it. Do not claim the test passes: I will run it and tell you. orders.py: test_orders.py: Test output: - Note in your trace what Claude read (only what you pasted) and what it said is wrong.
- Apply the change to
orders.pyin your own copy. Leavetest_orders.pyas it is. - Run
python -m unittestyourself and paste the output back into the chat. You are the hands of the loop, so this row in your trace gets the tool "me". - Write
trace.mdwhen all three tests pass, with one row per step: Step, Tool, What it read or ran, Asked permission. - Hand off to Claude Code to let an agent run the test itself: it reads your codebase, edits files and runs commands. First put the original
orders.pyback from the lesson text, so one test fails again. Then do the same task in the same folder with the Claude Code tab of this lesson.
Note: We found no Claude help page that shows chat running a project's tests, so you run them. The chat part works on the Free plan. The Claude Code tab needs a paid plan (Pro, Max, Ultra, Team or Enterprise) or a Console account.
ChatGPT
- Run
python -m unittestonce inagent-trace/and copy the output. One of the three tests fails. - Select + in the message box of ChatGPT, then Add photos & files, and attach
orders.pyandtest_orders.py. On Free you can upload 3 files a day, so you can also paste the two files as text. - Paste the prompt below with the test output under it and send it.
I attached a small project with one failing test. First list which files you read and what you think is wrong. Then propose the smallest fix to orders.py as a code block, and tell me the exact command I should run to check it. Do not change the test or anything else. Test output: - Copy the code from the block with the fix and paste it into
orders.pyin your own copy. - Run
python -m unittestyourself and say in the next message what it printed. You are the hands of the loop. - Write
trace.mdas you go: one row per step with Step, Tool, What it read or ran, Asked permission. Note that ChatGPT did not run your tests on its own. - Put the original
orders.pyback from the lesson text, so one test fails again. Then hand off: in the ChatGPT desktop app select Codex from the menu, open the sameagent-trace/folder and give it the same task. The OpenAI Codex tab of this lesson shows the same loop in the Codex CLI.
Note: We found no OpenAI page that shows Chat running a project's test suite, so you run the test yourself. OpenAI's help page says Codex is included on all ChatGPT plans, Free and Go too, but the Codex CLI in the OpenAI Codex tab needs a paid plan or an API key. A workspace admin can control Codex access.
Gemini
- Run
python -m unittestonce inagent-trace/and copy the output. Keep the folder tiny, with no secrets and no .git folder: each file in a folder counts toward the 10 files you can attach to one prompt. - Go to gemini.google.com on a computer and sign in.
- Click Add files in the text box at the bottom, then More Uploads, Import Code and Upload folder, and choose
agent-trace/. - Paste the prompt below with the test output under it and click Submit.
I attached a small project with one failing test. Read the files and tell me, step by step, which files you looked at and why. Then propose the smallest fix to orders.py as a diff and say which command I should run to check it. Do not change the test. Do not claim the test passes: I will run it and paste the result. Test output: - Apply the change to
orders.pyin your own copy and runpython -m unittestyourself. You are the hands of the loop. - Paste the test output back into the chat. If Gemini needs to see your changed
orders.py, paste that file as text too. - Write
trace.mdwith one row per round trip: Step, Tool (often you), What it read or ran, Asked permission. Add a line on what Gemini did not do here: run the test or act by itself.
Note: We found no Google page that shows Gemini chat running a test. For work inside a repository Google now sends individuals to Antigravity CLI. The Gemini CLI tab of this lesson only works with a company licence or a paid API key. On a Mac, the Gemini app also has an Antigravity tab at the top: a coding agent that works in folders you choose.
Microsoft Copilot
- Run
python -m unittestonce inagent-trace/and copy the output. One of the three tests fails. - Go to Copilot Chat and sign in with your work or school Microsoft 365 account.
- Open the menu in the Message Copilot box (Microsoft's page does not name its button), select Upload images and files and choose
orders.pyandtest_orders.py. If the upload is refused, paste both files as text. - Paste the prompt below with the test output under it and send it.
I attach a small project with one failing test and the test output. Tell me which file and line cause the failure and explain why in two sentences. Then give me the smallest patch to orders.py as a diff. Do not change the test. List the exact command I should run to check it. Test output: - Apply the patch to
orders.pyin your own copy and runpython -m unittestyourself. You are the hands of the loop. - Paste the new test output into the chat and ask for another patch if a test still fails.
- Write
trace.md: for every step, what Copilot saw, what it proposed, what you did and whether anything asked permission. - Put the original
orders.pyback from the lesson text, so one test fails again. Then do the same task in the same folder with the GitHub Copilot tab of this lesson for the part that needs the repository.
Note: We found no Microsoft page that shows Copilot Chat running your tests, so you run them. For the part that needs a repository this course sends you to the GitHub Copilot tab. That pairing is our choice, not a Microsoft statement. Microsoft's own route is the Code tab, which is a preview. On a personal account it is offered only in the United States and Canada.
Paid planWork or school account. Copilot Chat (Basic) comes with eligible Microsoft 365 licences. Uploading code files such as .py is listed for accounts with a Microsoft Copilot licence.
Claude Code
- Install Claude Code. On macOS, Linux or WSL run the command below. On Windows PowerShell run
irm https://claude.ai/install.ps1 | iexinstead.curl -fsSL https://claude.ai/install.sh | bash - Open a new terminal and run
claude --version. A working install prints a version number. - Run
cd agent-trace, thenclaude. Follow the browser prompts to log in on first use. - Press Shift+Tab until the status bar shows manual mode on. In Manual mode Claude Code stops and asks before most actions that edit files, run shell commands or reach the network.
- Paste the prompt below. At each permission prompt, write down the tool and what it was about to do, then choose Yes. Skip the options that stop it from asking again, so every step stays visible.
Run the tests in this project with python -m unittest. One test fails. Find the cause, fix the code (not the test), run the tests again, then list every step you took in order. - Press Ctrl+O to open the transcript viewer. Note the files read, the commands run and the timestamps, then press
qto leave. - Run
/contextto see what is in the context window. Then writetrace.mdfrom your notes and the transcript.
Note: Since version 2.1.283 a session starts in auto mode, so you may see no prompts until you switch to Manual. The full session is also saved as a JSONL file under ~/.claude/projects/. An admin can remove auto mode with the managed setting permissions.disableAutoMode. On native Windows the Bash sandbox does not run.
Paid planNeeds a paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Console account. The Free plan does not include Claude Code.
OpenAI Codex
- Install the Codex CLI. On Windows open a new PowerShell window and run the command below. On macOS or Linux run
curl -fsSL https://chatgpt.com/codex/install.sh | shinstead.powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" - Run
codexinagent-trace/. The first time, choose Sign in with ChatGPT or another sign-in method. Note which permission preset Codex recommends at launch:agent-trace/is not under version control, so expect read-only. - Type
/permissionsand press Enter to open the permissions picker. Pick Read Only, so Codex must ask before it edits a file or runs a command. - Paste the prompt below. Read each approval request before you accept it, and note what Codex wanted to do.
This project has one failing test. Run the tests with python -m unittest, find the cause, make the smallest fix in the code (not the test), and run the tests again. Before each step, say in one line what you are about to do and why. - Type
/statusto see the model, approval policy, writable roots and token usage. - Type
/export session.mdwhen the turn has finished, to save the conversation as Markdown. Turn it intotrace.md: step, tool, what it read or ran, where it asked.
Note: In a folder without version control Codex recommends read-only at launch. In a Git folder it recommends Auto: it reads, edits and runs commands in the folder without asking, and asks before it edits outside the workspace or runs a command that needs the network. A workspace admin can switch local Codex off with Allow members to use Codex locally. If it is off, run the test by hand and note that in your trace.
Paid planThe Codex CLI needs ChatGPT Plus, Pro, Business, Enterprise or Edu, or an API key. A free route for the CLI is not confirmed.
Gemini CLI
- Install Gemini CLI with the command below (it needs Node.js 20.0.0 or newer). Check the install with
gemini --version.npm install -g @google/gemini-cli - Set the environment variable
GEMINI_API_KEYto your paid-tier key in your shell, never in a prompt. Rungeminiinagent-trace/and select Use Gemini API key. - Stay in Default mode, where every shell command and most write tools ask first. If you switched, press Shift+Tab to cycle back to Default.
- Paste the prompt below. At each prompt choose Allow once and note it. Allow always would stop the prompts for that command for the rest of the session.
Run the test suite in this folder with python -m unittest. One test fails. Find the cause, explain it in two sentences, fix the code (not the test), and run the tests again. Say each step before you take it. - Run
/stats toolsand/tools, and add the tool statistics and the list of tools the agent had to your notes. - Write
trace.mdfrom what the session showed on screen: step, tool, what it read or ran, where it asked permission.
Note: Google now sends individuals to Antigravity CLI, a different product. This course has no checked steps for it. Without a company licence or a paid key you cannot do this tab. With a company licence, Google's page says to sign in with Google and set GOOGLE_CLOUD_PROJECT instead of the key.
Paid planNeeds a company Gemini Code Assist Standard or Enterprise licence, or a paid Gemini API or Vertex AI key. Free and Google AI Pro or Ultra sign-in stopped on 18 June 2026.
Cursor
- Download Cursor, open the app and sign in. Then open the
agent-trace/folder. - Open Settings > Agents > Approvals & Execution and write down your mode. Auto-review is the default since Cursor 3.6.
- Choose Allowlist for this trace and leave the allowlist empty, so terminal commands ask first.
- Open the Agent panel with Ctrl + I (Cmd + I on Mac), paste the prompt below and press Return.
There is one failing test in this folder. Find out why it fails, fix the code (not the test), run the tests with python -m unittest to confirm, and tell me in a short list every file you read and every command you ran. - Watch the chat and the diff view. Note each file Agent reads, each command it proposes and each approval prompt, and approve or reject each command yourself.
- Go back to Approvals & Execution and set the mode you wrote down.
- Write
trace.md: step, tool, what it read or ran, where it asked permission.
Note: Under Auto-review allowed calls run without asking, so you would see few prompts. With sandboxing on, some commands can still run in the sandbox without a prompt in Allowlist mode: note which ones did. The Free plan (legacy name: Hobby) includes Agent with Cursor's own models and limited usage. Claude, GPT and Gemini models are not on Free.
GitHub Copilot
- Install Copilot CLI with the command below (it needs Node.js 22 or later). On Windows you can run
winget install GitHub.Copilotinstead.npm install -g @github/copilot - Enter
copilotinagent-trace/. When it asks you to confirm that you trust the files in this folder, choose Yes for this session only. - Enter
/loginif you are not logged in, and follow the on-screen instructions. - Paste the prompt below. At each permission prompt note the tool it asks for, then choose Yes to allow that one command once.
Run the test suite with python -m unittest. Find out why the failing test fails. Fix the code, not the test. Run the tests again. Before each action, say in one line what you are about to do and why. - Run
/usage,/contextand/instructionswhen it finishes, and add what they show to your notes. - Run
/share fileto export the session to a Markdown file. Read it against your notes and writetrace.md.
Note: The Free plan includes Copilot CLI. GitHub's plans page only says "Limited chat and agent usage" for Free. Every interaction uses AI credits. The wording and scope of the middle option of a permission prompt depend on the request, so read it on screen before you pick it. An organisation can switch the CLI off with the Copilot CLI policy. If it is off, run the test by hand and note that in your trace.
Create a free account to save your progress
Free, and no payment details. Your ticks and finished lessons are kept, on every device.
Create a free account I already have an accountCreate a free account to save your progress. Sign in or sign up