There are two ways to run Google Antigravity over SSH: install the agy command line on the remote machine and run it in your own ssh session, or connect the Antigravity desktop app to the host in an SSH window. Either way the agent, its commands and its hooks run on the remote machine, so a desktop-alert hook fires on the server where nobody sees it. What does reach you is anything sent over the network: a push from a hook, which needs only outbound HTTPS from the server, or Google's Remote Control in a browser. Antigravity Notifier works the same way, sending pushes from the host to your phone.
01Two ways to use Antigravity over SSH
Google's SSH documentation describes both.
The agy command line in your own ssh session. You install the Antigravity CLI on the host and run agy there, as you would locally. When agy detects it is running over SSH it can't open a browser for sign-in, so it prints a URL to open on your own computer and asks you to paste back a code.
The desktop app's SSH windows. The Antigravity App (v2.33.0 or later, on macOS, Windows or Linux) can connect to a remote machine and open it in its own window, marked (SSH: <host>) in the title bar. The host must be 64-bit Linux (x86_64 or arm64) with glibc 2.26 or later; macOS, Windows and musl-based Linux such as Alpine aren't supported as hosts. Antigravity installs its server on the host over OpenSSH, and projects, agents, terminals and the sandbox all run there.
02What keeps running when you disconnect
This is where the two differ.
SSH windows in the app. Google's docs say running agents keep working if you close the window, if your laptop goes to sleep, or if the network drops. The window reconnects when it can, and you can reconnect at any time. Only Stop SSH Server… (in the sidebar or command palette, or the Workspace menu on Windows and Linux) stops the agents and the server on the host.
agy in your own ssh session. Here agy is an ordinary terminal program on the host. If the SSH connection drops, the shell and agy go with it unless you started them inside something that survives a disconnect, such as tmux or screen. Antigravity notifications in tmux covers that setup.
03Where your hooks live over SSH
Hooks run where the agent runs, so they are read from the host, not your laptop:
- In an app SSH window, Google's docs say skills, rules, hooks, MCP servers and plugins load from
~/.gemini/and project folders on the host. - With
agyover SSH, it's the same files as on any machine, on the host:~/.gemini/config/hooks.jsonfor every session and.agents/hooks.jsoninside a project.
Whatever a hook runs, it runs on the server. That decides which notifications work.
04Which notifications reach you over SSH
notify-send, osascript)Fires on the host. A headless server has no desktop to show it, so you see nothingagy runs over SSHcurl on the host, reaches your phone. Needs only outbound HTTPSagy remote-control startThe built-in notifications setting is worth turning on if you keep the SSH terminal open on your screen. We haven't tested how its desktop notification behaves over SSH, so treat the bell as the part you can count on, and check the rest yourself.
05A push hook from the server
The simplest reliable alert from a remote machine is a Stop hook on the host that sends a push. With ntfy it's one curl line in a script, called from ~/.gemini/config/hooks.json on the server. It works whether you're attached or not, and it doesn't need any inbound ports: the server only makes an outgoing HTTPS request.
Two things to remember. A push hook is one-way: it tells you Antigravity has finished, then you reconnect to carry on. And Antigravity has no "needs approval" event, so a hook only learns about a command from PreToolUse, which must always print a decision or Antigravity blocks the tool. How to get a notification when Antigravity finishes has working scripts.
06Antigravity Notifier on a server
Antigravity Notifier is an independent tool made by TouchTap Ltd, not affiliated with Google. It installs on the host like any other machine. In your SSH session, paste the line the iPhone or Android app shows when you add a computer, for example:
curl -fsSL https://antigravitynotifier.com/install.sh | sh -s 482913
That installs the free antigravity-notifier command line tool, adds one named group, antigravity-notifier, to the host's ~/.gemini/config/hooks.json, and pairs your phone. The hooks then send pushes from the server through our relay, using outbound HTTPS only. You get "Antigravity has finished" with its last message, commands to allow or deny, Antigravity's questions to answer, and a box for the next instruction.
On a Linux host without a desktop, it judges whether you're at the keyboard from the last keypress in the terminal agy runs in. If you've typed in the last 30 seconds, nothing waits for the phone and you answer in the terminal; if you've walked away, commands and questions wait for your phone. Where it can't tell at all, it doesn't make Antigravity wait: the phone gets a note instead, and antigravity-notifier doctor tells you which case you're in. It never holds agy -p scripts.
Antigravity Notifier supports the agy command line, including over SSH. It doesn't support the desktop app yet, so its SSH windows aren't covered. The command line tool is free; the apps need a subscription or a one-off purchase, see pricing. Set up Antigravity Notifier has the other install options.
07FAQ
Do Antigravity agents keep running when I close an SSH window?
In the desktop app's SSH windows, yes. Google's docs say agents keep running on the host when you close the window or your laptop sleeps, until you choose Stop SSH Server…. With agy in your own ssh session, use tmux or screen to keep it running.
Why doesn't notify-send work over SSH?
The hook runs on the server, and notify-send needs a desktop session there. On a headless server there is none, so send a push instead.
Which hooks file does Antigravity use over SSH?
The one on the host: ~/.gemini/config/hooks.json there, plus .agents/hooks.json in the project. Hooks on your laptop don't run for a remote session.
Does a push from the server need open ports?
No. A push hook or Antigravity Notifier makes an outgoing HTTPS request from the server. Nothing needs to connect in.