fix: replace find -delete with find -exec rm to avoid Safety Net false positive#612
Open
boinger wants to merge 1 commit intogarrytan:mainfrom
Open
fix: replace find -delete with find -exec rm to avoid Safety Net false positive#612boinger wants to merge 1 commit intogarrytan:mainfrom
boinger wants to merge 1 commit intogarrytan:mainfrom
Conversation
…e positive
The preamble session cleanup command find -delete triggers
claude-code-safety-net rule against find with delete flag,
blocking every gstack skill for Safety Net users.
Replace with find -exec rm -f -- {} + which is functionally
identical (batched deletion, handles spaces) but not flagged
by Safety Net (which only blocks -delete and -exec rm -rf).
25 of 30 skills affected. The 5 unchanged (careful, freeze,
guard, unfreeze, gstack-upgrade) have no preamble bash block.
Fixes garrytan#474
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
find -deletewithfind -exec rm -f -- {} +in preamble session cleanupDetails
The preamble runs on every skill invocation to clean up stale session files older than 2 hours. The
-deleteflag triggers Safety Net's rule against destructive find commands, blocking the entire skill before it starts.-exec rm -f -- {} +is functionally identical: batches deletions, handles filenames with spaces, and the--separator prevents dash-prefixed filenames from being misinterpreted as flags.Verified against Safety Net's find.ts source: it blocks
-deleteand-exec rm -rfbut not-exec rm -f. Ran the actualanalyzeFind()function against both commands to confirm.Test plan
bun testpasses (exit 0)bun run gen:skill-docs --dry-runpassesfind.*-deletein any generated SKILL.mdfind -exec rm -f --present in all 25 preamble-enabled skillsFixes #474