AI Models & Platforms
xAI Adds Cross-Session Memory to Grok Build Coding Agent

xAI on September 16, 2026 announced cross-session memory for Grok Build, its terminal coding agent, a feature that records conventions, decisions, and project facts as markdown notes in the background and reads them back in later sessions. Memory is available in Grok Build now and applies to new sessions.
xAI says the agent keeps notes on the conventions, decisions, and project facts that come up while a user works, and that later sessions read those notes before touching related code. The company presents the feature as one that makes Grok Build better the more it is used.
The announcement demonstrates the behavior with a terminal session in a project called orbit. Asked to run the test suite, Grok runs cargo test, and the integration tests fail with a Postgres connection error, with 143 tests passing and five failing. The user corrects the agent, explaining that the suite must run through just test, which starts the test database first. With just test, the suite passes with 148 tests and none failing. A topic file named testing.md then records the convention, noting that the suite runs with just test because plain cargo test fails the integration tests, that just test followed by a crate name runs a single crate, and that integration tests seed from tests/fixtures/seed.sql. In a later session, when the user asks for a retry with backoff in the webhook sender, Grok edits src/webhooks.rs, recalls that the testing topic says the suite runs through just test, and verifies the change with 151 tests passing.
Background Capture and Markdown Storage
Capture runs after a turn completes. Grok reviews the finished turn in the background, records anything durable, and continues without interrupting the session. Notes are stored as markdown files, one topic per subject. Each project has its own workspace scope, while a global scope holds preferences that apply everywhere.
Two commands manage what accumulates. The /dream command merges new observations into the topic they belong to and also runs on its own periodically in the background, folding notes into topic files over time so each project ends up with a small set of organized references. The /memory command shows the files as they are on disk.
What Memory Holds and How Recall Works
According to xAI, memory holds the details most likely to matter in a later session: how the team writes and reviews code, decisions and the reasoning behind them, and durable project facts ranging from where a subsystem lives to which command runs the suite. Left out are task state, tentative conclusions, secrets, and anything the repository or its own documentation already covers. Notes are kept per project, plus a global set for preferences that apply everywhere.
Recall happens automatically. Before starting related work, Grok reads the topics that cover the area it is about to work in and applies them, including in sessions where the subject never comes up. When a conflict arises, instructions in the current conversation take precedence over anything in a note.
The Memory Browser and Command Set
The /memory command opens a read-only browser of every memory file, grouped by scope, with a preview of the selected file. xAI describes the browser as the fastest way to see what a session produced and to find the file to edit when a note is wrong. The example in the announcement lists global files named MEMORY.md and preferences.md alongside workspace files named MEMORY.md, testing.md, code-style.md, and gateway.md, with keyboard controls for navigation, search, copying a path, deletion, toggling, fullscreen, and closing. The global memory index shown in the example carries a notice that it is generated by Grok and should not be edited directly.
xAI’s documentation for the tool lists /memory, with the alias /mem, as the command to browse, view, and manage memories, and it describes /dream as running memory consolidation and /flush as flushing conversation memory to disk immediately. A separate core command, /remember followed by a note, saves a memory note directly. The documentation states that these shell-provided commands appear when cross-session memory is enabled.
Availability and Product Context
Memory is available in Grok Build now, and it applies to new sessions: users run /new or start a fresh grok session, and notes begin after the first completed turn. The announcement supplies the install command curl -fsSL https://x.ai/cli/install.sh | bash alongside a Try Free link.
The Grok Build product page describes the tool as a coding agent for complex work now powered by Grok 4.6, available to try for free, and lists Memory among its features with the description “Persist decisions and context across sessions.”












