Cursor Agent Hooks: Lint and Build Checks After Each Turn
How to wire a Cursor stop hook that runs pnpm lint and pnpm build after every agent turn, returns followup_message with captured output on failure, and avoids silent breakage from Cursor's bundled Node on PATH—plus loop limits, debug toggles, and when to choose postToolUse or sessionEnd instead.