Environment
- grok 1.0.3 (1a29d5bc12d4) [stable]
- macOS (Darwin 25.6.0)
Summary
Hooks sourced from an installed plugin, or imported via Grok's
Claude-compatibility scanner (the "Claude settings" group in the Hooks tab),
are shown in the UI as loaded and trusted, but are never actually dispatched
when their event fires. Only hooks placed directly under the global
~/.grok/hooks/*.json directory are dispatched.
Repro steps
- Create a plugin with a
hooks/hooks.json containing a Stop hook (a
simple command that writes to a file, or exits non-zero with a message).
grok plugin install <path> --trust
- Confirm in the Hooks tab (
/hooks) that the hook appears under a
dedicated Plugin: <name>-<hash> group, not blocked.
- Launch grok with
--debug-file <path> (works with both a brand-new
session and --resume of an existing one — both reproduce identically).
- Send any prompt and let the turn complete (triggers
Stop).
- Grep the debug log for
hook_event= and loaded hooks hook_count=.
Expected
The Stop hook fires: a hooks.dispatch{hook_event=stop ...} span appears in
the debug log, and the hook's side effect (file write / exit-2 message)
happens.
Actual
xai_grok_shell::session::acp_session::spawn: loaded hooks hook_count=1
at session spawn — this is only the global hook(s) under ~/.grok/hooks/;
the plugin's hook is not among them.
xai_grok_hooks::discovery: hooks: discovery complete total_hooks=0 ... stop=0 ... — even though the plugin manager
(xai_grok_agent::plugins::discovery) separately logs has_hooks=true
for the plugin.
- After the turn completes, no
hook_event=stop (or hook_event=post_tool)
dispatch span appears anywhere in the log. The hook's side effect never
happens.
What I ruled out
- hooks.json format: byte-for-byte the same schema as a working global
hook file (~/.grok/hooks/herdr.json, SessionStart, loads and dispatches
fine), and the same schema xAI's own grok-build-plugin-cc Claude Code
plugin uses for its SessionStart/SessionEnd hooks.
- Trust: installed with
--trust; the Plugins tab shows it under
"Direct installs", not blocked.
- Claude Code plugin-name collision: reproduced after fully uninstalling
the same-named plugin from Claude Code (claude plugin remove), so it
isn't the Claude-compat import path shadowing a native install.
--resume vs. fresh session: identical hook_count=1 /
zero-stop-dispatch result on both a --resumed session and a brand-new
one (start_type="new").
Notes
Filed after searching xai-org/plugin-marketplace (open + closed, several
phrasings) and xai-org/grok-build-plugin-cc for a duplicate — didn't find
one. xai-org/grok-build itself has no issue tracker.
Happy to share the full --debug-file output or the minimal repro plugin
directory if useful.
Environment
Summary
Hooks sourced from an installed plugin, or imported via Grok's
Claude-compatibility scanner (the "Claude settings" group in the Hooks tab),
are shown in the UI as loaded and trusted, but are never actually dispatched
when their event fires. Only hooks placed directly under the global
~/.grok/hooks/*.jsondirectory are dispatched.Repro steps
hooks/hooks.jsoncontaining aStophook (asimple command that writes to a file, or exits non-zero with a message).
grok plugin install <path> --trust/hooks) that the hook appears under adedicated
Plugin: <name>-<hash>group, not blocked.--debug-file <path>(works with both a brand-newsession and
--resumeof an existing one — both reproduce identically).Stop).hook_event=andloaded hooks hook_count=.Expected
The Stop hook fires: a
hooks.dispatch{hook_event=stop ...}span appears inthe debug log, and the hook's side effect (file write / exit-2 message)
happens.
Actual
xai_grok_shell::session::acp_session::spawn: loaded hooks hook_count=1at session spawn — this is only the global hook(s) under
~/.grok/hooks/;the plugin's hook is not among them.
xai_grok_hooks::discovery: hooks: discovery complete total_hooks=0 ... stop=0 ...— even though the plugin manager(
xai_grok_agent::plugins::discovery) separately logshas_hooks=truefor the plugin.
hook_event=stop(orhook_event=post_tool)dispatch span appears anywhere in the log. The hook's side effect never
happens.
What I ruled out
hook file (
~/.grok/hooks/herdr.json,SessionStart, loads and dispatchesfine), and the same schema xAI's own
grok-build-plugin-ccClaude Codeplugin uses for its
SessionStart/SessionEndhooks.--trust; the Plugins tab shows it under"Direct installs", not blocked.
the same-named plugin from Claude Code (
claude plugin remove), so itisn't the Claude-compat import path shadowing a native install.
--resumevs. fresh session: identicalhook_count=1/zero-stop-dispatch result on both a
--resumed session and a brand-newone (
start_type="new").Notes
Filed after searching
xai-org/plugin-marketplace(open + closed, severalphrasings) and
xai-org/grok-build-plugin-ccfor a duplicate — didn't findone.
xai-org/grok-builditself has no issue tracker.Happy to share the full
--debug-fileoutput or the minimal repro plugindirectory if useful.