beta

agex Session Summary Hook

Hooks

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

2003/26/2026

Version 1

Published

Initial version

Created 3/26/2026

Initial version — no previous version to compare

Hook Script
{
  "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"
        }
      ]
    }
  ]
}