#!/usr/bin/env bash # Blockiert git commit und git push, solange main ausgecheckt ist. befehl=$(node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{console.log(JSON.parse(s).tool_input?.command??"")}catch{console.log("")}})') if echo "$befehl" | grep -Eq 'git (commit|push)'; then branch=$(git -C "$CLAUDE_PROJECT_DIR" branch --show-current) if [ "$branch" = "main" ]; then echo "Du stehst auf main. Lege zuerst einen Branch an: git switch -c feat/" >&2 exit 2 fi fi exit 0