drayGet started

Coding agents Facts checked 12 October 2026

Grok Build memory

Grok Build loads rules such as AGENTS.md into every session and saves each conversation on your computer. Its memory across sessions is experimental and off by default. Dray saves each turn to your Dray account, where every agent you connect can search it.

Get started

Needs macOS or Linux with Node.js 18 or later.

ON THIS PAGE

How Grok Build remembers on its own

  • “Project rules are Markdown files that Grok loads into context for every session in a directory tree.” Grok loads global rules from ~/.grok/, then every folder from the repo root down to your working folder, and deeper files win when rules conflict. xAI docs: project rules
  • It reads AGENTS.md, AGENT.md, CLAUDE.md, CLAUDE.local.md and the Markdown files in .grok/rules/, and it reads .claude/rules/ and .cursor/rules/ too. Gitignored files are skipped, and files load in full with no size cap. xAI docs: project rules
  • grok inspect lists the rules files in use, and --rules adds rules for one run. xAI docs: project rules
  • Memory across sessions is experimental and off by default. --experimental-memory, the GROK_MEMORY variable or [memory] enabled turns it on, and --no-memory turns it off for one session. xAI docs: CLI reference xAI docs: settings
  • In the terminal app, /remember <note> saves a memory note, /memory browses your memories and /dream runs memory consolidation. grok memory clear removes the memory files. xAI docs: commands xAI docs: CLI reference
  • By default Grok also scans Claude Code’s and Cursor’s folders for skills, rules, agents, MCP servers and hooks ([compat.claude] and [compat.cursor]). xAI docs: settings

Where your history lives

  • Grok saves every conversation to disk automatically, with prompts, responses, tool calls and file snapshots, under ~/.grok/sessions/ by working folder. It works the same in the terminal app, headless mode and ACP. xAI docs: sessions
  • /resume opens a picker, and grok --resume or grok -c picks up the latest session for the folder. grok sessions list, search and delete manage them, and grok export <id> writes one as Markdown. xAI docs: sessions
  • grok import brings in sessions from Claude Code. xAI docs: CLI reference

What Dray adds

  • When a turn ends, Dray’s hooks read it from Grok’s own session files and save what you typed and the answer the turn ended on to your Dray account.
  • Images you paste into a prompt are saved with their turn while dray images is on. Dray: connect
  • Token saver is a free extra, off unless you run dray tokens on. On your computer, it outlines big files before Grok Build reads them. Grok Build can still read the full file. It can’t overwrite one it has only seen in outline until it has read all of it. Images stay as they are. Dray: connect
  • Anything in the text that looks like a key or password is removed on your computer before it is sent. Dray: connect
  • Setup connects Grok Build to your memory directly, and Grok Build picks it up at once. It can use Dray’s read-only tools without asking each time; saving to memory still asks. Dray: connect
  • Grok Build can then search what you saved from your other agents and web chats, and they can search what it saved. Dray does not read Grok’s own memory files.
  • Setup adds Dray’s commands to ~/.grok/skills: /link links this chat with your other chats, /link CODE joins a link another chat made, /unlink leaves it, and /dray-status checks what Dray has saved. Dray: connect

Set it up

Watch Grok Build setup0:38 · YouTube

One command sets up Grok Build and the other agents it finds on your computer. It needs Node.js 18 or later on macOS or Linux, and no Chrome extension.

Terminal
curl -fsSL https://api.withdray.com/cli/install.sh | sh
  1. Your browser opens Dray. Use the same Dray account as your web chats and choose Connect coding agents. This approves the computer.
  2. Setup lists the agents it found, all ticked. Untick any you want to leave out with the arrow keys and space, then press Enter.
  3. For Grok Build, setup adds hooks in ~/.grok/hooks/, Dray’s memory tools in ~/.grok/config.toml and Dray’s instructions in ~/.grok/AGENTS.md. It offers to import the last 30 days of your Grok Build sessions.
  4. Grok Build picks up the connection at once.

To set up Grok Build on its own, or add it later:

Terminal
dray setup --agents grok

Memory tools only, by hand

If you connected Dray to Grok on grok.com, Grok Build already has it: type /mcps and it’s listed as Dray (managed). Otherwise run: Dray: connect

Terminal
grok mcp add --transport http dray https://mcp.withdray.com/mcp

Then type /mcps inside Grok Build, select dray and press i to sign in. Connecting this way does not save your sessions.

Limits

  • Not saved: tool calls, command output, file contents, the agent’s reasoning, subagent threads, and the narration before a turn’s last tool call. Dray: connect
  • This computer’s sign-in lasts about 90 days. After that, new sessions wait on your computer until you sign in again. Dray: connect
  • Uploading and learning are separate steps, so a new session may take a while to show up in a search. Saved sessions count toward your plan’s monthly allowance like any other messages. Dray: connect

Sources

Facts checked on 12 October 2026 against these pages.