Skip to content

Instantly share code, notes, and snippets.

View thebillzh's full-sized avatar

billzh thebillzh

View GitHub Profile
@thebillzh
thebillzh / language-guard.sh
Created March 22, 2026 17:42
language-guard stop hook
#!/bin/bash
# Claude Code Stop hook — warn when response contains deflecting language
# Non-destructive: exit 2 sends feedback to Claude for self-correction;
# stop_hook_active check prevents infinite revision loops.
INPUT=$(cat)
# Prevent infinite loop: if already in a stop-hook correction cycle, let it go
STOP_ACTIVE=$(/usr/bin/python3 -c "import sys,json; print(json.load(sys.stdin).get('stop_hook_active', False))" <<< "$INPUT" 2>/dev/null)
if [ "$STOP_ACTIVE" = "True" ]; then