The memory we recommend for Grok Build is Glen, shared memory for coding agents.Go to tryglen.com →
Setup2 min read

Glen, shared memory for coding agents

Adding Glen to Grok Build

Install the glen CLI with npx @tryglen/cli@latest install, then run glen install --agent grok. That adds Glen's plugin marketplace, installs the glen plugin with --trust, and writes ~/.grok/rules/glen.md. Start a new Grok Build session afterwards: sessions record to your organization's memory, and the agent runs glen search when it needs past work.

Get Glen for Grok Build
On this page
  1. What glen install --agent grok does
  2. Recording controls
  3. This does not cover grok.com
  4. Frequently asked questions
  1. Install the glen CLI and sign in. You need Node.js. The installer sets up the glen command and opens a browser so you can create a free account or join your team's organization.
    npx @tryglen/cli@latest install
  2. Add Glen to Grok Build. This adds the plugin and its rules file in one go. The next section lists exactly what it runs.
    glen install --agent grok
  3. Start a new Grok Build session. Open a fresh grok session so it starts with the plugin and ~/.grok/rules/glen.md loaded.
  4. Import recent history (optional). Backfill your last 30 days of local sessions so searches have something to find on the first day.
    glen import
  5. Search past work. Ask the agent to check Glen, or run a search yourself. The answer cites its sources and arrives in about 10 seconds.
    glen search "why did we switch the job queue to polling"

What glen install --agent grok does

The changes Glen makes to Grok Build
StepCommand or file
Adds Glen's plugin marketplacegrok plugin marketplace add Glen-Web-App/glen-grok-plugin
Installs the plugin as trustedgrok plugin install glen --trust
Writes the rules file~/.grok/rules/glen.md

To do it by hand, run the two grok plugin commands yourself, keeping --trust on the install as the installer does:

grok plugin marketplace add Glen-Web-App/glen-grok-plugin
grok plugin install glen --trust

Recall stays on demand after setup, because Grok discards what SessionStart and UserPromptSubmit hooks return. Grok Build's hooks explains the limit in more detail.

Recording controls

Glen's recording modes
CommandSearchRecording to team memory
glen incognitoWorksOff
glen silentNothing surfacedOn
glen offOffOff

This does not cover grok.com

Everything above applies to Grok Build, the grok CLI. Glen does not connect to the grok.com chat app, which has its own memory. Glen does not train AI models on customer content; see Glen's Grok docs and the privacy policy.

Frequently asked questions

What does glen install --agent grok change?

It runs grok plugin marketplace add Glen-Web-App/glen-grok-plugin, then grok plugin install glen --trust, and writes ~/.grok/rules/glen.md.

Why do I need to start a new Grok Build session?

Starting fresh makes sure the session loads the plugin and the new rules file from the start.

Will Glen inject memories into my Grok Build prompts?

No. Grok discards what SessionStart and UserPromptSubmit hooks return, so the agent recalls by running glen search.

Can I install Glen for the grok.com app?

No. Glen supports only Grok Build, the coding CLI. The grok.com app keeps its own separate memory.

More in this guide

Related guides on agent memory

Fix your agents’ amnesia.

Glen gives Grok Build the memory of every session your team has run. Start on your own or with up to two teammates. Your first 15,000 memories are free, no credit card.

Start free at tryglen.com