The guardrail is easily bypassed and allows commands when parsing fails
Source references: 4The documentation claims all git push variants and several destructive commands are blocked, but the script only searches for fixed text fragments. Equivalent forms such as `git -C repo push`, extra whitespace, `git clean -df`, or long options do not match. It also relies on jq without checking success; extraction failure can leave COMMAND empty and the script still returns 0.
A user may believe dangerous Git operations are reliably prohibited while Claude can still push, permanently remove untracked files, or discard work through uncovered valid syntax.
The skill claims to block every `git push` variant, but the script only searches the full command for a short list of fixed regex fragments. Forms that insert `-C repo` between `git` and `push`, or vary whitespace or option order, may not match and can exit 0. It also relies on `jq` to extract the command without checking whether parsing succeeded; missing `jq`, invalid JSON, or a missing field may produce an empty value that reaches `exit 0`. This can give users more confidence than the implementation warrants. Users can ask for structured command parsing, fail-closed error handling, and tests of alternate command forms.
- `git push` (all variants including `--force`)- `git reset --hard`- `git clean -f` / `git clean -fd`- `git branch -D`- `git checkout .` / `git restore .`Show 3 other places
INPUT=$(cat)COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command')DANGEROUS_PATTERNS=( "git push" "git reset --hard" "git clean -fd" "git clean -f" "git branch -D" "git checkout \." "git restore \." "push --force" "reset --hard")for pattern in "${DANGEROUS_PATTERNS[@]}"; do if echo "$COMMAND" | grep -qE "$pattern"; then echo "BLOCKED: '$COMMAND' matches dangerous pattern '$pattern'. The user has prevented you from doing this." >&2 exit 2 fidoneexit 0