AI-generated editorial illustration; not a documentary photograph.
Grok Build passed all three memory tests in a comparison published by The New Stack, while Claude Code passed two. Both terminal coding agents recalled instructions within the same repository, but only Grok Build carried a user-defined rule into a separate project.
How the agents were tested
The comparison used Grok Build 1.0.40 with Grok 4.6 at high effort and Claude Code 2.1.226 with Opus 5. Each agent worked on separate copies of small Node repositories on a Mac. A first session introduced a fact or rule; after the agent was closed, a second session assigned work that depended on the earlier instruction without repeating it.
The tests covered a repository-specific test command, two project decisions involving monetary values and export format, and coding rules intended to apply across projects. Results were scored on whether each agent saved the instruction, read it later and followed it.
Project memory produced equal results
Both agents remembered to run make test instead of the failing npm test command. They also preserved decisions to represent money as integer cents and avoid a discarded CSV export path, despite conflicting code left in the repository. Grok Build and Claude Code stored these instructions in Markdown-based memory files and applied them in later sessions.
Claude Code's notes were judged better written by the tester, but that did not produce a measurable advantage in the two repository-scoped tasks. Claude Code was faster in every recall session, completing all three in 66 seconds versus 165 seconds for Grok Build.
Repository boundaries made the difference
For the cross-project test, Grok Build placed conventional-commit and code-comment rules in its global memory scope. It then followed those rules in an unrelated repository. Claude Code saved the instructions only in the first repository's memory directory, so its second-repository commit did not use the requested conventional format.
The comparison concerns Claude Code's CLI auto memory, which is scoped per repository. Anthropic also announced a Projects beta with shared memory across cloud threads on September 17, but the source says it was limited to select Pro and Max subscribers without existing projects.
Cost figures reflect different models
Across the three recall sessions, Grok Build used 390,848 tokens and cost $0.41, compared with 576,863 tokens and $1.05 for Claude Code. The source cautions that the price difference largely reflects the use of Grok 4.6 versus Opus 5, rather than isolating the efficiency of their memory implementations. The small, scripted test set also supports a comparison of these runs, not a universal ranking of either agent.
Source: Grok Build vs. Claude Code: I tested which one has the better memory

Leave a Reply