beta

agex Auto-Sync Hook

Hooks

Post-session hook that detects changes to tracked agent files and offers to push updates to agex.dev.

1503/26/2026
json1 file
hooks.json456 B
{
  "PostToolUse": [
    {
      "matcher": "Write|Edit",
      "hooks": [
        {
          "type": "command",
          "command": "FILE=$(jq -r '.tool_input.file_path // empty'); if [ -f agex.toml ] && echo "$FILE" | grep -qE '(CLAUDE\.md|AGENTS\.md|GEMINI\.md|\.cursorrules|SKILL\.md|\.mcp\.json|hooks\.json)'; then echo "NOTE: Agent config file changed: $FILE. Run 'agex push $FILE' to update on agex.dev."; fi; exit 0"
        }
      ]
    }
  ]
}