When Google Antigravity notifications stop working, the cause is almost always one of five things: the hooks file isn't where Antigravity looks or isn't valid JSON, the session was started before you changed it, the hook runs but fails, the event you rely on doesn't exist or doesn't fire when you expect, or the operating system or phone hides the alert. Check the file with python3 -m json.tool ~/.gemini/config/hooks.json, start a new agy session, then run the hook's command by hand with sample input. If a hook is blocking commands instead, it's a PreToolUse hook that isn't printing a decision. If you use Antigravity Notifier, antigravity-notifier doctor and antigravity-notifier test cover most of this.
01Is the file in the right place, and valid?
- Right place? The global file is
~/.gemini/config/hooks.json: inconfig, inside.geminiin your home folder. A project's file is.agents/hooks.json. Both load. Where is hooks.json? has the details. - Valid JSON? No trailing commas, no comments. Run
python3 -m json.tool ~/.gemini/config/hooks.json; it prints the file back, or the line with the mistake. - Right shape? The top-level keys are named groups, and each group holds the events. A file copied from another tool's documentation, with a
"hooks"object at the top, is a different layout. Compare yours with Antigravity hooks explained.
{
"my-alerts": {
"Stop": [
{ "type": "command", "command": "/Users/you/.gemini/hooks/done.sh", "timeout": 10 }
]
}
}
02Did you start a new session?
Antigravity has no trust step, so there is nothing to approve: a hook in the global file runs from the next session, even in an untrusted workspace. But it is the next session. An agy session that was already open when you edited the file doesn't pick up the change. Quit it and start again.
03Does the hook run, and succeed?
Run the command yourself with the kind of payload Antigravity sends. Payloads are JSON on standard input, with camelCase names:
echo '{"hookEventName":"Stop","cwd":"/tmp/demo","conversationId":"test","lastUserInput":"hi"}' | ~/.gemini/hooks/done.sh
Then look for:
- Command not found. A hook may not see the same
PATHas your interactive shell. Use full paths, both for the script inhooks.jsonand for tools inside it, such as/opt/homebrew/bin/terminal-notifier. - A relative path. A path like
.gemini/hooks/done.shdepends on the folder the session started in. Use an absolute path. - Not executable.
chmod +xthe script, or call it through its interpreter (/bin/sh /path/done.sh). - A timeout. Timeouts are in seconds and the default is 30. A
curlwith no--max-timethat hangs on a bad network uses all of it. Add--max-time 10.
To see exactly what Antigravity sends, make the hook save its input once: put cat > /tmp/agy-payload.json at the top of a test script, run a turn, and read the file.
04Is a hook blocking your commands?
Antigravity is fail-closed. A PreToolUse hook that prints no decision, exits with an error or times out blocks the tool. A notification script that forgets to answer, or crashes before it does, looks like Antigravity refusing to run anything.
The fix is to make every PreToolUse script print a decision on every path, and exit 0:
echo '{"decision":"allow"}'
exit 0
allow leaves the call to Antigravity's own permission rules, as if the hook weren't there. The PreToolUse guide lists the other decisions.
05Does the event fire when you think it does?
- There is no notification or permission event. The events are
SessionStart,PreInvocation,PostInvocation,PreToolUse,PostToolUseandStop. A hook namedNotificationorPermissionRequest, copied from another tool's setup, never runs. - Most commands never ask. Interactive sessions start in Auto mode, where sandboxed "safe" commands run without asking. A hook can see every command in
PreToolUse, but it can't tell which ones will stop for you. Stopfires once per turn, not once per task. In a long back-and-forth you get an alert per reply.- The last message isn't in the
Stoppayload. A script that reads it from the payload gets nothing. It's in the conversation'stranscript_full.jsonl; see the Stop hook guide. - A
continuethat loops. If yourStophook answers{"decision":"continue",...}, Antigravity starts a new turn, andcontinuationActivestays false afterwards, so a hook that checks only that flag continues forever. - Print mode. In
agy -pnobody can answer a prompt, and aforce_askis answered with a denial.
06Is the operating system hiding it?
- macOS:
osascriptnotifications appear as Script Editor. Allow it in System Settings > Notifications, and check Focus. See the macOS guide. - Windows: check Do Not Disturb (Focus assist), and that the BurntToast module is installed for your user.
- Linux:
notify-sendneeds a notification daemon and a desktop session. Over SSH there is none. - Phone: check notification permission for the app, Focus or Do Not Disturb, and battery savers that delay background apps on Android.
07Two alerts for one moment?
Every group in every file runs. The same hook in the global file and in a project's .agents/hooks.json, or in two groups, runs twice. If you also use Google's Remote Control or a notifier app, you may get its alert as well as your hook's. Keep one per moment.
08If you use Antigravity Notifier
Two commands check most of the setup:
antigravity-notifier doctor # checks the installation
antigravity-notifier test # sends a test notification to your paired phones
If the hooks have gone missing, for example after you moved the binary or another tool rewrote the file, antigravity-notifier setup puts its antigravity-notifier group back. It refuses to change a hooks.json that isn't valid JSON, so fix the file first.
Common cases:
- Nothing on the phone while you're at the computer. That's by design. Input in the last 30 seconds on an unlocked screen means you're there, so nothing waits for the phone and tool calls aren't sent; Antigravity asks you itself. Lock the screen (macOS, Linux) or step away, or run
antigravity-notifier test. - No done card for a turn. It isn't sent while background tasks still run, or when you stopped the turn yourself, and only one is sent per execution.
- Quiet at night. Check
quiet_hoursinantigravity-notifier config show. - A script using
agy -pgets notes, not approvals. Print mode is never held, so cards arrive as notes. - Only commands wait for the phone. That's the default,
phone_approvals commands. Set it toallto also approve file writes and edits, oroff. - The desktop app or IDE. They read the same hooks file but aren't supported yet. Use
agyin a terminal.
09FAQ
My hook worked yesterday and stopped today. Why?
Check that hooks.json is still valid JSON: one stray comma from a later edit stops it loading. If another tool rewrote the file, your group may be gone. If you updated Antigravity, save a payload (step 3) and compare it with what your script expects: Google's documentation lags behind what agy sends in places.
Do I need to trust or approve a hook?
No. Antigravity has no trust step. If a hook doesn't run, it isn't waiting for approval; the file, the session or the command is the problem.
Can I test a hook without waiting for Antigravity?
Yes. Pipe sample JSON into the command, as in step 3. For Antigravity Notifier, antigravity-notifier test sends a test push.
Does --dangerously-skip-permissions turn hooks off?
No. It doesn't skip hooks, so your notification hooks, and any PreToolUse hook that blocks, still run.