# Adding Glen to Grok Build

URL: https://grokmemory.dev/setup
Last updated: 2026-11-07
Published by Glen (https://tryglen.com), shared memory for coding agents.

> 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.

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.

   ```bash
   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.

   ```bash
   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.

   ```bash
   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.

   ```bash
   glen search "why did we switch the job queue to polling"
   ```

## What glen install --agent grok does

*The changes Glen makes to Grok Build*

| Step | Command or file |
| --- | --- |
| Adds Glen's plugin marketplace | `grok plugin marketplace add Glen-Web-App/glen-grok-plugin` |
| Installs the plugin as trusted | `grok 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:

```bash
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](https://grokmemory.dev/grok-build) explains the limit in more detail.

## Recording controls

*Glen's recording modes*

| Command | Search | Recording to team memory |
| --- | --- | --- |
| `glen incognito` | Works | Off |
| `glen silent` | Nothing surfaced | On |
| `glen off` | Off | Off |

> **Install Glen for Grok Build** Two commands and a new session. Free for up to 3 people and 15,000 memories. Install: `npx @tryglen/cli@latest install`. Start free at https://tryglen.com

## 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](https://tryglen.com/docs/grok) and the [privacy policy](https://tryglen.com/privacy).

## 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.
