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.
Your first small task, end to end
card 4 of 6
Checking the change before you commit
builds on: A safe first project: folder, git, clean state, The shape of a session: task to review, git status and reading a diff
You ask for a `--shout` option and approve the edit. `git diff` then shows the change below. The `-` line is the old `print`. The `+` lines import `argparse` and define `--shout` as a flag (`action="store_true"`). A new `print` uses capitals only when `--shout` is given. The `msg` line is unchanged context. Nothing else changed, so you commit.
A vaguer request like `▸ You: add some options to greet.py` makes the agent guess which options to add and how they behave. It also leaves you nothing concrete to check.
--- a/greet.py
+++ b/greet.py
@@ -1,2 +1,6 @@
+import argparse
msg = "Hello, world"
-print(msg)
+p = argparse.ArgumentParser()
+p.add_argument("--shout", action="store_true")
+args = p.parse_args()
+print(msg.upper() if args.shout else msg)
Terms on this card
- flag
- A command-line option that is simply on or off, with no value after it, like `--shout`.
- argparse
- Python's built-in tool for reading command-line options such as `--shout` when a script starts.
- action="store_true"
- Tells argparse that an option is a flag: `args.shout` is True when `--shout` is typed, and False when it is not.
- git diff
- Shows exactly which lines changed in tracked files since the last commit: `-` for removed lines, `+` for added ones. New, untracked files do not appear in it.
- commit
- A saved snapshot of your project in git that you can return to later.
Lesson goal: Run one tiny, checkable task, such as adding a command-line option to a script. Watch it read files, approve its edit, run the result yourself, inspect `git diff` and commit, which practises the whole loop once. ·
the whole lesson