/careful no longer asks before deleting a file inside another worktree of the same repo (#4827) (#4834)

/careful no longer asks before every plain `rm` of a file inside another
`git worktree` of the same repository, so people who run several
worktrees side by side stop clicking through a prompt on each cleanup.

It keeps the safety check quiet only where it was wrong (gstack's goal:
guards that stop real mistakes, not routine work), and every other
delete still asks.

Nothing to do.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: p1/adversarial-native#1 reader=adversarial-native
Review-Finding: p1/adversarial-native#2 reader=adversarial-native
Review-Finding: p2/red-team#1 reader=red-team
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-25 18:47:20 +00:00
1 parent 8aafd408e2
commit a48df18f51
4 files changed
+232 -3

No files matched your search

+1 -1
View File
@@ -1501,7 +1501,7 @@ Four skills that add safety rails to any Claude Code session. They work via Clau
Say "be careful" or run `/careful` when you're working near production, running destructive commands, or just want a safety net. Every Bash and PowerShell command gets checked against known-dangerous patterns:
- `rm -rf` / `rm -r` of anything that isn't scratch — recursive delete
- `rm`, `find -delete`, `rsync --delete`, `shred` or `unlink` outside the session folder, or through a variable that may be unset — files git can't bring back
- `rm`, `find -delete`, `rsync --delete`, `shred` or `unlink` outside the session folder, or through a variable that may be unset — files git can't bring back (a plain `rm` or `unlink` of a file inside another `git worktree` of the same repository doesn't ask)
- SQL `DROP TABLE` / `DROP DATABASE` / `TRUNCATE` run by a database client — data loss
- `git push --force` / `-f` / `+ref` / `--force-with-lease` and remote branch deletes — history rewrite
- `git reset --hard`, `checkout -- paths`, `checkout -f`, `switch -f`, `restore`, `clean -f` — only when the tree really has uncommitted work they would discard; `stash drop` and `worktree remove --force` always