From Chatbots to Agents

Language models that act on your computer

Brendan Chapuis

March 24, 2027

Draws on talks by Scott Cunningham and slides by Matthew DeHaven
Course Home Page

Lecture Goals

  • What makes an agent different from a chatbot
  • What an agent actually does on your computer, and how to read the record it leaves
  • Setting up safely: where the agent can reach, and what it can do without asking
  • Plan mode, permission modes, and when an agent is worth using
  • In class: start your personal academic website with an agent (due Friday 3/26)

From Chatbots to Agents

Where We Left Off

  • 3/17: an LLM predicts a distribution over the next token and draws one. Likely is not the same as true.
  • 3/22: we called a model from R, one prompt at a time, and checked its labels against ours.

Today the same model gets a terminal.

  • Its tokens stop being an answer you read and become commands that run.
  • Everything from 3/17 still applies: each step is a draw, and fluent is not the same as correct.

Three Ways to Use a Model

Chatbot

ChatGPT, Claude.ai, Gemini

You ask, it answers.

You copy anything useful back into your work.

Co-pilot

GitHub Copilot suggestions, Cursor tab

You type, it suggests.

You accept or reject each suggestion.

Agent

Claude Code, Codex, Copilot agent mode

You delegate, it executes.

It reads, writes, runs, and decides what to do next.

Moving right, you hand over more of the work, and you see less of it happen.

Spectrum from Scott Cunningham’s Baylor talk (2026).

The Middle of the Spectrum: Suggestions

Copilot in VS Code shows a suggestion as gray “ghost text” as you type.

  • Tab accepts the whole suggestion; you review one line at a time.
  • You are still the one who runs the code.

Screenshot from Matthew DeHaven’s GitHub Copilot slides.

Agents Are Not Software

Many people picture an agent as a program plugged into the computer.

It is not. It is the same language model as before, predicting the next token.

The difference: its tokens are commands, typed into a terminal, the way you would type them.

An agent works by talking, so it can only act where typing is accepted.

A Harness Around the Model

The agent you install is a small program, a harness, wrapped around a remote model.

  1. The harness sends the model your request, plus a list of tools it may use (read a file, edit a file, run a command).
  2. The model replies with text that names a tool and its input, like Bash: Rscript code/02-clean.R.
  3. The harness runs it on your computer and sends back what happened.
  • The model never touches your files directly; the harness does it for it.
  • That is why the harness can ask you first, and why it can block things (4/5).

What an Agent Actually Does

What It Runs

Command What it does
ls data/ list files
grep -r "treated" code/ search inside files
curl -O https://site.gov/data.csv download from the web
Rscript code/03-estimate.R run an R script
python audit.py run a Python script
quarto render paper.qmd build a document
git diff inspect changes
rm -rf data/ delete files, permanently
git push --force overwrite history on GitHub

These are the same commands you learned in the first half. The agent is just faster at typing them.

Adapted from Scott Cunningham’s Baylor talk (2026).

The Agent Loop

flowchart LR
  A["Your request"] --> B["Decide:<br>next step"]
  B --> C["Act:<br>run a command,<br>edit a file"]
  C --> D["Observe:<br>output, errors,<br>file contents"]
  D --> B
  B --> E["Report back<br>when done"]

flowchart LR
  A["Your request"] --> B["Decide:<br>next step"]
  B --> C["Act:<br>run a command,<br>edit a file"]
  C --> D["Observe:<br>output, errors,<br>file contents"]
  D --> B
  B --> E["Report back<br>when done"]

  • Each pass through the loop is another round of next-token prediction.
  • The agent reads its own errors and tries again, often many times, before it reports back.

One Request, Many Steps

“Make a figure of job openings by industry.”

  1. ls data/raw/ finds jolts.csv
  2. reads the first rows of the file to learn the columns
  3. writes code/04-make-figures.R
  4. Rscript code/04-make-figures.R returns Error: object ‘industry’ not found
  5. reads the error, renames the column, runs it again
  6. reports: “Done. The figure is in output/figures/openings.png.”

The report mentions step 6. Did you see step 5? It changed a column name, and you were not asked.

Reasoning Models and Agents Are Merging

Reasoning models

  • Write themselves a scratchpad before answering
  • Strong at math, code, logic
  • No actions in the world

Agents

  • A model plus tools: read, write, run, search
  • The act, observe, decide loop
  • Strong at long, multi-step tasks

Current systems do both: plan a task, carry out the steps, check the output, revise.

The Transcript Is the Record

Every session leaves a transcript (Scott calls it a trace):

  • what you asked
  • every command it ran and every file it opened
  • everything that came back, including the errors
  • what it told you at the end

The output tells you what the agent concluded. The transcript tells you what it did to get there.

  • Claude Code saves each session as a text file under ~/.claude/projects/; other tools keep similar logs.
  • Your final project is submitted with its transcripts.

You See the Actions, Not All the Reasoning

Model What you see of its reasoning
Claude, GPT (closed) a summary of the thinking, not the raw text
Kimi, DeepSeek, Qwen (open-weight) the full raw reasoning
  • Closed labs summarize partly to stop competitors from training on the raw reasoning.
  • What the summary leaves out is unknown.

The commands and file edits are still all there. Read those.

Source: Scott Cunningham’s Baylor talk (2026), citing Anthropic and OpenAI developer documentation.

Reading a Transcript

When you skim one, look for:

  • Files it touched that you did not mention
  • Errors it worked around: what did it change to make the error go away?
  • Things it installed or downloaded
  • Choices it made for you: a sample restriction, a dropped variable, a default option
  • Claims it made at the end: is each one backed by a command you can see?

This is the “checking” leg from 3/17. The agent did the production; checking is still your job.

Getting Set Up Safely

Which Tool?

Agent Cost to you
Claude Code (Anthropic) terminal, desktop app, VS Code extension needs a paid Claude plan; the free plan does not include it
Codex (OpenAI) terminal, desktop app, VS Code extension included with paid ChatGPT plans
GitHub Copilot agent mode VS Code free for students through GitHub Education
  • They work the same way: a harness, a model, a working folder, permission prompts.
  • These slides use Claude Code as the example and note the others where they differ.
  • [TBD: which tool the class will use, and how to get access]

Type the Address Yourself

  • Do not click the first search result. It is often a sponsored ad.
  • Type the official address, or follow the link from the course website:
    • Claude Code: code.claude.com/docs
    • Codex: developers.openai.com/codex
    • Copilot: docs.github.com/copilot and code.visualstudio.com
  • For a VS Code extension, check that the publisher is the company itself (Anthropic, OpenAI, GitHub).

Never paste a terminal command from an ad, a video comment, or a stranger’s post.

Read an Install Command Before You Run It

The official Claude Code installer for Mac is one line:

curl -fsSL https://claude.ai/install.sh | bash
  • curl ... https://claude.ai/install.sh downloads a script; | bash runs it immediately.
  • So the whole question is: is that domain the one you meant?

If you are not sure, paste the command into a chatbot you already trust and ask: “What does this do, and is this the official domain?”

Use the tool defensively: have it check the source before you trust the setup.

Installing for This Class

  • Claude Code: the installer above, or brew install --cask claude-code; then claude --version should print a version number.
  • Desktop app (if you prefer no terminal): download it from the official site.
  • VS Code extension: Extensions panel, search the tool’s name, check the publisher, install.
  • Copilot: sign in to GitHub in VS Code; agent mode is a choice in the Chat panel.

The first time you run the agent, it opens a browser to sign in. Do this before class.1

Ways to Work

Three Ways to Work With an Agent

The desktop app easiest start; keeps every session in a sidebar
The terminal type claude (or codex) in a folder; closest to the machine
An IDE (VS Code) the agent next to your files, your editor, and a terminal

It is the same agent in all three. For this class: VS Code, the setup you have used since 2/01.

Adapted from Scott Cunningham’s Baylor talk (2026).

Why VS Code

  • You see the whole folder, not just what the agent tells you it did.
  • Changed files light up in Source Control, so git diff is one click away.
  • Your R terminal, the agent, and the browser preview sit side by side.

First steps:

  1. Open the project folder in VS Code (never a single file).
  2. Open the agent’s panel, or a terminal and type claude.
  3. First prompt: “Read the files in this folder and tell me what this project is about. Do not change anything.”

The Working Folder Is the Blast Radius

Every session starts in a folder. That folder sets what the agent can reach without asking.

Good

~/Projects/my-website/

The worst case is a broken website, and Git can bring it back.

Bad

~/ (your home folder)

Every project, your downloads, your .ssh keys, your .env files.

Start the agent in the smallest folder that holds the work.

Git Is Your Undo Button

Before you let an agent work:

  1. Commit everything, so git status is clean.
  2. Let the agent work.
  3. Read git diff before you commit what it did.
  • If it goes wrong: git restore . puts every tracked file back.1
  • Anything not in Git (raw data you never committed, .env) has no undo. Keep a copy elsewhere.

The Context Window Fills Up

Everything in a session is tokens: your prompts, every file it read, every command’s output.

  • The model rereads all of it at every step.
  • A long session holds a lot of it, and attention does not weigh it evenly: material in the middle gets skimmed (Liu et al. 2024).
  • Even your standing instructions can fade, and the agent starts breaking rules it followed an hour ago.

When the window is full, the tool compacts it: it replaces the history with a summary, and details are lost.

Keep the Memory on Disk

The conversation is temporary. The files on disk are the memory.

  • Restart long sessions; start a new one for each new task.
  • Have the agent write a short progress note to a file (notes/progress.md) before you stop.
  • Put rules that should hold every session in an instructions file (AGENTS.md, on 4/5), not in chat.
  • Commit often, with messages that say what changed.

Adapted from Scott Cunningham’s Baylor talk (2026).

Permissions and Plan Mode

The Agent Asks Before It Acts

By default the harness stops and asks before most actions that change things:

  • editing or creating a file
  • running a shell command (other than a small set of read-only ones)
  • fetching a web page

Each prompt shows the exact file or command and offers choices like Yes, Yes, and don’t ask again for …, and No, and tell it what to do instead.

Every prompt is a checkpoint. It is only useful if you read it.

Before You Say Yes

Ask yourself:

  • Is the path inside the project folder?
  • Does it delete or overwrite anything? (rm, mv, >, git reset, git push --force)
  • Does it install something or download from a site you do not know?
  • Does it touch secrets: .env, ~/.ssh, API keys?
  • Do I know why it wants to do this?

If not, say No and ask it to explain. That costs ten seconds.

Permission Modes (Claude Code)

Mode Runs without asking Use it for
Manual (default) reading files this class, unfamiliar work
Accept edits reading, editing files, mkdir, mv, cp work you will review with git diff
Plan reading; it proposes and does not edit designing before building
Auto almost everything; a second model screens each action long tasks, once you have guardrails
Bypass permissions everything isolated containers only
  • Switch with Shift+Tab in the terminal, or the mode menu under the prompt in VS Code and the desktop app.
  • Codex: /permissions switches between read-only, Auto, and full access. Copilot: the Chat panel’s agent picker (Ask, Plan, Agent) and its tool approvals.

Start in Manual Mode

Recent versions of Claude Code start in Auto mode in the terminal and VS Code. For this class, change that.

claude --permission-mode manual
  • Or press Shift+Tab until the status line reads manual mode on.
  • In VS Code, pick Manual from the mode menu; it remembers your choice.

Auto mode is not careless: a second model reviews each action. But you are learning what agents do, and you should be the one reviewing for now.

Plan Mode: Design Before You Build

In plan mode the agent reads and proposes, but does not edit your files until you approve.

  • Enter it with Shift+Tab, by starting with claude --permission-mode plan, or by starting a prompt with /plan.
  • It explores the folder, may ask you questions, and writes a plan.
  • You approve, ask for changes, or keep planning.

Iterate on the design, which is cheap, before the code, which is not.

  • Codex: /plan. Copilot: choose Plan in the agent picker.

How to Use a Plan

Paul Goldsmith-Pinkham’s workflow, as Scott describes it:

  1. Have the agent research the data and the folder.
  2. Let plan mode design the whole pipeline.
  3. Have it write the plan to a file, so the design survives a fresh session.
  4. Only then build, following the plan.

When you approve, choose the option that still asks you about each edit, not the one that switches to auto.

Source: Scott Cunningham’s Texas A&M and Baylor talks (2026).

Skipping Permissions: Not for This Class

You will see people start agents like this:

claude --dangerously-skip-permissions      # Claude Code
codex --yolo                               # Codex
  • No prompts at all: the agent runs every command it decides on.
  • Scott uses it, inside a narrow folder, with hooks guarding the things that must never happen.
  • The official docs recommend it only inside an isolated container or virtual machine.

Treat it as advanced. Do not use it on your laptop this semester.

When to Use an Agent

Valuable, Slow, Hard to Do Well, Checkable

Scott’s rule: delegate when all four hold.

  1. The output is valuable. The stakes justify the setup.
  2. The task is slow for people. Hours, not minutes.
  3. People rarely do it well. Hard to execute consistently.
  4. The output can be checked. You can inspect, compare, or rerun it.

The fourth is the one that matters most for research. If you cannot check it, you cannot use it.

Source: Scott Cunningham’s Baylor talk (2026).

Does a Website Pass?

  • Valuable: search committees and coauthors will look you up.
  • Slow: HTML, CSS, layout, and hosting take a beginner a weekend.
  • Hard to do well: most first websites look rough on a phone.
  • Checkable: you can see every page, and you can read the HTML and CSS (3/15).

Also low stakes: a mistake is visible, and fixing it is easy. A good first task.

A regression in your final project is different: the output looks the same whether it is right or wrong. That is 4/5 through 4/21.

Activity: Your Academic Website

The Assignment

Build a personal academic website with an agent and host it on GitHub Pages.

  • Your name, email, and a link to your GitHub
  • A short description of your research interests
  • An About page with a longer description
  • A Research page: list your final project as work in progress
  • Due Friday 3/26 [TBD: time]: submit the URL on Canvas.
  • Already have a site? Extend it, or build one for your final project instead.

Pick a Starting Point

Start from What you edit Good if
Bootstrap template plain HTML and CSS you want to read every line
Quarto template Markdown; Quarto builds HTML you have Quarto installed
An empty repository whatever the agent writes you want to design it yourself

Ask for plain HTML and CSS (Bootstrap from a CDN is fine). Avoid build tools and frameworks you cannot read yet.

Templates by Matthew DeHaven.

Step 1: Make the Repository

  1. On GitHub, create a public repository named <your-username>.github.io
    • or click Use this template on one of the templates
  2. Clone it and open the folder in VS Code
  3. Check: git status is clean, and the folder holds nothing but the site

That repository name gives you https://<your-username>.github.io (3/15).

Step 2: Start the Agent in Plan Mode

  1. Open the agent in this folder (the VS Code panel, or claude in the VS Code terminal)
  2. Switch to Plan mode
  3. Check the status line or mode menu says plan before you type anything

On Copilot, choose Plan in the Chat panel’s agent picker. On Codex, use /plan.

Step 3: Your First Prompt

I am a first-year economics PhD student. Plan a personal academic
website in this folder, to be hosted on GitHub Pages.

Pages: Home (name, email, GitHub link, short research interests),
About, and Research (my final project as work in progress).

Use plain HTML and CSS, with Bootstrap from a CDN if useful.
No build step and no JavaScript frameworks. It must look good on
a phone. Leave a clear placeholder for anything you do not know
about me; do not make anything up.

Edit this. Add your field, colors you like, a site you want it to resemble.

Step 4: Review the Plan

Before approving, read the plan and check:

  • Which files will it create? Can you say what each one is for?
  • Does it plan to use anything you did not ask for (a framework, a build tool, a font service)?
  • Where will your personal details go?

Ask for changes in plain English: “Use one shared styles.css for all pages.”

When it looks right, approve with the option that asks before each edit.

Step 5: Let It Build

  • Approve file edits one at a time, reading each briefly.
  • Say No to anything outside the folder or anything you do not understand, and ask why.
  • Open index.html in your browser to see the result.1

Then iterate in normal language: “The header is too large on a phone.” “Make the Research page a list with a one-line summary for each project.”

Step 6: Review It With the Web Primer

From 3/15: right-click the page, then Inspect.

  • Find <head> and <body>. What is in the <head>?
  • Find the <link> to the stylesheet. Open styles.css and match one rule to an element.
  • Click a heading: what is its tag, and its class?
  • Use the device toolbar to view it at phone width.

Anything you cannot explain, ask the agent: “Explain what this CSS rule does, line by line.” Then check the answer in the browser.

Step 7: Check the Content

Agents fill gaps with plausible text. Read every word.

  • Invented publications, awards, or degrees?
  • A wrong email address or GitHub link? Click every link.
  • Placeholder text (Lorem ipsum, Your Name) left in?
  • Anything you would not want public: a phone number or home address?

Your name is on it. “The agent wrote that” is not a defense.

Step 8: Commit and Push

  1. In Source Control (or git diff), read what changed
  2. Check git status: no stray files you do not recognize
  3. Commit with a message that says what you did
  4. Push to GitHub

Do the commit and push yourself. You are the one deciding this version is ready.

Step 9: Publish on GitHub Pages

  1. On GitHub: Settings, then Pages
  2. Source: Deploy from a branch; branch main, folder / (root)1
  3. Wait a minute, then open https://<your-username>.github.io

Check the live site, not just your local copy:

  • Every page opens, every link works, the stylesheet loads
  • It looks right on your phone

What to Submit

By Friday 3/26 [TBD: time], on Canvas:

  • The URL of your live site

Keep the agent’s transcript of your session. We will look at what agents did without being asked when we get to reviewing agent work (4/7).

If You Get Stuck

  • Page is blank or unstyled online but fine locally: a path problem. Ask the agent to check that every link and stylesheet path is relative.
  • 404 at your URL: check the repository name and the Pages settings; the first build can take a few minutes.
  • The agent keeps undoing your fix: start a new session and put the rule in a file it reads at the start (4/5).
  • You do not understand what it wrote: ask it to explain, then check in the browser.

Summary

Summary

  • An agent is a language model whose tokens become commands run by a harness on your computer.
  • It loops: decide, act, observe. The transcript records what it did; the summary at the end does not.
  • Get tools from addresses you typed; read install commands before running them.
  • The working folder is the blast radius. Git is your undo button.
  • Long sessions fill the context window and are read unevenly: restart, and keep memory on disk.
  • Use Manual mode and plan mode in this class; skip-permissions flags are not for now.
  • Use agents when the output is valuable, slow, hard to do well, and checkable.

References

  • Anthropic. Claude Code documentation: setup, permission modes, and memory. code.claude.com/docs. Accessed October 21, 2026.
  • Cunningham, Scott (2026). Talks at Texas A&M (October 2) and Baylor (October 14). This deck adapts their structure and several explanations.
  • DeHaven, Matthew (2026). GitHub Copilot slides and academic website templates, ECON 2020.
  • GitHub. Copilot documentation. docs.github.com/copilot. Accessed October 21, 2026.
  • Liu, Nelson F. et al. (2024). “Lost in the Middle: How Language Models Use Long Contexts.” Transactions of the ACL.
  • OpenAI. Codex documentation: agent approvals and security. developers.openai.com/codex. Accessed October 21, 2026.