Stop and PostToolUse hooks in .agents/hooks.json never fire (Antigravity IDE 1.107.0, Windows)

Environment

  • Antigravity IDE version: 1.107.0
  • Build commit: ecfbad74d93962fc8ca485d93ab9b4f3d4cb6cf8
  • Channel: stable
  • OS: Windows 11 Pro, build 10.0.26100
  • Workspace: single-folder workspace, hooks.json at /.agents/hooks.json

Summary
Hooks configured in .agents/hooks.json exactly per the documented schema (antigravity.google/docs/hooks) never execute. Reproduced for two independent event types (Stop and PostToolUse) using both a custom script and the docs’ own literal example shape. No hook-related output anywhere, no error surfaced in the UI, and Antigravity’s own per-session extension log (google.antigravity channel) records zero hook activity for the affected sessions.

Steps to reproduce

  1. Create .agents/hooks.json at the workspace root:

{
“verification-enforcer”: {
“Stop”: [
{
“type”: “command”,
“command”: “D:\path\to\workspace\.agents\scripts\enforce-verification.bat”
}
]
}
}

(enforce-verification.bat is a one-line wrapper that calls an absolute python.exe on an absolute .py script path - included below for reference. The script’s very first action is an unconditional, exception-proof write to a log file, so even a script-side crash would still prove invocation.)

  1. Fully quit and relaunch Antigravity IDE (not just a new chat - confirmed this is necessary for hooks.json edits to even be considered, but does not affect the underlying bug).
  2. In a fresh chat, ask the agent to edit any file, then instruct it to stop immediately without running any other commands.
  3. Observe: the agent stops normally. The hook’s log file is never created - not even the unconditional first-line invocation marker.

Repeated 3 separate times across full app restarts. Zero invocations, every time.

Second reproduction, different event type
Added a second hook using the docs’ own canonical PostToolUse example shape verbatim:

{
“test-hook”: {
“PostToolUse”: [
{
“matcher”: “run_command”,
“hooks”: [
{
“type”: “command”,
“command”: “echo “tool hook fired” > “D:\path\to\workspace\.agents\scripts\tool-hook.log””
}
]
}
]
}
}

Ran a real run_command tool call in the same session. tool-hook.log was never created.

Expected behavior
Per antigravity.google/docs/hooks: Stop should intercept termination and, if the script returns {“decision”:“continue”,“reason”:“…”}, force the loop to continue with that reason injected as a system message. PostToolUse should run its command after every tool call matching the matcher.

Actual behavior
Neither hook type ever executes, under any configuration tested.

What was ruled out (verified by direct test, not inference - included so triage doesn’t have to re-derive this)

  • Schema correctness: checked field-by-field against the docs, including the flat-array shape for Stop/PreInvocation/PostInvocation vs. the matcher+nested-hooks-array shape for PreToolUse/PostToolUse, and the exact output contract.
  • tool_calls argument field name: confirmed against real transcript.jsonl files on disk (~/.gemini/antigravity-ide/brain//.system_generated/logs/transcript.jsonl) that the key is “args”, matching the docs’ PreToolUse example (toolCall.args) - not a cause of the non-firing, just noting it in case others copy an older/wrong assumption.
  • PATH resolution: tested with the command referencing python via PATH and via an absolute interpreter path - no difference.
  • Working directory: tested with a relative script path and a fully absolute path - no difference.
  • Spawn mechanism: manually simulated the exact command string via cmd.exe, via powershell.exe -Command (with and without a leading & call operator), via a fully shell-less raw process spawn (.NET Process, UseShellExecute=false), and as a single self-contained .bat executable (matching the docs’ “executable file” example shape) - every one of these runs correctly when invoked directly, outside Antigravity.
  • Settings: no hooks-enable/disable flag found anywhere in Antigravity’s settings.json or globalStorage.
  • Antigravity’s own logs: %APPDATA%\Antigravity IDE\logs\window1\exthost\google.antigravity\Antigravity IDE.log is completely empty (0 bytes) for sessions where hooks should have fired - not just missing hook-specific entries, the entire log channel is silent.

Attachments available on request

  • Full hooks.json and enforce-verification.py/.bat content
  • Sanitized transcript.jsonl excerpts showing the tool calls that should have triggered PostToolUse
  • The verification-enforcer.log file showing it is empty/absent after live sessions

Notes
Docs state hooks are meant to work identically across “AGY, AGY CLI, and AGY IDE” - this report covers Antigravity 2.0 IDE specifically; not tested against the CLI.

Hello @Ayush_Ranabhat

We recommend updating your Antigravity IDE to the latest version (2.5.5) to see if it clears up the error you’re encountering.

If the error persist, Could you please share more information:

  • Antigravity Version
  • Could you please share the exact hooks.json file you are using ( you can redact any sensitive information such as tokens, API keys, or private paths if necessary)
  • Could you please attach the complete contents of the scripts/executables references by Stop and PostToolUse(excluding sensitive information).
  • Exact reproduction steps:
    • Could you please share the exact sequence of actions you take in Antigravity immediately before the hook is executed to run.
  • To help use understand the workflow, please describe:
    • The exact sequence of actions you take in Antigravity immediately before the hook executes.
    • What exactly should happen when the Stop hook files?
    • what exactly should happen after the PostToolUse hook fires?
  • Provide the Antigravity IDE logs from the specific session where the hooks failed.
  • If possible, share a screen recording showing the complete steps to reproduce the issue.