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.
Branches for risky or alternative attempts card 4 of 6

Two attempts at a faster report

builds on: Branches as parallel lines of work, Commit before every task: checkpoints
$ git switch -c try-cache ▸ You: Speed up `build_report` in `src/report.py` by caching its results between runs. Review, run the report, commit. Then, from `main` again: $ git switch main $ git switch -c try-batch ▸ You: Speed up `build_report` in `src/report.py` by reading the input file once, not many times. Review, run, commit. Run each version twice. Outputs match `main`, but a cache only helps repeat runs, so `try-cache` stays slow the first time. `--stat` counts changed lines per file: `try-batch` is smaller too. Keep it.
$ git diff --stat main try-cache
 src/cache.py  | 58 ++++++++++++++++
 src/report.py | 39 +++++++++---
 2 files changed, 88 insertions(+), 9 deletions(-)
$ git diff --stat main try-batch
 src/report.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Terms on this card
`main`
The usual name of a project's primary branch: the line of work you treat as the good, current version.
commit
A saved snapshot of your project's tracked files, with a message. You can return to it later.
`--stat`
An option for `git diff` that shows only which files changed and how many lines, plus a total, instead of every line.
git
A tool that records versions of a project's files over time. Its data lives in the hidden `.git` folder.
src
Short for "source": a common folder name for a project's main code files.
Learn this step by step on Bytewise
Lesson goal: Put a risky change or a second approach on its own branch so main stays clean. Compare the two attempts and merge or delete the branch. · the whole lesson