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: drop unsafe sed JSON fallback + jq guard in setup (codex/blocksorg)

auroracapitalaad3e1b0f7cc
diff --git a/claude-ops/bin/ops-no-rm-rf-anchor b/claude-ops/bin/ops-no-rm-rf-anchor
index 9031dbbc..193da2c9 100755
--- a/claude-ops/bin/ops-no-rm-rf-anchor
+++ b/claude-ops/bin/ops-no-rm-rf-anchor
@@ -28,21 +28,11 @@ try:
except Exception:
pass
' "$INPUT" 2>/dev/null || true)
- # Bash-only fallback when python3 is unavailable or fails.
- # Safety: the regex below stops at the first "\"" inside a JSON string, so it
- # may TRUNCATE a value like `rm -rf \"build out\" /` to `rm -rf \`, hiding
- # the dangerous `/` anchor from downstream grep checks. To preserve the
- # fail-closed invariant (when in doubt, scan the raw INPUT, which still
- # contains every dangerous substring), only swap CMD when the parsed value
- # is well-formed: non-empty AND not a truncation indicator (no trailing
- # backslash) AND not obviously shorter than the raw input's command region.
- if [[ -z "$parsed" ]]; then
- parsed=$(echo "$INPUT" | sed -n 's/.*"command"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')
- # Reject truncated extractions: trailing `\` means we cut on an escaped quote.
- if [[ "$parsed" == *\\ ]]; then
- parsed=""
- fi
- fi
+ # NO sed fallback. A pure-shell JSON parser cannot safely handle escaped
+ # quotes or multiple "command" keys, and getting it wrong on a security
+ # hook means dangerous commands slip past. If python3 fails or is absent,
+ # we keep CMD == raw INPUT — downstream grep still sees `rm -rf /` etc.
+ # in the raw JSON string, preserving fail-closed behavior.
[[ -n "$parsed" ]] && CMD="$parsed"
fi
diff --git a/claude-ops/skills/setup/SKILL.md b/claude-ops/skills/setup/SKILL.md
index 3e87607d..ae42a6a2 100644
--- a/claude-ops/skills/setup/SKILL.md
+++ b/claude-ops/skills/setup/SKILL.md
@@ -651,6 +651,19 @@ On `Skip`: write `recap.statusline_wired = false` and continue to Step 2d.4.
On `Add to Claude Code statusLine`:
+0. **Pre-check — `jq` availability**: Step 2d.3b uses `jq` for every settings.json read/merge. If `jq` is missing, all subsequent `jq` calls silently fail (suppressed by `2>/dev/null`), `existing` evaluates to empty, and the merge step is skipped — but the success path would still record `recap.statusline_wired = true` in prefs, leaving the user in an inconsistent state. Guard up front:
+
+ ```bash
+ if ! command -v jq >/dev/null 2>&1; then
+ echo "○ jq not installed — cannot merge statusLine automatically."
+ echo " Install jq (e.g. brew install jq, apt install jq) and re-run /ops:recap configure."
+ # Do NOT mark statusline_wired=true. Treat as Skip:
+ # write recap.statusline_wired = false in Step 2d.5 and continue to Step 2d.4.
+ fi
+ ```
+
+ Only continue with steps 1–5 below when `jq` is present.
+
1. Detect existing `statusLine` entry:
```bash