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

Five families to stop and read

builds on: Approvals and permission modes, Undoing with git: discard, reset, revert
- **Recursive deletes:** `rm -rf`, `rm -r`, `git clean -f`, `find … -delete` - **Force-push:** `git push --force` or `-f` - **History rewrites:** `git reset --hard`, `git rebase`, `git commit --amend`. These can replace or drop commits, even your checkpoint. - **Database drops:** `DROP TABLE`, `DROP DATABASE`, `TRUNCATE`, `DELETE` without `WHERE` - **System-wide installs:** `sudo`, `npm install -g`, `curl … | sh` Read the whole command, including anything after `&&`. When in doubt, answer no and ask what exactly it removes or overwrites.
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.
git reset --hard
Moves your project back to a commit and throws away all uncommitted edits to tracked files.
rm -rf
Terminal command that deletes files and whole folders recursively (`-r`) without asking for confirmation (`-f`). There is no trash bin to recover from.
find … -delete
Terminal command that searches folders for files matching a pattern and deletes every match it finds.
&&
Joins two terminal commands: run the first, then the second if the first succeeded. One approval can cover both.
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