Skip to content

Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.

Fix the rm -rf guard, which blocked nothing on stock macOS (#826)

Aurora Capital93c3485135ea
diff --git a/claude-ops/bin/ops-no-rm-rf-anchor b/claude-ops/bin/ops-no-rm-rf-anchor
index 193da2c9..22305ac2 100755
--- a/claude-ops/bin/ops-no-rm-rf-anchor
+++ b/claude-ops/bin/ops-no-rm-rf-anchor
@@ -83,24 +83,35 @@ DANGER=$(set -f; while IFS= read -r seg; do
rest=$(echo "$seg" | sed -E 's/^.*[[:space:]]?rm([[:space:]]+|$)//')
# Tokenize on spaces (best-effort — won't perfectly handle quoted-with-spaces but covers the patterns specified).
for tok in $rest; do
+ # NOTE: no `case` inside this block. This whole loop runs inside a
+ # DANGER=$( ... ) command substitution, and under bash 3.2 a case pattern's
+ # unbalanced `)` closes that substitution early. The file then fails to
+ # parse, the hook emits nothing, and a missing deny reads as allow — so the
+ # guard silently stopped blocking anything. bash 3.2 is Apple's /bin/bash,
+ # so that was every stock macOS install. Keep these as plain string tests.
+
# Skip flags.
- case "$tok" in
- -*) continue ;;
- esac
+ if [ "${tok#-}" != "$tok" ]; then
+ continue
+ fi
# Strip surrounding quotes for comparison.
bare="${tok%\"}"; bare="${bare#\"}"
bare="${bare%\'}"; bare="${bare#\'}"
- case "$bare" in
- "" | "/" | "/*" | "/." | \
- "~" | "~/" | "~/*" | \
- '$HOME' | '$HOME/' | '$HOME/*' | \
- ".." | "../" | "../*" | \
- ".")
- DANGER="$bare"
+ # Literal anchors, matching the original quoted case patterns exactly:
+ # a quoted pattern in `case` is literal, so "/*" meant the two characters
+ # `/` and `*`, never a glob over everything under root.
+ is_danger=0
+ for anchor in '' '/' '/*' '/.' '~' '~/' '~/*' '$HOME' '$HOME/' '$HOME/*' '..' '../' '../*' '.'; do
+ if [ "$bare" = "$anchor" ]; then
+ is_danger=1
break
- ;;
- esac
+ fi
+ done
+ if [ "$is_danger" -eq 1 ]; then
+ DANGER="$bare"
+ break
+ fi
# Also catch quoted $HOME variants where the shell hasn't expanded them.
if [[ "$tok" == '"$HOME"' || "$tok" == '"$HOME"/' || "$tok" == '"$HOME"/*' ]]; then
DANGER="$tok"; break