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.
Command output and exit codes
card 3 of 6
The rules for reading a result
builds on: Terminal basics: where you are and running things
- `0` = success. Any other number (on Linux and macOS, `1` to `255`) = not success.
- What each non-zero number means is up to the program. For example, `grep` returns `1` when it simply finds no match, and `2` for a real error.
- To see the code, run `echo $?` right after a command in bash or zsh. In PowerShell, use `$LASTEXITCODE`.
- To split the channels, run `<command> 2> err.txt`. Stderr goes into the file and stdout stays on screen.
- The words can mislead. “Done!” with code `1` is a failure. Warnings with code `0` are a success.
Terms on this card
- command
- A line you type in the terminal to run a program, like `ls` or `python convert.py`.
- stdout
- Short for standard output: the channel for a program's normal results.
- stderr
- Short for standard error: the channel for a program's errors and warnings.
- `grep`
- A command that searches files or text for lines containing a pattern. Exit code 0 means it found a match, 1 means no match, and 2 means a real error.
- grep
- A terminal command that prints the lines of a file that contain a given piece of text.
Lesson goal: Tell normal output from error output. Explain that a command reports success (exit code 0) or failure (non-zero), which is how an agent decides whether a step 'worked'. ·
the whole lesson