#!/bin/bash # .claude/hooks/stop-check-sync.sh # arcrun Stop hook # # 職責:session 結束前檢查 code 變動是否有對應的 SDD / tasks.md 更新 # 退出 code:不 block,只警告 set -o pipefail # 檢查 .agents/specs 下本次 session 是否有變動 SPECS_DIFF=$(git -C "$(pwd)" status --porcelain -- '.agents/specs/' 2>/dev/null | head -20) CODE_DIFF=$(git -C "$(pwd)" status --porcelain -- '*.go' '*.ts' '*.tsx' '*.py' 'cypher-executor/' 'registry/' 'cli/' 2>/dev/null | head -20) if [[ -n "$CODE_DIFF" && -z "$SPECS_DIFF" ]]; then cat >&2 </dev/null | head -5) if [[ -n "$TASKS_DIFF" ]]; then cat >&2 <