#!/usr/bin/env bash
# PostToolUse hook (Edit|Write) — nudge to update PROGRESS.md when runtime code changes.
# Reads the tool call JSON from stdin; if the touched file is under src/ or tools/,
# emit a one-line reminder. Non-zero/empty output otherwise.
input="$(cat)"
path="$(printf '%s' "$input" | grep -o '"file_path"[[:space:]]*:[[:space:]]*"[^"]*"' | head -1 | sed 's/.*"file_path"[[:space:]]*:[[:space:]]*"//;s/"$//')"
case "$path" in
  *"/src/"*|*"/tools/"*)
    echo "Edited runtime code ($path). If a PLAN.md task finished, run /report to update PROGRESS.md and flip its status."
    ;;
esac
exit 0
