All guides

Google Antigravity notifications on macOS

Updated 27 November 2026 · 6 min read

On macOS, the simplest way to get a notification when Google Antigravity finishes is a Stop hook in ~/.gemini/config/hooks.json that runs a script calling osascript -e 'display notification ...'. It works in any terminal you run agy in, and it runs from your next session with no trust step. Allow notifications for Script Editor in System Settings, or the first alert is often dropped without a word. For a clickable alert that brings your terminal forward, use terminal-notifier from Homebrew instead.

01The hooks file on a Mac

Antigravity's global hooks file is ~/.gemini/config/hooks.json, which is /Users/you/.gemini/config/hooks.json. The agy command line, the desktop app and the IDE all read it. A project can also have .agents/hooks.json; both files load and both fire.

The top-level keys are named groups. Put your alerts in a group of their own, such as my-alerts, so they sit beside anything else in the file (including Antigravity Notifier's antigravity-notifier group) without getting in its way.

02An osascript hook

Save this as ~/.gemini/hooks/done.sh:

#!/bin/sh
# Antigravity Stop hook: a macOS notification with the project folder's name.
input=$(cat)
project=$(printf '%s' "$input" | python3 -c 'import json,os,sys; print(os.path.basename(json.load(sys.stdin).get("cwd","")))' 2>/dev/null)
osascript -e "display notification \"Antigravity has finished\" with title \"Antigravity: $project\" sound name \"Glass\"" >/dev/null 2>&1
exit 0

Make it executable:

chmod +x ~/.gemini/hooks/done.sh

Then add the group to ~/.gemini/config/hooks.json, with your own home folder in the path:

{
  "my-alerts": {
    "Stop": [
      { "type": "command", "command": "/Users/you/.gemini/hooks/done.sh", "timeout": 10 }
    ]
  }
}

The hook gets a JSON payload on standard input with the session's folder as cwd, which the script turns into the title, so you can tell sessions apart. If python3 isn't installed, macOS offers to install the command line developer tools the first time it runs; or drop the project line and use a fixed title.

Start a new agy session. A session that was already running doesn't pick up the change.

03Allow Script Editor to notify

osascript shows its notifications as Script Editor. On a fresh Mac the first one is often dropped silently. To fix it:

  1. Run osascript -e 'display notification "test" with title "Antigravity"' in Terminal.
  2. Open System Settings > Notifications, find Script Editor, and turn on Allow Notifications. Choose Alerts if you want it to stay on screen until you dismiss it.
  3. Check that a Focus mode isn't hiding it (see below).

04Clickable notifications with terminal-notifier

terminal-notifier (brew install terminal-notifier) adds a group, so a new alert replaces the old one, and a click action that brings your terminal to the front. Replace the osascript line in done.sh with:

/opt/homebrew/bin/terminal-notifier -title "Antigravity: $project" -message 'Antigravity has finished' -group antigravity -activate com.apple.Terminal >/dev/null 2>&1

Swap the bundle id for your terminal: com.googlecode.iterm2 for iTerm2, com.mitchellh.ghostty for Ghostty or com.microsoft.VSCode for VS Code. Use the full path, since a hook may not see the same PATH as your shell. On an Intel Mac, Homebrew lives in /usr/local/bin.

05When Antigravity asks you something

Antigravity has no notification or permission event. A question reaches a hook as a PreToolUse call to the ask_question tool, and that's the one to alert on. The catch: Antigravity is fail-closed, so a PreToolUse hook that prints no decision, fails or times out blocks the tool. Always print {"decision":"allow"}, which leaves the call to Antigravity's own rules.

Save as ~/.gemini/hooks/tool.sh and make it executable:

#!/bin/sh
# Antigravity PreToolUse hook: alert on questions, then ALWAYS allow.
input=$(cat)
tool=$(printf '%s' "$input" | python3 -c 'import json,sys; print((json.load(sys.stdin).get("toolCall") or {}).get("name",""))' 2>/dev/null)
if [ "$tool" = "ask_question" ]; then
  osascript -e 'display notification "Antigravity has a question for you" with title "Antigravity"' >/dev/null 2>&1
fi
echo '{"decision":"allow"}'
exit 0

and add it next to Stop in your group:

"PreToolUse": [
  { "matcher": "*", "hooks": [ { "type": "command", "command": "/Users/you/.gemini/hooks/tool.sh", "timeout": 10 } ] }
]

Alerting on every run_command is possible but noisy: interactive sessions start in Auto mode, where sandboxed "safe" commands run without asking, and the hook can't tell which ones will stop for you.

06A sound only

If you'd rather hear than see, put this in the script instead of the notification:

afplay /System/Library/Sounds/Glass.aiff

07Focus modes and Do Not Disturb

A Focus mode hides notifications from apps that aren't on its allowed list. If alerts appear when Focus is off and vanish when it's on, open System Settings > Focus, choose the mode, and add Script Editor (for osascript) or terminal-notifier to its allowed apps. Leave them off the list if you want Antigravity to stay quiet while you focus.

08Or let antigravity-notifier do it

A Mac notification stays on the Mac. To get the alert on your phone and answer it there, Antigravity Notifier's free antigravity-notifier tool sets up the hooks for you, on Mac, Windows and Linux:

curl -fsSL https://antigravitynotifier.com/install.sh | sh

or with Homebrew: brew trust --formula touch-tap/tap/antigravity-notifier && brew install touch-tap/tap/antigravity-notifier. Pairing adds one named group, antigravity-notifier, to ~/.gemini/config/hooks.json, keeps a one-time backup and leaves your own groups alone.

With the iPhone or Android app paired you get "Antigravity has finished" with its last message, commands to allow or deny while you're away, Antigravity's questions to answer, and a box for the next instruction. On a Mac it counts a locked screen as away straight away, and if you typed in the last 30 seconds on an unlocked screen nothing waits for the phone. On iPhone a lock screen card shows the current step and the files and lines changed. It works with agy in any terminal; the desktop app and IDE aren't supported yet.

Antigravity Notifier is independent, made by TouchTap Ltd and not affiliated with Google. Google's free Remote Control is the other way to reach your phone, from its browser. See pricing for the apps.

09FAQ

Does Antigravity show its own macOS notifications?

We haven't verified what the desktop app or the IDE show on their own. In the agy command line, a hook is the dependable way to get a notification.

My script works in Terminal but not from Antigravity. Why?

Start a new session first: changes take effect from the next one. Then check hooks.json is valid JSON (python3 -m json.tool ~/.gemini/config/hooks.json), the path in command is absolute, and the script is executable.

Why did my commands stop running after I added a hook?

A PreToolUse hook that prints no decision blocks the tool. Make sure the script ends with echo '{"decision":"allow"}' and exits 0, whatever happens before that line.

Do these notifications reach my iPhone?

No. A macOS notification stays on the Mac. For your phone, use Remote Control, ntfy, a chat app or Antigravity Notifier.

Antigravity Notifier Get a push on your phone when Antigravity finishes or needs you, then allow, deny or answer from there. The antigravity-notifier command line tool is free on Mac, Windows and Linux.