Skip to content
Hindsight
Esc
↑↓navigate↵open⌘Jpreview
On this page

Antigravity

How Hindsight connects to Antigravity's agent (the app, the IDE and the agy CLI) and to typing in the IDE.

Antigravity is two connections. The agent reports through a hooks entry that the app, the IDE and the agy CLI all read. Your typing in the IDE reports through the Hindsight extension. Both are set up for you, and nothing needs trusting.

Hindsight decides Antigravity is installed when any of these is true: a folder starting with antigravity exists in ~/.gemini, ~/.gemini/bin/agy (agy.exe on Windows) exists, or the IDE’s antigravity-ide command is found. A bare ~/.gemini isn’t enough, since that may belong to Gemini CLI.

The agent: what gets installed

Hindsight adds an entry named hindsight to ~/.gemini/config/hooks.json (on Windows, C:\Users\you\.gemini\config\hooks.json), creating the file if needed. Other entries in the file stay.

{
  "hindsight": {
    "PreInvocation": [
      { "type": "command", "command": "\"C:\\Users\\you\\AppData\\Local\\Hindsight\\hindsight-daemon.exe\" emit --source antigravity-agent", "timeout": 10 }
    ],
    "PostToolUse": [
      { "matcher": "*", "hooks": [ { "type": "command", "command": "...", "timeout": 10 } ] }
    ],
    "Stop": [
      { "type": "command", "command": "...", "timeout": 10 }
    ]
  }
}

Three hooks, each with a timeout of 10. Antigravity waits for every hook to answer, so Hindsight answers {} straight away and lets the hooks that record nothing end before opening its database.

The agent: what Hindsight sees

Antigravity has no prompt hook, so Hindsight builds a run from what it does have.

  • Runs. The first model call of a turn starts a run. Stop ends it, or marks it stopped by you if Antigravity says you cancelled it.
  • Your prompts. They come from Antigravity’s transcript file, which the daemon reads for each prompt’s time, length and a keyed hash. A prompt sent while the agent was still busy is picked up from the transcript too.
  • Tool calls. The tool name, and whether it failed. For write_file, edit_file, replace_file_content and the like, it counts lines added and removed and takes a language and hashed path.
  • Tokens and model. Also from the transcript: each response’s input, cached input and output tokens, and the model name (auto isn’t a name, so it’s left out).

Of the transcript, only step types, times, token counts and the model are read, plus your prompts for their length and hash. A failed tool’s error is checked only for whether it’s empty.

Your typing: the extension

In the IDE, the Hindsight extension is installed with the IDE’s antigravity-ide --install-extension. It counts your typing and diff reviews as described on the VS Code page. The separate Antigravity app and the CLI have no editor, so there’s no typing to count there.

Things to know

  • Stopping the agent runs no hook. Hindsight closes the run as stopped when the next one starts.
  • Subagents don’t wait for you. Their runs aren’t recorded. Their tokens are added to the next run their parent finishes in the same project.
  • Commits. A commit made from Antigravity’s shell is recorded as the agent’s (Hindsight checks ANTIGRAVITY_CONVERSATION_ID). See Commits.

Check that it’s working

Send Antigravity a prompt and look at the timeline on your Today page. If nothing arrives, open ~/.gemini/config/hooks.json and look for the hindsight entry. If it’s missing, reconnect.

Disconnect

hindsight-daemon disconnect

This removes the hindsight entry (the file is deleted if it held nothing else) and uninstalls the extension from the IDE. It’s added back at Hindsight’s next start unless you uninstall Hindsight.

Was this page helpful?