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.
Catching destructive commands card 2 of 6

Most mistakes undo; some don't

builds on: Approvals and permission modes, Undoing with git: discard, reset, revert
Your checkpoint makes most agent mistakes cheap, because edits to committed files come back with git. Destructive commands are dangerous because they reach what git cannot restore. That means files never committed, folders outside the project, the online copy of your history, databases and your computer's system setup. `git clean -fdx` deletes every untracked and ignored file. `git reset --hard` throws away uncommitted edits. Neither leaves a copy behind.
Terms on this card
checkpoint
A git commit (or a tool's built-in snapshot) made before a task, so you can return to exactly that state.
untracked
A file in your project folder that git has never been told to save in a commit. Git has no copy of it.
ignored file
A file git is told to skip, usually listed in a file named `.gitignore`. Git keeps no copy of it.
git clean -fdx
Permanently deletes untracked files in the project. `-f` makes it actually delete, `-d` includes whole folders, and `-x` also deletes ignored files. Git cannot bring any of them back.
git reset --hard
Moves your project back to a commit and throws away all uncommitted edits to tracked files.
Learn this step by step on Bytewise
Lesson goal: Recognise risky commands before approving them: recursive deletes, force-push, history rewrites, database drops, and installs with system-wide effects. Explain why 'always allow' must never cover them. · the whole lesson