Hooks is an official documented feature for quite a long time now https://code.claude.com/docs/en/hooks