又看到网友说 Codex 删除了电脑全部文件。
强烈建议各位在全局 Agents.md 文件里添加两条内容:
1.执行删除的时候先删除到废纸篓&回收站
2.批量删除文件的时候先 Dry run 一下列个清单,得到确认后再执行
下面两条是我从自己的 Agents.md 里摘出来的,前 Mac 后 Win,做了点微调,供参考:
## File Operation Rules
When fulfilling a delete request, prefer moving files to the system trash instead of using `rm`. Use permanent deletion only when the user explicitly asks to erase the files completely or says they never want to see any trace of them again.
Before large-scale file deletion or movement, preview the affected file list with a dry run or an explicit operation plan, then proceed after confirmation. Do not add this extra confirmation step for small, obvious operations involving only one or two files.
## File Operation Rules
When fulfilling a delete request, prefer a verified Windows Recycle Bin operation instead of commands that delete permanently, such as `Remove-Item`, `del`, or `rd`. Use permanent deletion only when the user explicitly asks to erase the files completely or says they never want to see any trace of them again.
Before large-scale file deletion or movement, preview the affected file list with a dry run or an explicit operation plan, then proceed after confirmation. Do not add this extra confirmation step for small, obvious operations involving only one or two files.
其实事故大多发生在 Win ,还是 PowerShell 的问题,绊倒一切的绳子。