Skip to main content
Add hooks to .gemini/settings.json. AfterAgent notifies after a response; Notification forwards Gemini CLI system alerts.
Gemini CLI was replaced by Antigravity CLI for unpaid-tier and Google One users on June 18, 2026. Gemini CLI remains available to some enterprise customers and paid API-key users. If you are moving to Antigravity CLI, see the Antigravity CLI hook guide and Google’s migration guide.
--background lets the notification send continue if Gemini CLI or its hook is interrupted. Remove the flag if you want the hook to wait for the send to finish. See send-text for details. Gemini CLI hooks run synchronously, but with --background they wait only until Midway starts the detached send. A Notification hook fires for system alerts, not necessarily every time the agent asks a free-form question.