# Grok Memory --- --- > How xAI's Grok Build CLI handles rules and memory, how it differs from the grok.com app's memory, and how a team adds shared memory to Grok Build with Glen. --- --- # Grok memory: two products, two answers URL: https://grokmemory.dev/ Last updated: 2026-11-07 Published by Glen (https://tryglen.com), shared memory for coding agents. > "Grok memory" covers two different products. The grok.com chat app has its own consumer memory, and Glen does not connect to it. Grok Build, xAI's coding CLI (grok), reads rules from AGENTS.md, CLAUDE.md and .grok/rules/ and has a cross-session memory that is experimental and off by default; Glen adds shared team memory to Grok Build through a plugin, with recall on demand through glen search. ## First, which Grok? *The two Groks people mean by "Grok memory", November 2026* | Product | What it is | Its memory | Works with Glen? | | --- | --- | --- | --- | | grok.com | xAI's consumer chat app | Its own consumer memory | No. Glen does not connect to it. | | Grok Build (`grok`) | xAI's coding CLI | Rules files, plus experimental cross-session memory (off by default) | Yes, through Glen's Grok Build plugin | If you came here wanting grok.com to remember a conversation, that is handled inside the grok.com app, and nothing on this site changes it. The rest of this site is about Grok Build, the terminal coding agent. ## What Grok Build remembers, and where that stops - **Rules files.** Grok Build reads AGENTS.md, CLAUDE.md and anything in `.grok/rules/`. A repo already set up for Codex or Claude Code hands Grok the same rules with no extra work. - **Experimental memory.** A cross-session memory exists, but it is experimental and switched off unless you enable it. - **MCP servers** are configured under `[mcp_servers]` in `~/.grok/config.toml`, which is how external tools reach the agent. - **The gap.** None of this collects what your teammates' sessions worked out, in Grok or in any other agent. Rules hold what someone wrote; the experimental memory is Grok's own. The [Grok Build page](https://grokmemory.dev/grok-build) goes deeper on each piece. ## How Glen works with Grok Build [Glen](https://tryglen.com) is hosted memory for your organization. Running `glen install --agent grok` adds Glen's plugin to Grok Build and writes a rules file, `~/.grok/rules/glen.md`. The plugin records your sessions into the same store as your teammates' sessions from [Codex](https://codexmemory.com), Claude Code, Cursor and Pi, alongside public Slack channels, GitHub and call transcripts. At recall, each memory is checked against what the asking user may already see. > **Recall is on demand in Grok Build:** Grok discards whatever SessionStart and UserPromptSubmit hooks return, so no hook can place memories in front of the model. The agent recalls by running `glen search` when a task touches past work. Each search returns a written answer with a citation for every claim, in about 10 seconds. > **Give Grok Build your team's memory** One CLI install, one glen install --agent grok, and new sessions can search everything your team recorded. Free for up to 3 people. Install: `npx @tryglen/cli@latest install`. Start free at https://tryglen.com ## What the benchmark does and doesn't show Glen's own test re-implemented the last 100 merged PRs of a workspace with two months of history, using Codex 5.5, five runs per PR with and without Glen, memory rolled back to before each PR. With Glen, runs used 29% fewer tokens and finished 21% faster, with quality at parity or better. That setup injected recall before the first turn. Grok Build recalls only when the agent searches, so expect results to vary. [Read the write-up](https://tryglen.com/blog/replaying-100-prs). ## Matching knowledge to a layer *Where Grok Build knowledge should go* | You want Grok Build to | Use | | --- | --- | | Run the formatter before every commit | AGENTS.md or `.grok/rules/` | | Follow the same rules your Codex and Claude Code users have | A shared AGENTS.md | | Learn why a teammate's session rejected the polling design | Glen, through `glen search` | | Trace lines in a file back to the session that wrote them | `glen code-search` | | Remember a chat on grok.com | grok.com's own memory, outside Glen | Glen isn't the answer for rules that must hold on every task; they belong in AGENTS.md or `.grok/rules/`, because they shouldn't depend on the agent remembering to search. It is also hosted only. If those fit, [setup takes a few minutes](https://grokmemory.dev/setup), and [team memory options](https://grokmemory.dev/team-memory) compares the alternatives. ## Frequently asked questions ### Does Grok remember conversations? The grok.com app has its own consumer memory for chats. Grok Build, the coding CLI, has an experimental cross-session memory that is off by default. ### Does Glen work with grok.com? No. Glen does not connect to the grok.com chat app. It supports Grok Build, xAI's coding CLI. ### What files does Grok Build read for instructions? AGENTS.md, CLAUDE.md and the files in .grok/rules/. Glen's installer adds one more, ~/.grok/rules/glen.md. ### Can Grok Build share memory with a team? Committed rules files share instructions. To share what each person's sessions learned, every teammate installs Glen into the same organization, and their agents search it with glen search. --- # Inside Grok Build: rules, memory, MCP and hooks URL: https://grokmemory.dev/grok-build Last updated: 2026-11-07 Published by Glen (https://tryglen.com), shared memory for coding agents. > Grok Build reads its instructions from AGENTS.md, CLAUDE.md and .grok/rules/, and offers a cross-session memory that is experimental and off by default. MCP servers are configured under [mcp_servers] in ~/.grok/config.toml. Grok Build has hooks, but it discards what SessionStart and UserPromptSubmit hooks return, so no hook can add memory to a turn. ## The rules files Grok Build reads *Grok Build instruction sources, November 2026* | Source | Typical use | Shared with other agents? | | --- | --- | --- | | `AGENTS.md` | Repo rules every agent should follow | Yes: Codex, Cursor and others read it too | | `CLAUDE.md` | Rules a repo already keeps for Claude Code | Yes, with Claude Code | | `.grok/rules/` | Instructions meant for Grok Build alone | No | Reading AGENTS.md and CLAUDE.md is convenient for mixed teams. A repo tuned for [Codex's AGENTS.md](https://codexmemory.com/agents-md) or for [Claude Code](https://claudecodememory.com) already gives Grok Build its conventions, and `.grok/rules/` is there for anything Grok-specific. Glen's own installer puts its instructions in `~/.grok/rules/glen.md`. ## The experimental memory Grok Build has a cross-session memory, labelled experimental and disabled by default. Being experimental, it may change, so it is a poor place for anything the team depends on. It is also Grok Build's own: sessions in Codex, Cursor or Claude Code don't feed it, and it doesn't feed them. Keep rules in files, and treat this memory as a personal convenience if you turn it on. ## MCP servers in config.toml External tools reach Grok Build as MCP servers, declared under `[mcp_servers]` in `~/.grok/config.toml`. The reference memory server, `@modelcontextprotocol/server-memory`, is one option. It keeps a knowledge graph of entities, relations and observations in a local JSONL file named by `MEMORY_FILE_PATH`. That file lives on one machine and holds only what the model decided to write. Glen also offers a [remote MCP server](https://memorymcp.dev) for MCP clients in general; for Grok Build, the plugin is the documented route. ## What Grok Build hooks can and can't do *Hook output in Grok Build* | Hook | What Grok does with its output | Effect on memory tools | | --- | --- | --- | | SessionStart | Discards it | Can't preload context for the session | | UserPromptSubmit | Discards it | Can't attach memories to a prompt | In agents where UserPromptSubmit can return context, such as Codex, a memory tool puts relevant past work in front of the model on every prompt. Grok Build doesn't allow that, so any memory has to be pulled by the agent itself. Glen handles this with its rules file, which points the agent at `glen search` when a task touches earlier work. > **Add team memory to Grok Build** Glen's plugin records your Grok Build sessions, and the agent searches the whole team's memory when it needs history. Install: `npx @tryglen/cli@latest install`. Start free at https://tryglen.com ## Frequently asked questions ### Does Grok Build have memory? It has a cross-session memory that is experimental and off by default, plus rules from AGENTS.md, CLAUDE.md and .grok/rules/ that load as instructions. ### Where do I configure MCP servers for Grok Build? Under [mcp_servers] in ~/.grok/config.toml. ### Does Grok Build read CLAUDE.md? Yes. It reads AGENTS.md, CLAUDE.md and .grok/rules/, so a repo set up for Claude Code or Codex already supplies its rules. ### Can Grok Build hooks inject context? No. Grok discards what SessionStart and UserPromptSubmit hooks return, which is why memory tools such as Glen recall on demand instead. --- # Shared memory for teams that code with Grok Build URL: https://grokmemory.dev/team-memory Last updated: 2026-11-07 Published by Glen (https://tryglen.com), shared memory for coding agents. > A team using Grok Build needs one person's session to find what another person's session already worked out. Committed AGENTS.md and .grok/rules/ files share instructions, but only what someone writes; the experimental memory and a local MCP memory server don't reach teammates. Glen records every teammate's sessions into one organization memory that Grok Build searches on demand with glen search. ## How to judge the options - **Capture.** Hook-based recording keeps every session. A save tool keeps only what the model remembered to save. - **Recall.** In Grok Build, recall is always pulled by the agent, because hooks can't inject context. What matters is how good the answer is when it does search. - **Reach.** Can it see sessions from teammates, including those on Codex, Cursor or Claude Code? - **Corrections.** When a decision is reversed, can you stop the old one from coming back? *Memory options for Grok Build teams, November 2026* | Option | Capture | Recall | Reach | | --- | --- | --- | --- | | Glen | Plugin records each session | Agent runs `glen search` | Your organization, filtered per user | | Committed AGENTS.md or `.grok/rules/` | By hand | Read as instructions | Anyone with the repo | | Grok Build's experimental memory | Grok's own, when enabled | Grok decides | Grok Build only | | Reference MCP memory server | What the model chooses to write | When the model queries it | One machine | | Mem0 or Supermemory | Calls to their memory API | When the agent searches | Whoever holds the key | ## What Glen adds for a Grok Build team Capture doesn't depend on the model. Glen's plugin records sessions automatically, so the memory reflects what was done. And because the store belongs to the organization rather than to Grok Build, a mixed team pools everything: a fix found in a colleague's [Cursor session](https://cursormemory.com) is there when your Grok agent searches. Search answers come with a citation per claim, which matters because a language model writes them and they can be wrong or stale. Glen checks access per memory at recall, so connecting GitHub or public Slack channels never shows anyone what they couldn't already open. When the team changes course, Glen aims to follow the decision that stuck; `glen forget` takes a stale memory out of recall, and restore reverses it. > **Try it with your team** Free covers up to 3 people and 15,000 memories. Import your last 30 days of sessions with glen import. Install: `npx @tryglen/cli@latest install`. Start free at https://tryglen.com ## Where Glen falls short - Recall in Grok Build depends on the agent choosing to search. Prompting it to check Glen helps. - There is no self-hosted build. - Recorded sessions are searchable across the organization, which some teams won't want. - Glen won't help with grok.com chats; it doesn't connect to that app. - For memory inside your own product, a memory API such as Mem0 (Apache 2.0) or Supermemory (MIT) fits better. More on that split at [memory for AI agents](https://memoryforaiagents.com). ## Frequently asked questions ### Can teammates share Grok Build memory? Not through Grok Build's own experimental memory. Share rules through committed AGENTS.md or .grok/rules/ files, and past sessions through a team memory such as Glen. ### Does Glen work if my team uses Grok Build and Codex? Yes. Both record into the same organization memory. Codex gets memories injected on each prompt; Grok Build reaches them through glen search. ### Is there an MCP memory server for Grok Build? Grok Build loads MCP servers from [mcp_servers] in ~/.grok/config.toml, so a server such as the reference memory server can be added there. It stays local to one machine. --- # 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.