{"slug": "show-hn-codex-claude-style-tab-follow-up-prompts-for-google-antigravity-rust", "title": "Show HN: Codex/Claude-style Tab follow-up prompts for Google Antigravity (Rust)", "summary": "A developer released agy-ghost-prompt v0.2.0, a native Rust and AppKit tool that adds Codex- and Claude-style Tab-to-accept ghost follow-up prompts to Google's Antigravity macOS desktop app without patching or re-signing Antigravity. The tool uses Antigravity's official Stop and PreInvocation lifecycle hooks plus a pre-warmed agy CLI stream-json worker with --json-schema to generate up to 3 ranked suggestions in roughly 1.5–2 seconds, displayed in a ~600 KB overlay daemon that reports 0.0% idle CPU because it is driven by macOS AXObserver events and a kqueue directory watcher rather than polling. It inserts text via CGEventKeyboardSetUnicodeString without touching the clipboard, isolates suggestions per conversation using Antigravity's local conversation_summaries.db, and ships as a universal arm64/x86_64 binary on GitHub.", "body_md": "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.\n\nBoth 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.\n\n`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**).\n\n- **2–3 ranked suggestions with instant cycling** — generates up to 3 distinct follow-ups in one structured`--json-schema` call (`1/3 · ⇥ Tab` ). Press**`Shift+Tab`** or**`↓` / `↑`** when the composer is empty to cycle through them, then**` Tab`** (or`→` ) to insert.\n- **Zero-polling, 0.0% idle CPU** — driven entirely by native macOS`AXObserver` (`AXFocusedUIElementChanged` ,`AXTitleChanged` ,`AXValueChanged` ,`AXWindowMoved` ,`AXWindowResized` ),`NSWorkspace` activation/Space notifications, and a kernel`kqueue` directory watcher for instant state/config updates.\n- **Native look & feel** — seamless click-through Cocoa`NSPanel` aligned pixel-for-pixel over Antigravity's composer (`Ask anything...` ), automatically syncing with macOS Light/Dark mode.\n- **Fast (~1.5–2s) & zero extra API keys** — keeps a warm`agy --input-format stream-json` process (default`gemini-4-hydrogen-low` ) behind a local Unix socket so it reuses your existing Antigravity login and prompt cache.\n- **Clipboard-free `Tab` insertion** — uses`CGEventKeyboardSetUnicodeString` to insert text directly into Electron/React without touching your clipboard or clipboard history.\n- **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.\n- **Per-conversation isolation** — resolves exact conversation titles directly from Antigravity's local`conversation_summaries.db` (via native`libsqlite3` FFI, immune to`~/.sqliterc` ) and skips subagent turns so concurrent chats never cross-contaminate.\n- **Space & focus safe** — checks`CGWindowListCopyWindowInfo` z-order (never floats over other apps/Spaces), hides immediately while typing, hides while an agent is running (`PreInvocation` + toolbar`Cancel` detection), and ignores`Tab` if another field or menu is focused.\n- **Update-proof** — never modifies`/Applications/Antigravity.app` .\n\n```\nAntigravity turn ends\n        │\n        ▼\n  Stop hook (~2ms) ──► Unix socket (~/.cache/agy-ghost-prompt/worker.sock)\n                                │\n                                ▼\n             Warm `agy` stream-json + --json-schema worker\n                     (gemini-4-hydrogen-low, ~1.5s)\n                                │\n                                ▼\n            ~/.cache/agy-ghost-prompt/state.json (top 3 ranked)\n                                │\n                       kernel kqueue wakeup\n                                ▼\n       AgyGhostPrompt.app (AppKit NSPanel + AXObserver + CGEventTap)\n         • 0.0% idle CPU (no polling loop)\n         • Shows ghost text + `1/3 · ⇥ Tab` over empty composer\n         • Shift+Tab / ↑ / ↓ → cycle suggestions\n         • Tab (or Right) → inserts via Unicode CGEvent (clipboard untouched)\n         • Esc → dismisses  |  Typing → hides immediately\n         • PreInvocation hook / Cancel button / Enter → hides while running\n```\n\n- **macOS** (Apple Silicon or Intel)\n- **Google Antigravity** desktop app\n- **Antigravity CLI (`agy`)** — install with:\n\n```\ncurl -fsSL https://antigravity.google/cli/install.sh | bash\n```\n\nDownloads the signed-ready universal binary (`arm64` + `x86_64`) from [Release `v0.2.0`](https://github.com/korisame/agy-ghost-prompt/releases/tag/v0.2.0) and runs `install`:\n\n```\ncurl -fsSL https://github.com/korisame/agy-ghost-prompt/releases/download/v0.2.0/agy-ghost-prompt-v0.2.0-macos-universal.tar.gz \\\n  | tar -xz -C /tmp agy-ghost-prompt && /tmp/agy-ghost-prompt install && rm -f /tmp/agy-ghost-prompt\ngit clone https://github.com/korisame/agy-ghost-prompt.git\ncd agy-ghost-prompt\n./install.sh\n```\n\nWhat `install` does:\n\n1. Installs `~/.local/bin/agy-ghost-prompt` and packages`~/Applications/AgyGhostPrompt.app` (`LSUIElement` , no Dock icon).\n2. 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).\n3. Safely merges the `agy-ghost-prompt`` Stop` and`PreInvocation` entries into`~/.gemini/config/hooks.json` without clobbering existing hooks.\n4. Installs and starts a LaunchAgent (`~/Library/LaunchAgents/com.agy-ghost-prompt.daemon.plist` ) and opens**System Settings → Privacy & Security → Accessibility** .\n\nIn **System Settings → Privacy & Security → Accessibility**, enable **`AgyGhostPrompt`** (toggle **ON**).\nThen restart the LaunchAgent once if it was already waiting:\n\n```\nlaunchctl kickstart -k gui/$(id -u)/com.agy-ghost-prompt.daemon\n```\n\n| Key | Action | \n|---|---|\n| `Tab` (or`→` if configured) | Insert the highlighted follow-up into the composer (does not auto-send) | \n| `Shift+Tab` or`↓` | Cycle to next suggestion ( `1/3 → 2/3 → 3/3` ) | \n| `↑` | Cycle to previous suggestion | \n| `Esc` | Dismiss suggestion for the current turn | \n| Any character | Hide ghost text immediately and type normally | \n\nZero config is required. To customize, create `~/.config/agy-ghost-prompt/config.json` (hot-reloaded live via `kqueue` — no restart needed):\n\n```\n{\n  \"model\": \"gemini-4-hydrogen-low\",\n  \"theme\": \"auto\",\n  \"max_chars\": 110,\n  \"max_age_secs\": 1800,\n  \"accept_key\": \"tab\",\n  \"disabled_projects\": [\"private-repo\", \"~/work/sensitive\"]\n}\n```\n\n| Field | Default | Description | \n|---|---|---|\n| `model` | `\"gemini-4-hydrogen-low\"` | Any model from `agy models` (e.g.`gpt-oss-120b-medium` ,`gemini-4-carbon-low` ). Also overridable via`AGY_GHOST_MODEL` . | \n| `theme` | `\"auto\"` | `\"auto\"` (follows macOS appearance),`\"dark\"` , or`\"light\"` . | \n| `max_chars` | `110` | Maximum suggestion length before truncation. | \n| `max_age_secs` | `1800` | Seconds before unused cached suggestions expire. | \n| `accept_key` | `\"tab\"` | Key used to accept the ghost prompt: `\"tab\"` ,`\"right\"` (Right Arrow), or`\"both\"` . | \n| `disabled_projects` | `[]` | List of project IDs, folder names, or workspace paths (supports `~/` ) where ghost suggestions are completely skipped. | \n| `agy_bin` | `null` | Optional explicit path to `agy` (also overridable via`AGY_BIN` ). | \n\n```\nagy-ghost-prompt install                         # Install app bundle, hooks, and LaunchAgent\nagy-ghost-prompt uninstall                       # Cleanly remove LaunchAgent, hooks, app, and cache\nagy-ghost-prompt status                          # Inspect Accessibility trust, config, composer, and state\nagy-ghost-prompt set-test \"One\" \"Two\" \"Three\"    # Push 1–3 test suggestions to the active chat\n```\n\nLogs live at `~/.cache/agy-ghost-prompt/daemon.log` and `~/.cache/agy-ghost-prompt/hook.log`.\n\n- Reads only your local `transcript.jsonl` and`~/.gemini/antigravity/conversation_summaries.db` (opened read-only).\n- Never modifies or injects code into `Antigravity.app` .\n- Never reads or modifies your clipboard.\n- Never sends conversation snippets anywhere outside your local `agy` CLI session.\n- Recursion-guarded via `AGY_GHOST_PROMPT_INTERNAL=1` so the worker's own`agy` calls never trigger hooks.\n\n```\nagy-ghost-prompt uninstall\n```\n\nRemoves 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`.", "url": "https://wpnews.pro/news/show-hn-codex-claude-style-tab-follow-up-prompts-for-google-antigravity-rust", "canonical_source": "https://github.com/korisame/agy-ghost-prompt", "published_at": "2026-12-01 14:31:12+00:00", "updated_at": "2026-12-01 14:47:22.718566+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-products", "generative-ai"], "entities": ["agy-ghost-prompt", "Google Antigravity", "Rust", "AppKit", "agy CLI", "gemini-4-hydrogen-low", "GitHub"], "also_reported_by": [], "takeaway": "Antigravity's Stop and PreInvocation hooks can drive a warm agy stream-json worker with --json-schema to return 3 ranked follow-up prompts in ~1.5–2s, surfaced by an AXObserver-driven overlay at 0.0% idle CPU.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/show-hn-codex-claude-style-tab-follow-up-prompts-for-google-antigravity-rust", "markdown": "https://wpnews.pro/news/show-hn-codex-claude-style-tab-follow-up-prompts-for-google-antigravity-rust.md", "text": "https://wpnews.pro/news/show-hn-codex-claude-style-tab-follow-up-prompts-for-google-antigravity-rust.txt", "jsonld": "https://wpnews.pro/news/show-hn-codex-claude-style-tab-follow-up-prompts-for-google-antigravity-rust.jsonld"}}