Codex / Claude-style Tab-to-accept ghost follow-up prompts for the Google Antigravity macOS desktop app β built in native Rust + AppKit without patching or re-signing Antigravity.
Both Codex and Claude desktop apps predict your most likely next prompt in subtle grey ghost text inside the empty composer so you can press Tab to insert it. Google Antigravity doesn't have this built in yet.
agy-ghost-prompt adds it cleanly using Antigravity's official lifecycle hooks (Stop + PreInvocation), a pre-warmed agy CLI stream-json worker with --json-schema, and a zero-polling native macOS overlay daemon (~600 KB Rust binary, zero Dock icon, 0.0% idle CPU).
- 2β3 ranked suggestions with instant cycling β generates up to 3 distinct follow-ups in one structured
--json-schemacall (1/3 Β· β₯ Tab). Press**Shift+Tab** or**β/β** when the composer is empty to cycle through them, then**Tab** (orβ) to insert. - Zero-polling, 0.0% idle CPU β driven entirely by native macOS
AXObserver(AXFocusedUIElementChanged,AXTitleChanged,AXValueChanged,AXWindowMoved,AXWindowResized),NSWorkspaceactivation/Space notifications, and a kernelkqueuedirectory watcher for instant state/config updates. - Native look & feel β seamless click-through Cocoa
NSPanelaligned pixel-for-pixel over Antigravity's composer (Ask anything...), automatically syncing with macOS Light/Dark mode. - Fast (~1.5β2s) & zero extra API keys β keeps a warm
agy --input-format stream-jsonprocess (defaultgemini-4-hydrogen-low) behind a local Unix socket so it reuses your existing Antigravity login and prompt cache. - Clipboard-free
Tabinsertion β usesCGEventKeyboardSetUnicodeStringto insert text directly into Electron/React without touching your clipboard or clipboard history. - Language-aware β matches the language you use in each chat (e.g. English, Italian, Spanish, etc.) by anchoring on your recent user turns, even if code or assistant replies mix languages.
- Per-conversation isolation β resolves exact conversation titles directly from Antigravity's local
conversation_summaries.db(via nativelibsqlite3FFI, immune to~/.sqliterc) and skips subagent turns so concurrent chats never cross-contaminate. - Space & focus safe β checks
CGWindowListCopyWindowInfoz-order (never floats over other apps/Spaces), hides immediately while typing, hides while an agent is running (PreInvocation+ toolbarCanceldetection), and ignoresTabif another field or menu is focused. - Update-proof β never modifies
/Applications/Antigravity.app.
Antigravity turn ends
β
βΌ
Stop hook (~2ms) βββΊ Unix socket (~/.cache/agy-ghost-prompt/worker.sock)
β
βΌ
Warm `agy` stream-json + --json-schema worker
(gemini-4-hydrogen-low, ~1.5s)
β
βΌ
~/.cache/agy-ghost-prompt/state.json (top 3 ranked)
β
kernel kqueue wakeup
βΌ
AgyGhostPrompt.app (AppKit NSPanel + AXObserver + CGEventTap)
β’ 0.0% idle CPU (no polling loop)
β’ Shows ghost text + `1/3 Β· β₯ Tab` over empty composer
β’ Shift+Tab / β / β β cycle suggestions
β’ Tab (or Right) β inserts via Unicode CGEvent (clipboard untouched)
β’ Esc β dismisses | Typing β hides immediately
β’ PreInvocation hook / Cancel button / Enter β hides while running
- macOS (Apple Silicon or Intel)
- Google Antigravity desktop app
- Antigravity CLI (
agy) β install with:
curl -fsSL https://antigravity.google/cli/install.sh | bash
Downloads the signed-ready universal binary (arm64 + x86_64) from Release v0.2.0 and runs install:
curl -fsSL https://github.com/korisame/agy-ghost-prompt/releases/download/v0.2.0/agy-ghost-prompt-v0.2.0-macos-universal.tar.gz \
| tar -xz -C /tmp agy-ghost-prompt && /tmp/agy-ghost-prompt install && rm -f /tmp/agy-ghost-prompt
git clone https://github.com/korisame/agy-ghost-prompt.git
cd agy-ghost-prompt
./install.sh
What install does:
- Installs
~/.local/bin/agy-ghost-promptand packages~/Applications/AgyGhostPrompt.app(LSUIElement, no Dock icon). - Auto-detects any local Apple Development / Developer ID codesigning certificate in your Keychain so future rebuilds preserve Accessibility trust (falls back to ad-hoc signing otherwise).
- Safely merges the
agy-ghost-prompt`` StopandPreInvocationentries into~/.gemini/config/hooks.jsonwithout clobbering existing hooks. - Installs and starts a LaunchAgent (
~/Library/LaunchAgents/com.agy-ghost-prompt.daemon.plist) and opensSystem Settings β Privacy & Security β Accessibility .
In System Settings β Privacy & Security β Accessibility, enable AgyGhostPrompt (toggle ON).
Then restart the LaunchAgent once if it was already waiting:
launchctl kickstart -k gui/$(id -u)/com.agy-ghost-prompt.daemon
| Key | Action |
|---|---|
Tab (orβ if configured) |
Insert the highlighted follow-up into the composer (does not auto-send) |
Shift+Tab orβ |
Cycle to next suggestion ( 1/3 β 2/3 β 3/3 ) |
β |
Cycle to previous suggestion |
Esc |
Dismiss suggestion for the current turn |
| Any character | Hide ghost text immediately and type normally |
Zero config is required. To customize, create ~/.config/agy-ghost-prompt/config.json (hot-reloaded live via kqueue β no restart needed):
{
"model": "gemini-4-hydrogen-low",
"theme": "auto",
"max_chars": 110,
"max_age_secs": 1800,
"accept_key": "tab",
"disabled_projects": ["private-repo", "~/work/sensitive"]
}
| Field | Default | Description |
|---|---|---|
model |
"gemini-4-hydrogen-low" |
Any model from agy models (e.g.gpt-oss-120b-medium ,gemini-4-carbon-low ). Also overridable viaAGY_GHOST_MODEL . |
theme |
"auto" |
"auto" (follows macOS appearance),"dark" , or"light" . |
max_chars |
110 |
Maximum suggestion length before truncation. |
max_age_secs |
1800 |
Seconds before unused cached suggestions expire. |
accept_key |
"tab" |
Key used to accept the ghost prompt: "tab" ,"right" (Right Arrow), or"both" . |
disabled_projects |
[] |
List of project IDs, folder names, or workspace paths (supports ~/ ) where ghost suggestions are completely skipped. |
agy_bin |
null |
Optional explicit path to agy (also overridable viaAGY_BIN ). |
agy-ghost-prompt install # Install app bundle, hooks, and LaunchAgent
agy-ghost-prompt uninstall # Cleanly remove LaunchAgent, hooks, app, and cache
agy-ghost-prompt status # Inspect Accessibility trust, config, composer, and state
agy-ghost-prompt set-test "One" "Two" "Three" # Push 1β3 test suggestions to the active chat
Logs live at ~/.cache/agy-ghost-prompt/daemon.log and ~/.cache/agy-ghost-prompt/hook.log.
- Reads only your local
transcript.jsonland~/.gemini/antigravity/conversation_summaries.db(opened read-only). - Never modifies or injects code into
Antigravity.app. - Never reads or modifies your clipboard.
- Never sends conversation snippets anywhere outside your local
agyCLI session. - Recursion-guarded via
AGY_GHOST_PROMPT_INTERNAL=1so the worker's ownagycalls never trigger hooks.
agy-ghost-prompt uninstall
Removes the LaunchAgent, the agy-ghost-prompt entry in ~/.gemini/config/hooks.json, ~/Applications/AgyGhostPrompt.app, ~/.local/bin/agy-ghost-prompt, and ~/.cache/agy-ghost-prompt.