#!/bin/bash # .git/hooks/post-commit # Auto-regenerate codebase index after commits OUTPUT=".context/relationships.json" # Only run if indexer is installed if command -v codebase-indexer &>/dev/null; then echo "Updating codebase index..." codebase-indexer -root . -out "$OUTPUT" 2>/dev/null # Optionally stage the updated index (uncomment if you want it tracked) # git add "$OUTPUT" fi