The agent asks to 'clean up' the project
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?
Most mistakes undo; some don't
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.
Five families to stop and read
- **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.
How 'always' lets a force-push through
Early on you picked **always** for `git push` to save clicks. Later the agent's push is rejected because the online copy has a teammate's newer commits. To finish the job, it runs `git push --force`. Many tools match an always-rule by how the command starts, so it ran without asking. Your teammate's commits were overwritten online, and you have no copy of them to put back. Give always-rules only to read-only commands like `git status`.
Catching a delete that goes too far
You asked the agent to clear out `build/`, a folder of generated output that can simply be recreated. It tucked a folder of real data into the same delete. Reading every path before approving catches it.
▸ You: the build/ folder has old output, clear it
◂ Agent: I'll clear old output and rebuild.
⚙ Run: rm -rf build/ data/
[Approve? yes / no / always]
▸ You: no. Why data/? It holds my only
copy of the survey results.
◂ Agent: You're right. Only build/ is
generated output. Revised:
⚙ Run: rm -rf build/
[Approve? yes / no / always]
▸ You: yes
Does git have a copy of this?
Before every yes, read the whole command and ask: does git have a copy of what this touches? Deletes, force-pushes, history rewrites, database drops and system-wide installs often reach past your checkpoint. They never go into an always-rule. Each one gets a fresh, careful decision.
On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.