The rules files Grok Build reads
| 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 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 | 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.
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.