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

Glen, shared memory for coding agents

Inside Grok Build: rules, memory, MCP and hooks

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.

Get Glen for Grok Build
On this page
  1. The rules files Grok Build reads
  2. The experimental memory
  3. MCP servers in config.toml
  4. What Grok Build hooks can and can't do
  5. Frequently asked questions

The rules files Grok Build reads

Grok Build instruction sources, November 2026
SourceTypical useShared with other agents?
AGENTS.mdRepo rules every agent should followYes: Codex, Cursor and others read it too
CLAUDE.mdRules a repo already keeps for Claude CodeYes, with Claude Code
.grok/rules/Instructions meant for Grok Build aloneNo

Reading AGENTS.md and CLAUDE.md is convenient for mixed teams. A repo tuned for Codex's AGENTS.md or for Claude Code 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 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
HookWhat Grok does with its outputEffect on memory tools
SessionStartDiscards itCan't preload context for the session
UserPromptSubmitDiscards itCan'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.

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.

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