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.
Reading an error message and stack trace
card 1 of 6
A wall of red text: what matters?
builds on: Command output and exit codes
You run a script and, instead of a total, you get this:
```
$ python report.py
Traceback (most recent call last):
File "report.py", line 8, in <module>
total = add_prices(rows)
File "src/prices.py", line 5, in add_prices
total += r["price"]
KeyError: 'price'
```
What went wrong, and where? If you ask an agent for help, what exactly do you show it?
Terms on this card
- traceback
- Python's name for a stack trace: the report printed when a program crashes, listing the calls in progress (oldest first) and the error.
- KeyError
- Python error raised when code asks a dictionary for a key that isn't in it.
- <module>
- Shown in a Python trace when the line runs at the top level of a file, not inside any function.
- script
- A small program, usually one file, that you run to do a task, like `report.py`.
- 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: Find the error type, the message, and the file and line where a failure happened in a stack trace. Identify which part to paste to an agent as evidence. ·
the whole lesson