This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |