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 1 of 6
The agent asks to 'clean up' the project
builds on: Approvals and permission modes, Undoing with git: discard, reset, revert
You asked the agent to fix an error that stops your project from running. Midway it shows:
`⚙ Run: git clean -fdx && git reset --hard`
`[Approve? yes / no / always]`
You made a checkpoint before the task, and you've been approving edits all day. It's only git, and git is for undoing things. So is it safe to say yes, or even to pick **always** so it stops asking?
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 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.
- &&
- Joins two terminal commands: run the first, then the second if the first succeeded. One approval can cover both.
- agent
- An AI tool that doesn't just chat. It reads your project's files, edits them and runs commands to carry out a task you give it.
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