Grok Build
Connect Grok Build, the coding agent, to Nowledge Mem with startup context, memory guidance, and automatic session capture.
This page is for Grok Build, xAI's coding agent with plugins, hooks, skills, and local ~/.grok/ sessions. It is not the setup path for the consumer Grok chat experience on grok.com or x.com. For web Grok conversations, use the browser extension guide or the Grok Web connector.
Nowledge Mem connects to Grok Build through its plugin system. Install it once, restart Grok Build, and new coding-agent sessions can start with your Mem context and save real transcript history back into Mem.
Read https://mem.nowledge.co/SKILL.md and follow the instructions to install or update Nowledge Mem for Grok Build. Verify with nmem status and the Context Bundle or Working Memory check, then summarize what changed.Paste that into Grok Build if you want the agent to do the setup. If you prefer the terminal, use the steps below.
What success looks like
After setup, start a fresh Grok Build session and ask "What was I working on?" It should receive Context Bundle or Working Memory. After one normal turn, this should find the captured thread:
nmem t search "a phrase from the Grok Build turn" --source grokRequirements
- Grok Build installed and signed in
nmemavailable on the same machine that runs Grok Build- Nowledge Mem desktop app running locally, or
nmemconfigured for your remote Mem server
If Grok Build runs on the same Mac as the Mem desktop app, install the CLI from Settings → Preferences → Developer Tools → Install CLI. If Grok Build runs on another machine, install the standalone CLI there:
python3 -m pip install --user nmem-cli
# or
pipx install nmem-cliInstall
grok plugin install nowledge-co/community#nowledge-mem-claude-code-plugin --trustRestart Grok Build after installation.
The package is shared with our Claude Code connector because Grok Build can load Claude-compatible plugin assets. The hook detects Grok Build at runtime, so its sessions are saved as source=grok, not as Claude Code.
Update
grok plugin update nowledge-memRestart Grok Build after updating.
Import older Grok Build sessions
Automatic capture starts after the plugin is installed. To backfill older Grok Build sessions, preview first:
nmem t sync --from grok --all-projects --limit 20Then import:
nmem t sync --from grok --all-projects --applyUse -p /path/to/project instead of --all-projects when you only want one project. The command reads Grok Build's local ~/.grok/sessions files on this machine and writes to the Mem server configured in nmem.
Remote Mem
For remote Mem, configure this machine once:
nmem config client set url https://your-server
nmem config client set api-key your-keyThe Grok Build hook still reads local session files on the machine where Grok Build runs, then uploads normalized messages through nmem. The remote server does not need filesystem access to ~/.grok.
Customize behavior
Do not edit the installed plugin files under ~/.grok/installed-plugins. Put behavior changes in Grok Build project rules or the project instruction files it already reads.
For multi-agent launchers, set NMEM_AGENT_ID=<agent-slug> before launching the Grok Build worker when that worker represents a stable long-term AI identity. Add NMEM_SPACE only when the whole run should be forced into one Mem space.
What the connector includes
- Session-start Context Bundle / Working Memory injection
- Guided memory search and distillation skills
/save,/search,/sum, and/statuscommands- Stop and PreCompact hooks that call
nmem t save --from grok - Historical import through
nmem t sync --from grok
Troubleshooting
nmem is not found
Install the CLI on the same machine that runs Grok Build, then run nmem status.
The Grok Build thread is not appearing
Restart Grok Build after install or update. Then run:
nmem --json t save --from grok -p .If that works, the connection is healthy and the hook will keep new sessions current.
You see Claude Code wording in the package
That is expected in a few shared package filenames. The runtime behavior is Grok Build-aware: hooks pass --source-app grok and nmem t save --from grok.