beta

agex Session Summary Hook

Hooks

End-of-session hook that generates a summary of changes made to agent config files during the session.

1903/26/2026
json1 file
hooks.json622 B
{
  "PreCompact": [
    {
      "matcher": ".*",
      "hooks": [
        {
          "type": "command",
          "command": "if [ -f agex.toml ]; then CHANGED=$(git diff --name-only HEAD 2>/dev/null | grep -E '(CLAUDE\.md|AGENTS\.md|GEMINI\.md|\.cursorrules|SKILL\.md|\.mcp\.json|hooks\.json)' || true); if [ -n "$CHANGED" ]; then echo '--- agex Session Summary ---'; echo 'Agent config files changed this session:'; echo "$CHANGED" | while read f; do echo "  • $f"; done; echo ''; echo 'To push updates: agex push <file>'; echo 'To check status: agex status'; echo '---'; fi; fi; exit 0"
        }
      ]
    }
  ]
}