Build1 publisher3 min readPublished
Claude Code's per-repository memory store lost a rule set for all projects
Both terminal agents recalled planted facts inside a single project across three two-session tests on identical Node repos. Only Grok Build carried a stated convention into an unrelated repo, at about a third of the reported cost.
The Engineer · Build desk

What happened
- The New Stack ran three two-session tests on both tools: plant a fact, quit the tool, then give a task in a new session where the fact matters without mentioning it.
- Both agents recalled the make test rule and the integer-cents decision, building a refund on an amountCents field, leaving the repo's float helper alone and shipping a JSON export.
- Grok saved the cross-project rules to its global scope as git-and-code-style.md and produced a conventional commit in an unrelated repo; Claude Code stored them only in the first repo's folder.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- constraint A team on Claude Code's CLI pays the restating cost every time it adds a repository, because the note that encodes the house commit convention only applies inside the directory that holds it.
- cost The per-task dollar figures compare two billing arrangements as much as two agents: Grok's tokens were metered through an xAI API key while Claude Code drew on a flat subscription, so the spend lands on different budget lines.
- decision Picking one terminal agent for a team now means picking memory scope semantics. The two products diverge on the cross-repository case.
- exposure Claude Code's scoping warning arrives in the session that writes the note, so nobody is reading it days later in the repo where the convention goes missing.
The difference is scope. You can see it in where each tool puts the file. Grok Build keeps notes as Markdown in a workspace scope per project plus a global scope that applies everywhere, and `/memory` browses them [3]. Claude Code's auto memory keeps a MEMORY.md index plus one file per note, per repository, and the docs say it is on by default [4]. Grok's global scope gives a rule stated "for all my projects" somewhere to live; Claude Code's layout keeps it inside the current repo [17][3][4].
Claude Code said as much while writing the note. According to The New Stack it warned that its memory store "is scoped to this project's directory" [19]. In the second repo it found nothing, and the commit came back as `Add --help flag` [20]. Claude adds no comments by default, and none showed up here, so that half of the rule would have held with an empty memory store [20]. The New Stack wrote that Claude Code "passed the first rule but failed the second one" [21].
Inside one repo, both tools did what the announcements describe. xAI's pitch was that Grok "keeps notes on the conventions, decisions, and project facts that come up," and that "later sessions read those notes before touching related code" [2]. Grok's session-2 reasoning opened with "start by reading the memory files," then it ran `make test` and never touched `npm test` [10]. The write-up describes Claude Code arriving at the same command after reading the Makefile and package.json [11]. It also records Claude rewriting "last quarter" as "Q2 2026" when it stored the decision [14].
Across the two tests with complete figures, tool-reported spend was $0.29 for Grok Build, from $0.11 and $0.18, against $0.81 for Claude Code, from $0.32 and $0.49 [12][16][1]. About 2.8 times more [2]. Token totals ran 258K against 455K [3]. Speed went the other way on the decisions test, where Grok took 103 seconds and Claude Code 32 [16], roughly three times longer [4]. Every figure came from each tool's own headless mode, with Grok Build 1.0.40 running Grok 4.6 at high effort through an xAI API key and Claude Code 2.1.226 running Opus 5 on the author's subscription [7]. For the dollar gap to transfer you would need those same two models at the same effort setting, repos about the size of four small Node projects, and the same billing arrangement on both sides [7]. The write-up does not give Claude Code's cost for the third test [22].
Cross-thread shared memory does exist on Anthropic's side, in a Projects beta announced September 17 for select Pro and Max subscribers with no existing projects, and the tests ran on the CLI instead [5]. That third test only arrives once a team leaves its first repo: state a commit convention once, start a new repo, and it comes up on the first commit [4][20].
What to watch
- Whether Anthropic widens Claude Code's auto memory past the per-repository scope, or brings the Projects beta's cross-thread shared memory into the CLI.
- Whether Grok Build's global scope misfires the other way and applies a rule in a repo where it does not belong; these three tests did not probe that.
- A rerun with both agents on metered API billing would separate model price from memory behaviour.