To get Google Antigravity push notifications with ntfy, install the ntfy app on your phone, subscribe to a topic with a hard-to-guess name, and add a Stop hook to ~/.gemini/config/hooks.json that runs curl -s -o /dev/null -d "Antigravity has finished" https://ntfy.sh/your-topic. It fires when a turn ends, from the next agy session, with no trust step. A PreToolUse hook can also tell you when Antigravity asks a question, as long as it always prints a decision. It's free, takes about ten minutes, and works on Mac, Windows and Linux, including servers. It's one-way: you can't answer from ntfy.
01Set up ntfy on your phone
- Install ntfy from the App Store or Google Play.
- Tap + and subscribe to a topic. Pick a long random name, such as
agy-7f3k9q2m. On the publicntfy.shserver, anyone who knows the topic can read and post to it, so the name works like a password. - Test it from your computer:
curl -d "Hello from my computer" https://ntfy.sh/agy-7f3k9q2m
The message should arrive on your phone within a second or two.
02A hook script
A script keeps hooks.json short and lets you add the project name. Save this as ~/.gemini/hooks/ntfy.sh and make it executable (chmod +x ~/.gemini/hooks/ntfy.sh):
#!/bin/sh
# Antigravity hook: post a short message to ntfy.
# Stop: "finished". PreToolUse: alert on questions, and ALWAYS print a decision.
TOPIC="agy-7f3k9q2m"
input=$(cat)
field() { printf '%s' "$input" | python3 -c "import json,sys; d=json.load(sys.stdin); print($1)" 2>/dev/null; }
event=$(field 'd.get("hookEventName","")')
project=$(field '__import__("os").path.basename(d.get("cwd",""))')
send() {
curl -s -o /dev/null --max-time 10 \
-H "Title: $1" -H "Priority: $2" -H "Tags: robot" \
-d "$3" "https://ntfy.sh/$TOPIC" || true
}
case "$event" in
Stop)
request=$(field '(d.get("lastUserInput") or "")[:200]')
send "Antigravity finished: $project" default "${request:-Turn complete}" ;;
PreToolUse)
tool=$(field '(d.get("toolCall") or {}).get("name","")')
if [ "$tool" = "ask_question" ]; then
send "Antigravity has a question: $project" high "It is waiting for your answer."
fi
echo '{"decision":"allow"}' ;;
*)
# Unreadable input: answer anyway, so a tool is never blocked.
echo '{"decision":"allow"}' ;;
esac
exit 0
What it does:
- On
Stopit sends "Antigravity finished" with the project folder in the title and the start of your last request as the body, so you know which job it was. Antigravity's own last message isn't in theStoppayload; it's in the conversation'stranscript_full.jsonl(the Stop hook guide shows how to read it). - On
PreToolUseit sends a high-priority push only forask_question, the tool Antigravity uses to ask you something, and then prints{"decision":"allow"}. That line is not optional. Antigravity is fail-closed: aPreToolUsehook that prints no decision, exits with an error or times out blocks the tool.allowleaves the call to Antigravity's own rules. -s -o /dev/nullkeeps ntfy's JSON reply off the hook's output, and|| truewith--max-time 10means a bad network can't break or stall the hook.
03Add the hooks
Add a group to ~/.gemini/config/hooks.json (create the file if needed; if it already has groups, add this as another top-level key). Use the absolute path to your script:
{
"ntfy-alerts": {
"Stop": [
{ "type": "command", "command": "/Users/you/.gemini/hooks/ntfy.sh", "timeout": 15 }
],
"PreToolUse": [
{ "matcher": "*", "hooks": [ { "type": "command", "command": "/Users/you/.gemini/hooks/ntfy.sh", "timeout": 15 } ] }
]
}
}
Timeouts are in seconds (the default is 30). Start a new agy session: one that was already running doesn't pick up the change. There's nothing to approve.
If you only want "finished", leave out the PreToolUse entry. It runs before every tool call, so it adds a little time to each step even when it sends nothing.
To test without waiting for Antigravity:
echo '{"hookEventName":"Stop","cwd":"/tmp/demo","lastUserInput":"Fix the tests"}' | ~/.gemini/hooks/ntfy.sh
04Windows
In PowerShell, Invoke-RestMethod does the same job. We haven't tested Antigravity's hooks on Windows ourselves, so check it on your machine. Save as C:\Users\you\.gemini\hooks\ntfy.ps1:
$topic = "agy-7f3k9q2m"
$decision = $false
try {
$payload = [Console]::In.ReadToEnd() | ConvertFrom-Json
$project = Split-Path -Leaf $payload.cwd
if ($payload.hookEventName -eq "Stop") {
Invoke-RestMethod -Method Post -Uri "https://ntfy.sh/$topic" -Headers @{ Title = "Antigravity finished: $project" } -Body "Turn complete" -TimeoutSec 10 | Out-Null
} elseif ($payload.hookEventName -eq "PreToolUse") {
$decision = $true
if ($payload.toolCall.name -eq "ask_question") {
Invoke-RestMethod -Method Post -Uri "https://ntfy.sh/$topic" -Headers @{ Title = "Antigravity has a question: $project"; Priority = "high" } -Body "It is waiting for your answer." -TimeoutSec 10 | Out-Null
}
}
} catch { $decision = $true }
if ($decision) { Write-Output '{"decision":"allow"}' }
exit 0
and use this command in both entries (backslashes doubled in JSON):
"command": "powershell -NoProfile -ExecutionPolicy Bypass -File C:\\Users\\you\\.gemini\\hooks\\ntfy.ps1"
05Keeping it private
Your push can include the project name and the start of your request. On the public server, anyone with the topic name can read that. To tighten it:
- Use a long random topic and don't share it.
- Send less. Drop the body and send only the title, or only "Antigravity needs you".
- Use access control. ntfy supports access tokens: on ntfy.sh with an account, or on a server you host yourself. Add
-H "Authorization: Bearer tk_..."to thecurlline. - Self-host ntfy if work projects must not leave your network.
06What ntfy can't do
ntfy tells you Antigravity is done or waiting. It can't send your answer back into the session, so you still walk back to the keyboard. And because Antigravity has no "waiting for approval" event, a hook can't tell you reliably that a command is waiting: in Auto mode most commands run without asking, and the hook sees them all the same way.
If you want to answer from the phone, there are two ready-made options:
- Google's Remote Control, free and built in: turn it on in the desktop app (Settings, Application, Enable Remote Control) or with
agy --remote-control, then use the dashboard in your phone's browser with the same Google account. It runs through the session on your computer, so a session that ends shows as offline. - Antigravity Notifier: a free
antigravity-notifiercommand line tool for Mac, Windows (beta) and Linux plus an iPhone or Android app. It adds its ownantigravity-notifiergroup tohooks.json, leaves yourntfy-alertsgroup alone, and lets you allow or deny commands while you're away, answer Antigravity's questions and send the next instruction. It works over SSH and in any terminal; the desktop app and IDE aren't supported yet. It's independent, by TouchTap Ltd, and not affiliated with Google. See pricing.
Every option compared puts ntfy and the alternatives side by side.
07FAQ
Is ntfy free?
The public ntfy.sh server is free for normal use, and ntfy is open source if you want to host your own. Paid plans add things like reserved topics and higher limits.
Why are my commands blocked after adding the hook?
Your PreToolUse entry ran a script that didn't print a decision. Antigravity blocks the tool when that happens. Check that the script prints {"decision":"allow"} for PreToolUse on every path, or remove the PreToolUse entry.
Why don't I get any pushes?
Start a new agy session, check hooks.json with python3 -m json.tool ~/.gemini/config/hooks.json, and run the script by hand with the test line above. If that works but Antigravity's doesn't, check the path in command is absolute.
Will I get a push for every turn?
Yes, Stop fires once per turn. If that's too many, add a condition to the script, such as only sending when the turn took a while.
Does this work on a server over SSH?
Yes. The hook runs where agy runs and needs only outbound HTTPS, so it's one of the best options for servers and tmux sessions.