Skip to content

Grok Build: nowledge-mem hooks never register (trust/update gap) — auto capture silent-fails #486

Description

@cicae

Summary

On Grok Build, automatic session capture (Stop / PreCompact / SessionEnd → nmem t save --from grok) does not run because the plugin’s lifecycle hooks never register in the session, even when the plugin is installed, enabled, and skills/commands load normally.

This is distinct from #472 (hooks fire but host defaults to claude-code). Here hooks appear absent from Grok’s hook_execution log entirely—so capture cannot succeed or fail; it simply never starts.

Manual nmem t save --from grok works. nmem status is healthy. The failure mode is silent and easy to misread as “Mem is broken” or “not configured.”

Environment (minimal)

Component Value
Grok Build CLI 1.0.0 (recent sessions also logged as 0.2.12x)
nowledge-mem plugin 0.7.22 (nowledge-co/community#nowledge-mem-claude-code-plugin)
nmem CLI / server 0.10.55, local, status ok
OS macOS 26.6

Config: [plugins] enabled = ["nowledge-mem"].

Expected

After install (ideally with Grok’s --trust):

  1. SessionStart / Stop / PreCompact / SessionEnd hooks from the plugin appear in Grok’s hook runner.
  2. Each completed turn auto-captures to Mem as source: grok (thread_id like grok-<session_id>).
  3. Plugin update does not silently drop capture; trust either persists or is re-prompted.

Docs currently read as if install alone is enough for automatic capture under Grok.

Actual

  1. Plugin enabled → skills and slash commands load.
  2. In session updates.jsonl / hook_execution events, only global hooks run (user hooks under ~/.grok/hooks/). No plugin-scoped nowledge-mem hooks appear.
  3. Local Grok transcripts accumulate under ~/.grok/sessions/, but Mem gains no new source=grok threads until a manual save/backfill.
  4. Pattern recurred around Grok CLI + plugin update windows (fix attempts → worked-looking state via backfill → silence again after updates).
  5. grok plugin install … --trust does not leave an observable durable trust state on disk; Grok’s binary surfaces trust-store failure strings (failed to read trust store; no plugins will be trusted). Skills still load (enable path), hooks stay inactive (trust path).

So: enable ≠ hooks running under current Grok Build plugin trust behavior.

Reproduction

  1. Install nowledge-co/community#nowledge-mem-claude-code-plugin (with or without --trust); ensure enabled.
  2. Confirm nmem status ok and skills like save/search are visible in Grok.
  3. Start a new Grok session in a project that already has local history under ~/.grok/sessions/.
  4. Complete a turn; inspect session hook_execution names.
  5. Observe: no nowledge-mem plugin hooks; Mem has no new grok-* thread.
  6. Run nmem t save --from grok -p . → succeeds immediately.
  7. After grok plugin update / CLI upgrade, recheck—hooks still missing or regress without a clear trust prompt.

Impact

Workarounds (verified locally)

  1. Global always-trusted hooks under ~/.grok/hooks/*.json that call the plugin’s nmem-hook-save.py (or nmem t save --from grok) on Stop / PreCompact / SessionEnd.
  2. Symlink/copy plugin into ~/.grok/plugins/ (Grok docs: auto-trusted path).
  3. Manual / scheduled backfill: nmem t save --from grok -m all -p <project>.

Requests

Host (Grok Build) — primary fix surface

Please treat as a Grok plugin-runtime bug (also sending via Grok /feedback):

  • install --trust should persist trust so plugin hooks register on subsequent sessions.
  • plugin update should preserve trust or re-prompt; do not leave “enabled skills, dead hooks.”
  • Surface trust/hooks status in /plugins / /hooks when a plugin’s hooks are blocked.

Nowledge plugin / docs — secondary

  1. Grok install docs: state explicitly that Grok requires plugin trust for hooks, that enable alone is insufficient, and how to verify (hook_execution / /hooks shows plugin hooks; a test turn creates grok-* in Mem).
  2. Document update regression: after Grok or plugin update, re-verify capture.
  3. Optional: ship or document a global-hook fallback install snippet for Grok when host trust is flaky (mirrors what works today under ~/.grok/hooks/).
  4. Cross-link Grok Build: Stop/PreCompact capture always uses --from claude-code and fails silently #472: even when hooks fire, host detection must use --from grok (already improved in later changelog; still worth a Grok verification matrix).

Related

Happy to provide redacted hook_execution name lists if useful (no full transcripts).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions