Hooks..

CI runs. Local Git hooks. Cursor also has hooks built into their agent. Other agent APIs probably have something similar.