Go from never having used a coding agent to working productively and safely with one. The learner should understand what an agent is and how it differs from a chat assistant. They should choose a tool, set up a protected first project, describe tasks the agent can do well, and follow and verify its work. They should recover from bad changes, manage context, and plan bigger changes. They should also use tests as the definition of done and run everyday workflows (bug fixes, features, writing tests, codebase exploration, scripts, small tools, refactors). Throughout, they should keep secrets and systems safe and keep their own understanding growing instead of outsourcing it.
The agent loop: act, observe, repeat
card 4 of 6
One task, one loop
A realistic session, shortened. Each `⚙` line is one act. The indented lines under it are what the agent got back; only the relevant lines are shown. For the edit, they show the change it made. The `◂` line is the summary it writes when it decides to stop.
▸ You: Cart total is 24.3, should be 27
⚙ Search: "Total" in src/
src/cart.py: print("Total:", total)
⚙ Read: src/cart.py
from pricing import final_price
total = final_price(items) * 0.9
⚙ Run: python src/cart.py
Total: 24.3
⚙ Read: src/pricing.py
return subtotal * 0.9
⚙ Edit: src/pricing.py
changed to: return subtotal
⚙ Run: python src/cart.py
Total: 27.0
◂ Agent: Fixed the doubled 10% discount.
Terms on this card
- summary
- The message the agent writes at the end saying what it did. It is the agent's own claim, not a check.
- loop
- Code that repeats a step for each item in a list, e.g. adding up every row of a table.
- session
- One working conversation with the agent, from the task you type until you accept or redirect the result.
- agent
- An AI tool that doesn't just chat. It reads your project's files, edits them and runs commands to carry out a task you give it.
Lesson goal: Describe the cycle the model runs: decide a next step, call a tool (read, search, run, edit), read the result, and repeat until it judges the task done. Predict that each step is driven by what it has observed so far. ·
the whole lesson