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 5 of 6

When the exit code belongs to someone else

builds on: Terminal basics: where you are and running things
The agent shows: ⚙ Run: python convert.py big.csv | tail -n 3 The `|` (pipe) feeds the script's stdout into `tail`, which keeps only the last 3 lines. The script crashes halfway. By default in bash and zsh, the reported exit code is that of the last command, `tail`. That code is `0`, so the agent says “succeeded”. The error line still appears, because the pipe doesn't carry stderr. Read that error line yourself, then type: ▸ You: Rerun without `| tail` and tell me the exit code.
Terms on this card
command
A line you type in the terminal to run a program, like `ls` or `python convert.py`.
script
A small program saved in a file, such as `convert.py`, that you run to do one job.
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.
exit code
A number a program returns when it finishes. 0 means success; any other number means it did not succeed. What each non-zero number means is up to the program.
Learn this step by step on Bytewise
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