Local-first π§ memory for Hermes Agent that lives in your Obsidian vault and remembers project context. Nightly π΄ dream passes turn repeat corrections into confirmed preferences with measurable confidence. Adapters ship for Claude Code, Codex, and OpenClaw, with an MCP server for anything else.
Variant 1: Native config.toml writer
- Approach: Extend the install-adapter registry with a grok adapter that writes the two canonical MCP entries directly into
~/.grok/config.toml[mcp_servers.*]and drops the three lifecycle hooks into~/.grok/hooks/*.json(Claude-compatible JSON shape). A grokSessionAdapterreads the ACPupdates.jsonl+summary.jsonstream. No plugin; integration lives entirely in grok's own first-class config surfaces. - Trade-offs:
- Pro: maximally native to grok's authoritative surfaces; pure-grok users with no
~/.claudeare served directly with zero compat-merge dependency. - Pro:
summary.json.parent_session_idfeeds the existing session-lineage work cleanly; hooks getGROK_HOOK_*/CLAUDE_PROJECT_DIRenv for free. - Con: config.toml is TOML and the project ships no TOML lib β forces a hand-rolled minimal emitter/patcher for the
[mcp_servers.<name>]table, whichserializeEntrydoes not currently cover (new on-disk shape + drift detection for TOML). - Con: produces no marketplace-publishable unit, so goal (b) is unmet; the integration is invisible to
grok plugin/marketplace tooling. - Con: the canonical
McpServerEntrymust be projected into TOML rather than reused as-is, a new serialization seam that can drift from the JSON targets.
- Pro: maximally native to grok's authoritative surfaces; pure-grok users with no
- Complexity: medium
- Risk: medium
Variant 2: Bundled grok plugin as the first-class unit (opencode-style two-pronged)
- Approach: Ship a version-stamped grok plugin asset (mirroring
opencode-plugin-asset.ts): a directory withplugin.json,.mcp.jsonin MCP standard format carrying the two canonical entries, andhooks/hooks.jsonfor the three lifecycle hooks. The install adapter places it under~/.grok/plugins/and force-enables it (config.toml[plugins] enabled/--trustpath), and a grokSessionAdapterimports the ACP session stream. The plugin is the marketplace-publishable unit. - Trade-offs:
- Pro: hits all four goals β pure-grok install path, marketplace-publishable first-class unit, and heavy reuse of the opencode-plugin-asset pattern + session-adapter registry.
- Pro: MCP lives in
.mcp.json(standard JSON) so the canonicalMcpServerEntryis reused verbatim with zero TOML for MCP β strongest DRY/anti-drift posture. - Pro: precedent #88 proves the config-write + bundled-plugin + session-adapter shape end to end.
- Con: plugins are disabled by default β the adapter must reliably force-enable (config.toml
[plugins] enabledappend orgrok plugin install --trust), a narrow TOML touch and a footgun if skipped, which the verify step must assert against. - Con: two delivery artifacts (plugin asset + thin config write) to keep version-synced, slightly more surface than a pure config writer.
- Complexity: medium
- Risk: low
Variant 3: Claude-compat piggyback shim
- Approach: Lean on grok's auto-merge of
~/.claude.jsonMCP and~/.claude/settings.jsonhooks via[compat.claude]; for pure-grok users, the existing Claude Code adapter writes those Claude-format files, and the only new code is a grok camelCase hook-stdin branch plus the grokSessionAdapter. Smallest possible footprint. - Trade-offs:
- Pro: minimal new code β reuses the Claude adapter outputs almost entirely; only the stdin parser and session adapter are grok-specific.
- Con: writing
~/.claude.json/~/.claude/settings.jsonfor a user who runs only grok is exactly the silent workaround the constraints forbid (maximally native, no crutches); it pollutes a foreign vendor's namespace. - Con: relies on compat-merge priority (config.toml > Claude > Cursor) staying stable across grok versions β fragile, no first-class ownership/drift tracking.
- Con: yields no marketplace unit (goal b fails) and is not "first-class native" (goal a is served only by impersonating Claude).
- Complexity: small
- Risk: high
Recommended: Variant 2
Rationale: Only Variant 2 satisfies all four sub-goals at once β it serves pure-grok users via a real install/enable path, ships the marketplace-publishable first-class plugin, and maximally reuses the existing seams (opencode-plugin-asset, .mcp.json standard format preserving the canonical McpServerEntry, session-adapter registry, hook lib). Routing MCP through the plugin's .mcp.json keeps grok off the TOML path entirely for the canonical payload, avoiding both the hand-rolled emitter that burdens Variant 1 and the namespace-impersonation workaround that disqualifies Variant 3, while #88 already proves the two-pronged shape end to end.