Looking at the error output, there seems to be an issue with how the path is resolved or quoted on Windows (an extra quote appears in the middle of the path: ...\"C:\...).
Because this is a PreToolUse hook, the exit status 1 cancels the entire tool call (run_command, read_file, MCP tools, etc.).
Manually correcting the file only works temporarily, as it gets overwritten on reload.
Is there a recommended way to resolve this path formatting issue on Windows, or should this hook fail silently without blocking core tools when telemetry fails?
The issue stems from a Windows path-escaping bug inside the plugin hook configuration (e.g., in hooks.json under .gemini/config/plugins/googlecloudtools.datacloud_telemetry).
The script path was serialized with literal quotes ("C:\Users\...\"), which caused the Node.js module loader to resolve it as a relative path appended to the directory itself, resulting in MODULE_NOT_FOUND:
Because this runs at the PreToolUse lifecycle hook, it creates a deadlock—the agent cannot execute any tools or repairs internally once the hook fails.
Fix: Manually stripping the extra escaping/quotes from the JSON configurations using an external PowerShell script resolved the issue and restored tool execution. This looks like a path sanitization issue that should be addressed in the Windows installer/updater for the plugin harness.
The reason Node.js prepends the working directory and fails with MODULE_NOT_FOUND comes down to how path.win32.isAbsolute() evaluates quoted strings. When the bundle target in hooks.json is serialised with surrounding literal quotes ('"C:\..."'), the leading character is a quotation mark rather than a drive letter. Node evaluates path.isAbsolute() as false, treats the path as relative, and appends it to process.cwd() (the plugin directory). Because quotation marks are illegal in Windows filenames, resolution fails before Node opens the file.
Regex replacements on hooks.json get clobbered because the host harness regenerates hooks.json from the plugin manifest whenever the runtime or plugins reload.
If you want a persistent mitigation that survives restarts without re-running an external script, disable the plugin cleanly in ~/.gemini/config/config.json under userConfig:
Disabling it unregisters the PreToolUse hook entirely, preventing the harness from invoking the broken path.
Architecturally, optional telemetry hooks should be fail-open rather than fail-closed. Wrapping telemetry execution in a soft exit 0 ensures telemetry failures never abort core agent tool execution.
Nice catch tracking down that nested quote in hooks.json, @kml, and great breakdown from @dllhell on how path.win32.isAbsolute() trips over the leading quote and how to disable the plugin in config.json.
To tie everything together in case you want to keep the telemetry plugin enabled rather than turning it off completely, there are two small tweaks that solve both the fail-closed lockout and the reload overwrite on Windows:
First, because the Antigravity hook runner always launches cmd /c with the working directory already inside the plugin folder (~/.gemini/config/plugins/googlecloudtools.datacloud_telemetry), you can swap the broken C:\Users\... path in hooks.json for a relative path and append || echo {}:
The || echo {} makes the hook fail-open: if Node ever throws an error on the telemetry script, cmd /c still exits 0 and prints {} to stdout so Antigravity lets your tool calls through.
Second, if you want to keep that relative-path edit from getting overwritten when the host harness regenerates hooks.json on startup, you can lock the file read-only in PowerShell right after saving it:
Between @dllhell’s userConfig toggle to disable the plugin cleanly and this fail-open relative path if you need it running, you should be completely unblocked!
*this has been reviewed by, approved by and submitted on behalf of jaharoni