Answer
Hooks are resources (usually Jobs or Pods) that run at specific points in a sync to perform tasks like migrations, tests, or notifications. They're marked with `argocd.argoproj.io/hook` and a phase (PreSync, Sync, PostSync, SyncFail, Skip). ArgoCD runs them at the right time and tracks their success as part of the sync.
metadata:
annotations:
argocd.argoproj.io/hook: PreSyncReal-world example A PreSync Job runs database migrations before the new application version is deployed.