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(safety): add bash fallback for JSON parsing and output in rm-rf hook

auroracapitald99af82ce9c5
diff --git a/claude-ops/bin/ops-no-rm-rf-anchor b/claude-ops/bin/ops-no-rm-rf-anchor
index 63f8c164..04045c29 100755
--- a/claude-ops/bin/ops-no-rm-rf-anchor
+++ b/claude-ops/bin/ops-no-rm-rf-anchor
@@ -28,6 +28,10 @@ try:
except Exception:
pass
' "$INPUT" 2>/dev/null || true)
+ # Bash-only fallback when python3 is unavailable or fails.
+ if [[ -z "$parsed" ]]; then
+ parsed=$(echo "$INPUT" | sed -n 's/.*"command"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')
+ fi
[[ -n "$parsed" ]] && CMD="$parsed"
fi
@@ -114,7 +118,9 @@ EOF
if [[ -n "$DANGER" ]]; then
reason="Blocked rm -rf against dangerous anchor: '$DANGER'. This can destroy the system, your home directory, or the calling repo. Use a specific subpath (e.g. ./node_modules, /tmp/foo). To override (NOT RECOMMENDED) set CLAUDE_PLUGIN_OPTION_NO_RM_RF_ANCHOR=false."
- python3 -c '
+ # Emit JSON on stdout. Use python3 for safe JSON escaping; fall back to printf.
+ if command -v python3 >/dev/null 2>&1; then
+ python3 -c '
import json, sys
print(json.dumps({
"hookSpecificOutput": {
@@ -123,6 +129,11 @@ print(json.dumps({
"permissionDecisionReason": sys.argv[1]
}
}))' "$reason"
+ else
+ # Bash-only fallback: escape double quotes and backslashes in reason.
+ escaped_reason=$(printf '%s' "$reason" | sed 's/\\/\\\\/g; s/"/\\"/g')
+ printf '{"hookSpecificOutput": {"hookEventName": "PreToolUse", "permissionDecision": "deny", "permissionDecisionReason": "%s"}}\n' "$escaped_reason"
+ fi
exit 0
fi