Introduction
On September 16, 2026, xAI rolled out native cross-session memory capabilities for Grok Build CLI. This new feature automatically records project specifications, decision-making rationales and factual project details into Markdown notes after every dialogue round. When users initiate a new relevant work session, Grok Build reads these historical notes upfront to maintain consistent project context. This article reconstructs the complete workflow of Grok Build Memory based on xAI official announcements and repository user guides. It clarifies what information gets persisted, storage architecture, inspection methods, configuration rules, benchmark data, and side-by-side comparisons against competing CLI tools, along with actionable deployment recommendations for engineering teams.
Core Definition: What is Grok Build Memory
Grok Build Memory is a persistence mechanism designed for cross-session retention of project specifications, decision records and stable project facts within Grok Build. According to xAI’s official *Memory in Grok Build* documentation published on September 16, Grok will review and write durable content after each conversation turn concludes. Before the start of follow-up work on related code repositories, Grok loads and references these stored notes. Direct instructions issued within the current dialogue carry higher priority than memory records.
In practical terms, earlier Grok Build sessions operated as isolated stateless interactions. Starting from this release, after running the first task in a new /new session, Grok will begin accumulating reusable project knowledge automatically.
Intent Mapping: Common User Questions
Based on community discussions and search trends, inquiries about this memory feature fall into four distinct categories. This article addresses each category in separate sections:
- Definition questions: What memory is, and how it differs from regular chat session summaries.
- Decision questions: Comparison between Grok Build memory and Claude Code memory, plus evaluation of whether the feature is worth enabling.
- Operational questions: How to view, edit and delete memory content, and when to trigger the
/dreamconsolidation command. - Scenario questions: Multi-project management, cross-device migration, privacy control and data governance rules.
What Grok Remembers and What It Does Not
Per the “What it remembers” section from xAI’s news release, memory storage is limited strictly to three types of project information:
- Team coding conventions and code review habits
- Technical decisions and the reasoning behind those choices
- Durable project facts, including subsystem locations and valid test command definitions.
Four categories of content are explicitly excluded from memory storage: transient task states, exploratory tentative conclusions, private keys and secrets, and content already documented in code repositories or project documents. In short, Grok Build memory functions as a knowledge log for accumulated engineering experience. It is not a cloud disk, and it never stores passwords or sensitive credentials.
The official example demonstrates the practical value. In the orbit project, the cargo test command kept failing due to PostgreSQL connection errors; the test suite would hang after 143 attempts. Grok recorded that developers must use just test to skip specific database-related test cases. In later webhook validation iterations, the model directly reused the just test instruction. All 151 test cases completed successfully without hitting the same bottleneck again.
Three-Stage Pipeline: Capture, Dream, Recall
The memory system follows a three-phase workflow, rather than simple incremental text appending.
Capture
Capture executes automatically at the end of every conversation turn, without interrupting active work. Grok reviews the finished interaction and converts valuable takeaways into Markdown fragments. The official repository user guide notes that recall injection is enabled by default. A min_score threshold of 0.9 filters low-value fragments, preventing irrelevant notes from polluting subsequent sessions.
Dream
Dream handles consolidation of scattered memory fragments. The /dream command merges fragmented notes and reorganizes them into themed topic files such as topics/testing.md. Automatic Dream runs are enabled by default. The system scans the memory repository periodically, triggered either after a set number of dialogue turns or at fixed time intervals. Users can also manually invoke /dream to trigger consolidation immediately when memory fragmentation and search noise become excessive.
Recall
Recall activates before relevant task work begins. Grok loads and applies topic files matching the current project domain, even if the user does not explicitly reference that subject in the opening prompt. The official v1.0.9 changelog emphasizes that memory content is assembled from accumulated historical context, combining past records and real-time conversation sources.
Storage, Inspection and Modification
All memory assets are stored locally as Markdown files on disk. Users can open and edit these files directly. After manual edits, the file watcher service rebuilds the search index automatically. The directory structure separates global memory and project-specific topic files.
- Global memory path:
~/.grok/memory/MEMORY.mdfor cross-project preferences and team-wide conventions - Project memory path:
~/.grok/memory/<project-slug>-<hash8>/MEMORY.mdfor specifications tied to one specific repository - Session archives: Saved under the
sessions/subdirectory, with message counts, top five substantive prompts and UTC timestamps. Memory files are generated lazily and do not add latency during LLM invocations.
| Command | Function | Recommended Usage Scenario |
|---|---|---|
/memory | Opens a memory browser to preview all stored notes sorted by relevance score | Quickly audit memory records or locate incorrect notes for editing |
/dream | Merges memory fragments into organized topic files | Use when notes become fragmented or search results contain excessive noise |
/remember | Manually append a custom memory entry; verify file path via scrollback | Capture critical decisions that the model fails to record automatically |
/flush | Immediately persist and save all records from the active session | Run before shutdown or device migration to avoid data loss |
If memory records contain errors, users should edit the underlying Markdown file directly, rather than repeatedly correcting the model in chat dialogue. Memory configuration lives under the [memory] section inside ~/.grok/config.toml. Priority order for configuration is: environment variable GROK_MEMORY > TOML configuration > remote managed settings. Remote managed memory remains disabled by default and must be manually activated. Official examples show global MEMORY.md files around 1.2KB and project testing notes around 1.3KB. Compact memory files are considered healthy for performance.
Differences from Memory Implementations of Similar Tools
Grok Build 0.1 is built on a LLM baseline released on May 14, 2026, with a 256K context window. Its pricing stands at $1 per million input tokens and $2 per million output tokens. xAI reports a verified SWE-bench score of 70.8%. This large context window underpins the memory workflow: long context capacity supports topic recall, making coding and agent-driven workflows the primary use case.
Compared to in-chat session summarization used by Claude Code, Grok Build implements cross-session file-based memory. Everything viewed under /memory corresponds directly to files on the local disk, which supports version control and diff comparison. Third-party developers previously built Hindsight plugins to implement supplementary memory for Grok Build. The native memory release fully replaces this external plugin solution.
Onboarding and Availability
The memory feature applies to newly created sessions. Users can start a fresh workspace with /new or launch a completely new Grok instance. The first completed task will begin generating memory records. Installation uses the official one-line shell script:
Existing old sessions will not be retroactively processed. To bring legacy projects into the memory workflow, start a new session, run one full task such as test suite execution or a single code refactor, and allow Grok to capture two rounds of interactions. Teams are advised to standardize three core types of records via /remember: test command definitions, fixture locations, and commit message formatting rules. Once these baseline rules are stored, subsequent sessions can reuse the knowledge automatically.
When deploying multiple coding agents and CLI tools across teams, unified traffic routing and observability simplify model consumption tracking. 4sapi, an API gateway, helps developers manage multi-model endpoints in integrated workflows.
Boundaries and Troubleshooting
- Current-turn instructions always override memory records. Temporary exceptions can be stated directly in the chat without modifying memory files.
- Secrets, tokens and customer data are never written to memory. Information already present in repository files will not be duplicated again.
- When memory entries contain mistakes, open files via
/memoryfor direct edits. This approach is far more reliable than correcting the model repeatedly in conversation. - If automatic
/dreamfails to run: verify whethermemory.dreamis enabled in configuration, and confirm the global memory toggle is not disabled viaGROK_MEMORY=0. - Cross-device migration: copy the entire
~/.grok/memoryfolder to the new machine. Existing community ecosystem projects for Grok Build memory persistence, such as layered memory and modular memory extensions, all adopt this identical directory structure.
Conclusion
Grok Build Memory extracts reusable engineering knowledge from dialogue history and converts it into editable Markdown assets. The three-stage pipeline consists of background Capture, scheduled Dream consolidation and Recall loaded at the start of new tasks. According to xAI official documentation, this memory mechanism is fully ready for production use within Grok Build CLI. All data cited in this article is current up to September 17, 2026.
References
- xAI official announcement: Memory in Grok Build (2026-09-16): https://x.ai/news/grok-build-memory
- 4sapi AI large model marketplace: https://4sapi.com/pricing
International access: https://4sapi.com
Domestic access: https://4sapi.cn




