Skip to main content
Antigravity CLI supports lifecycle hooks, including Stop. There is no general hook event for when the agent needs user input. For a workspace-level hook, create .agents/hooks.json in the project root. The example calls a small shell script so it can send the Midway notification and return the JSON decision Antigravity expects from a Stop hook.
Create .agents/hooks/midway-stop.sh:
The script returns allow even if sending the notification fails, so a Midway error does not prevent the agent from stopping. Make sure midway is on the hook process’s PATH and the working directory has a usable midway.yaml. See Midway configuration for routing notifications. See Google’s Antigravity hooks reference for other events, handler formats, and app-specific locations, and its Gemini CLI migration guide.