Skip to content

Antigravity CLI 1.1.26 never loads a plugin's hooks, and silently drops two of this plugin's four events #553

Closed

Description

@fdaviddpt

Antigravity CLI (agy) 1.1.26 installs from https://antigravity.google/cli/install.sh to ~/.local/bin/agy. It is a fourth candidate host: it carries plugin import [source] documented as "Import plugins from gemini or claude", plus plugin install/validate/enable/disable and an mcp subcommand.

It is also, unlike Gemini CLI, verifiable. #532 blocks on headless OAuth (invalid_grant, no OOB fallback). agy has no such wall:

$ agy -p "reply with exactly: OK" --output-format text
OK

No browser, no prompt, no cached-credential failure. So the reason every Gemini CLI test in this repo asserts manifest shape only does not apply here — Antigravity claims can be observed rather than reasoned.

What was observed

All of the below was run against this repo at 0.26.0.

agy plugin validate requires plugin.json in the directory it is pointed at, and resolves component directories as siblings of that file. Pointed at .claude-plugin/, every component type is missing (see the sibling issue about that output):

$ agy plugin validate .claude-plugin
  [ok]    .claude-plugin
          - skills      : skipped (not found)
          - agents      : skipped (not found)
          - commands    : skipped (not found)
          - mcpServers  : skipped (not found)
          - hooks       : skipped (not found)

With a flat layout — plugin.json copied to a scratch directory, with hooks/, commands/, skills/ symlinked in beside it — three of five resolve and one does not:

  [ok]    <scratch>
          ✔ skills      : 1 processed
          - agents      : skipped (not found)
          ✔ commands    : 1 processed (converted to skills)
          - mcpServers  : skipped (not found)
          - hooks       : skipped (not found)

hooks/hooks.json is present and readable in that tree — the symlink is the same one skills and commands resolved through. Copying that same file to hooks.json at the plugin root, changing nothing else, flips it:

  [ok]    <scratch>
          ✔ skills      : 1 processed
          - agents      : skipped (not found)
          ✔ commands    : 1 processed (converted to skills)
          ✔ hooks       : 1 processed

So Antigravity looks for the hook manifest at <plugin-root>/hooks.json, while this repo keeps it at hooks/hooks.json, which is where Claude Code reads it.

Why this matters more than the count suggests

This plugin is its hooks. SessionStart, UserPromptSubmit and Stop are what capture memory at all; skills and commands are the surface around them. A host that loads the skills and silently drops the hooks yields an install that looks present and saves nothing — the exact failure mode this project treats as its worst, and one a user would attribute to the plugin rather than to the host.

Note also that commands is reported as "converted to skills", so the command surface does not survive as commands. Whether that conversion preserves behaviour is not established here and should be checked separately.

What is not established

  • Whether agy plugin import claude (as opposed to validate) applies a different, Claude-aware layout resolution that would find hooks/hooks.json correctly. agy plugin import with no imported extensions present answered No claude extensions found., so the import path was never exercised against this repo.
  • Whether hooks that do load actually fire, what stdin payload shape they carry, where Antigravity writes its transcript, and whether the stdout contract matches Claude Code's. These are the same four questions Add Gemini CLI support: the event mapping is machine-generated, but the migration output would not run here #456 asks of Gemini CLI, and unlike there, they are answerable here — headless print mode works.
  • Whether the root-hooks.json layout is documented and stable, or an implementation detail of 1.1.26.

Scope this is not

This is a finding, not a request to ship a fourth host. Adding an Antigravity badge to the README (#547/#548) would today be a claim a one-line probe disproves, which is worse than the caveated Gemini badge. The badge follows the evidence, not the other way round.

Measured on macOS (darwin/arm64), agy 1.1.26, this checkout at 0.26.0. Nothing here is claimed for other platforms.

Activity

  1. added
    priority:medium
    on Sep 4, 2026
  2. fdaviddpt commented on Sep 4, 2026

    @fdaviddpt
    ContributorAuthor

    Probed further in the same session. This supersedes the original body's central claim: the problem is not that hooks.json sits at the wrong path. Plugin-supplied hooks are not loaded by Antigravity at all, and two of this plugin's four events are not part of its vocabulary.

    Hooks are a real subsystem there

    agy changelog shows an actively developed hook system — PreToolUse, PostToolUse, Stop and PostInvocation events, matchers on PostToolUse, ordering rules that run hooks.json before built-in termination checks, a continuation cap so a always-blocking Stop hook cannot hang a turn, and workspace-local hooks at <workspace>/.agents/hooks.json. So the question is not whether Antigravity has hooks. It has them, and they are further along than this repo's own Gemini CLI position.

    A plugin's own hooks.json is registered and then ignored

    The probe was a minimal plugin: plugin.json, a root hooks.json declaring all four of this plugin's events, and one script per event appending to a fixed absolute log path. Every command used an absolute path, so nothing depended on ${CLAUDE_PLUGIN_ROOT} being set.

    agy plugin install accepted it and reported ✔ hooks : 1 processed. agy plugin list recorded it with "components": ["hooks"]. ~/.gemini/config/config.json carried "hookprobe": {"enabled": true}. Every signal the tool offers said the hooks were installed.

    Then, in the same state:

    $ agy -p "/hooks" --output-format json
    ... "command":{"name":"hooks","data":{"hooks":[]}}
    

    Zero hooks. The plugin's manifest, copied verbatim from the plugin directory to ~/.gemini/config/hooks.json, appears immediately:

    "source": "/Users/floriandavid/.gemini/config/hooks.json"
    

    Same bytes, same events, different directory. So plugin install copies a hooks.json into the plugin tree, counts it, marks the plugin enabled — and the hook loader never reads it. The shared file and the workspace-local .agents/hooks.json named in the changelog appear to be the only paths that load.

    Note that /hooks answers in print mode without starting an agent turn or spending quota, which makes this cheap to re-check on any future version.

    Two of the four events are dropped without a word

    Loaded from the shared path, the four-event manifest renders as two actions:

    "actions": [
      { "event": "SessionStart", "type": "command" },
      { "event": "PostToolUse",  "type": "command",
        "command": "bash \".../probe.sh\" PostToolUse" }
    ]
    

    UserPromptSubmit and SessionEnd are absent. No warning, no error, no unknown-event line — they are simply not in the output. And SessionStart survives as an event with a type but no command field, while PostToolUse keeps its full command line. Whatever SessionStart is there, it is not a thing that can run.

    Consistent with that, a print-mode turn with the shared manifest in place wrote nothing to the log. SessionStart did not fire.

    Config surface is Gemini's

    This answers one of the original body's open questions. Antigravity installs plugins to ~/.gemini/config/plugins/<name>/ and keeps config.json, import_manifest.json, mcp_config.json and the shared hooks.json alongside ~/.gemini/settings.json. It shares Gemini CLI's directory rather than owning one — there is no ~/.antigravity or ~/.config/agy. Anything this repo ships into .gemini/ and anything Antigravity writes are neighbours, which is worth knowing before either is treated as evidence about the other.

    What this changes

    The original body proposed a layout question — root hooks.json versus hooks/hooks.json — as the thing to answer. That framing was too small. Even with the layout satisfied, this plugin captures on SessionStart, UserPromptSubmit, PostToolUse and SessionEnd, and on Antigravity 1.1.26 that is: one registered without a command, one untested, and two discarded silently. A user who installed it would get a plugin reporting success and saving nothing.

    Whether a port is possible is a different and still-open question — PostInvocation and Stop may cover what SessionEnd does here, and a prompt hook may cover UserPromptSubmit. That is a design exercise, not a path fix, and it should not start until firing is confirmed for at least one event.

    Still not established

    • Whether PostToolUse actually fires. It is the one event that kept its command. Testing it needs a turn that calls a tool, which needs --dangerously-skip-permissions; that was refused by the harness running this probe and not worked around. Until someone runs it, no Antigravity hook has been observed executing — registration is all that is confirmed.
    • What stdin payload shape a firing hook receives, and whether it resembles Claude Code's.
    • Where Antigravity writes its transcript.
    • Whether agy plugin import claude behaves differently from install. It reported No claude extensions found. and was never exercised.
    • Whether the plugin-hooks gap is deliberate (plugins are not a hook source) or a defect. The list output claiming components: ["hooks"] argues for defect, but that is inference.

    Environment

    macOS, darwin/arm64. agy 1.1.26, installed from https://antigravity.google/cli/install.sh to ~/.local/bin/agy, authenticated interactively, Antigravity Starter Quota, Gemini 3.8 Flash. This checkout at 0.26.0. Nothing here is claimed for Linux or Windows, and nothing is claimed for any other agy version — the changelog shows this area changing release to release.

    All probe state was removed afterwards: no ~/.gemini/config/hooks.json, no plugin directory, import_manifest.json back to {"imports": null}, and the stale plugins.hookprobe entry that plugin uninstall left behind in config.json deleted by hand. That leak is worth its own issue.

  3. changed the title [-]Antigravity CLI 1.1.26 loads this plugin's skills and commands but not its hooks (hooks.json must sit at the plugin root)[/-] [+]Antigravity CLI 1.1.26 never loads a plugin's hooks, and silently drops two of this plugin's four events[/+] on Sep 5, 2026
  4. fdaviddpt commented on Sep 5, 2026

    @fdaviddpt
    ContributorAuthor

    This is now the repo's live host question, not a backlog finding beside a working Gemini CLI arm. #532 is closed: with credentials that do work, @google/gemini-cli 0.58.0 answers

    IneligibleTierError: UNSUPPORTED_CLIENT — This client is no longer supported for
    Gemini Code Assist for individuals. To continue using Gemini, please migrate to the
    Antigravity suite of products.
    tierId: free-tier
    

    thrown after the token is accepted. Google names Antigravity as the migration path in the CLI's own error text. So Gemini CLI is not a host this project can observe on an individual free-tier account at any version, and Antigravity is not a speculative fourth host — it is where that arm went.

    What that changes about this issue

    Nothing measured here changes. The findings stand exactly as recorded above: a plugin's own hooks.json is copied into ~/.gemini/config/plugins/<name>/, counted (✔ hooks : 1 processed), marked enabled: true with components: ["hooks"], and then never loaded — agy -p "/hooks" returns "hooks": []. Only the shared ~/.gemini/config/hooks.json and the workspace-local <workspace>/.agents/hooks.json load. Loaded from the shared path, UserPromptSubmit and SessionEnd vanish with no warning, and SessionStart survives as an event with a type and no command.

    What changes is the priority and the framing. This was filed as "a finding, not a request to ship a fourth host", which was right when Gemini CLI was still a nominal target. It no longer is. The question is now whether this plugin can capture memory under the host Google is actually pointing users at, and the answer today is no: of the four events this plugin captures on, one registers without a command, one is untested, and two are discarded silently.

    Still the load-bearing unknown

    Whether PostToolUse — the one event that kept its command — actually fires. Nothing here has yet observed any Antigravity hook execute; registration is all that is confirmed. Testing it needs a turn that calls a tool, which needs --dangerously-skip-permissions; that was refused by the harness running the probe and deliberately not worked around. Until someone runs it by hand, "Antigravity has hooks" is a claim about a config listing, not about behaviour.

    That single test is the cheapest next step in this whole area, and it does not need a plugin: install a probe hook at ~/.gemini/config/hooks.json whose command appends to a fixed absolute path, run one agy turn that calls a tool, and read the file.

    Not in scope here

    Re-badging. The README badges two observed hosts (#547/#548) and Antigravity is not one of them until a hook is seen firing. Closing #532 does not promote Antigravity by default — it removes a competitor, which is not the same thing as evidence.

  5. added
    priority:high
    cohort-5
    and removed
    priority:medium
    on Sep 5, 2026
  6. fdaviddpt commented on Sep 5, 2026

    @fdaviddpt
    ContributorAuthor

    The load-bearing unknown is answered: Antigravity hooks do fire, four events are usable, and one of them hands over the transcript path at session open. Both of this issue's earlier central claims turn out to be artifacts of the manifest schema rather than facts about the host, so this comment supersedes them.

    Measured on agy 1.1.27 (earlier comments were 1.1.26), macOS darwin/arm64, this checkout at 0.27.0. Nothing claimed for other platforms or versions.

    The schema was the whole problem

    hooks.json maps a hook name to an object whose keys are event names holding arrays of handlers:

    {
      "probe": {
        "enabled": true,
        "SessionStart": [ { "type": "command", "command": "bash /abs/probe.sh SessionStart", "timeout": 30 } ],
        "PreInvocation": [ { "type": "command", "command": "bash /abs/probe.sh PreInvocation", "timeout": 30 } ]
      }
    }

    Claude Code's shape -- an event key holding an array of matcher objects -- does not parse at all, and the failure is invisible where anyone would look:

    hooks_manager.go:33] failed to parse hooks.json at ~/.gemini/config/hooks.json:
    json: cannot unmarshal array into Go struct field .SessionStart of type jsonhook.JSONHookSpec
    hooks_manager.go:53] loaded 0 named hooks from 1 hooks.json file(s)
    

    agy -p "/hooks" --output-format json answers {"hooks":[]} -- byte-identical to having no file. The only witness is ~/.gemini/antigravity-cli/cli.log. An unrecognised event inside an otherwise valid file is dropped the same silent way: the listing simply prints fewer rows than the file declares.

    This retracts the earlier "two of the four events are dropped without a word" finding. That was the parser half-digesting a Claude-shaped file, not a gap in Antigravity's vocabulary. It also retracts the original body's framing: the layout question (hooks.json vs hooks/hooks.json) was never the blocker, because a file at the right path in the wrong shape fails anyway.

    What 1.1.27 actually accepts

    Twelve events declared in one manifest, four accepted, and all four fired on a single print-mode turn:

    event loads fires claimed by
    SessionStart yes yes not in Google's docs; shipped by cmux
    PreInvocation yes yes docs
    PostInvocation yes yes docs
    Stop yes yes docs
    PreToolUse no -- docs, and fired on agy 1.0.5 (see below)
    PostToolUse no -- docs
    UserPromptSubmit, SessionEnd, Notification, turn-completion no -- cmux ships the last three

    So the published hooks documentation is wrong in both directions on this build: it lists two events that will not parse, and omits one that works.

    The tool hooks are a regression, not an absent feature

    cmux hit PreToolUse firing on agy 1.0.5 -- hard enough to deny every tool call: Tool call denied by jsonhook__cmux_PreToolUse_0_0, error (invalid_args) (manaflow-ai/cmux#5358). Their fix was to stop declaring tool events, and their shipped Antigravity adapter now declares none. On 1.1.27 the same event no longer even parses, under every matcher spelling tried ("*", ".*", an exact tool name, and the field omitted).

    Tool-scoped capture is therefore unavailable today, and the surrounding evidence says it is unstable rather than unimplemented. A forum report of Stop and PostToolUse never firing on Antigravity IDE 1.107.0/Windows is unresolved.

    The payload, and the transcript path

    This answers two more of the issue's open questions. A firing hook receives JSON on stdin. SessionStart:

    {
      "artifactDirectoryPath": "~/.gemini/antigravity-cli/brain/<conversationId>",
      "conversationId": "09191173-fd7f-4402-be52-b3a8575b7ebe",
      "modelName": "gemini-3.8-flash-high",
      "transcriptPath": "~/.gemini/antigravity-cli/brain/<conversationId>/.system_generated/logs/transcript_full.jsonl",
      "workspacePaths": []
    }

    Stop carries the same plus terminationReason (NO_TOOL_CALL on a plain turn), fullyIdle, executionNum and error. So Antigravity writes its transcript to ~/.gemini/antigravity-cli/brain/<conversationId>/.system_generated/logs/transcript_full.jsonl, and hands the path to the hook at session open -- which is what this plugin's capture needs and where it needs it.

    Method note worth keeping

    One probe run looked like a pass and was worthless: the prompt was "run: echo hi, then say DONE", the model answered DONE, and no tool ever ran -- the empty hook log proved nothing. Phrase a firing probe so the tool leaves a side effect (create the file /tmp/agy-proof.txt), then check the file, not the reply. The log names what it auto-approved:

    session.go:67] Print mode: --dangerously-skip-permissions set, auto-approving all tool permissions
    tool_confirmation_manager.go:170] Always-proceed: auto-approving tool confirmation "WriteToFile" at step 2
    

    What this changes for the repo

    A port is no longer blocked on "does anything fire". Every one of this plugin's four capture points has a usable analogue, and the work is now a design exercise rather than an unknown -- filed separately. Badging still waits on that port existing and being exercised, not on this comment.

    Still open: whether <workspace>/.agents/hooks.json loads through the same code path (untested; the changelog says it needs the folder trusted), whether the CustomizationConfig.GetEnableJsonHooks flag gates anything a user can reach, and agy plugin import claude, still never exercised. A plugin's own bundled hooks.json is still copied in, counted hooks : 1 processed, and never loaded -- only the shared and workspace-local paths load.

    Probe state removed: no ~/.gemini/config/hooks.json, no plugin installed at any point, no /tmp artifacts.

  7. fdaviddpt commented on Sep 5, 2026

    @fdaviddpt
    ContributorAuthor

    This investigation is complete and its own last comment says so: "The load-bearing unknown is answered ... A port is no longer blocked on 'does anything fire' ... the work is now a design exercise rather than an unknown -- filed separately." That filing is #563, which carries the acceptance criteria and the mapping to design against. Closing this one as resolved-into-#563 rather than leaving a completed investigation open on the board; nothing measured here is being discarded, all four comments stay attached to #563's own reasoning by reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cohort-5priority:high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions