AI Coding Agents Broke Earlier Decisions in Up to 97% of Sessions
Contents

AI Coding Agents Broke Earlier Decisions in Up to 97% of Sessions
We ran Claude Code and Codex across multi-session projects. Without memory, a new session built the feature and dropped what the user had decided.
In our benchmark, AI coding agents that started each session fresh broke earlier project decisions almost every time: Claude Code kept them in 1 of 36 sessions (97% broke) and Codex in 2 of 36 (94% broke). With a HeyBrain brief at session start, Codex kept them in 36 of 36 and Claude Code in 33. This was a benchmark setup, not the live product.
- Claude Code (Sonnet 5.5) with no memory kept earlier decisions in 1 of 36 later sessions; Codex (gpt-6.2-sol) kept them in 2 of 36.
- A HeyBrain brief placed at session start kept them in 36 of 36 sessions on Codex and 33 of 36 on Claude Code.
- Each agent's own resume, run while its prompt cache was warm, kept about as many (35 and 36) and cost less than the brief.
- The brief did not make coding cheaper than a fresh session: about 3% more tokens on Codex and 37% more on Claude Code.
- Tests ran on six small projects written for the study, with a local HeyBrain test server, not the live product.
What did the coding agent test measure?
We gave Claude Code and OpenAI Codex six small Python projects written for this study, each with two chains of four sessions. A later session referred to earlier work only by name, such as "extend the exporter from last time", and depended on decisions a simulated user had stated earlier: a naming rule, a rejected library, a file format. Hidden tests, added after each session ended, checked whether those decisions were kept.
Each agent ran in five arms: a fresh session with the task only, the vendor's own resume, a notes file the agent keeps, a HeyBrain search tool, and a HeyBrain brief placed at the start of the session. Results cover sessions 2 to 4 of each chain, 36 sessions per arm per agent. The study's coding experiment gives the full setup.
How often did agents without memory break earlier decisions?
Almost always. A fresh Claude Code session kept the earlier decisions in 1 of 36 sessions, so it broke them in 35 (97%). A fresh Codex session kept them in 2 of 36 and broke them in 34 (94%). Both agents still built what they were asked: feature tests alone passed in 31 to 36 of 36 sessions in every arm.
That is the failure a person notices late. The new feature passes its own tests, while a library the user rejected comes back or a naming rule quietly changes.
Which kinds of memory kept the decisions?
Three arms kept most of them. The vendor's own resume kept 35 of 36 on Claude Code and 36 of 36 on Codex. The HeyBrain brief kept 33 and 36. A notes file the agent maintains kept 32 and 29. The HeyBrain search tool kept only 17 and 16, because agents seldom called it while coding: 17 calls in 36 sessions for each agent.
For anyone building agent memory, the lesson is that putting the relevant history into the session worked better than offering a tool the agent has to remember to use.
| Arm | Claude Code | Codex |
|---|---|---|
| Fresh session | 1/36 | 2/36 |
| Vendor's own resume | 35/36 | 36/36 |
| Notes file the agent keeps | 32/36 | 29/36 |
| HeyBrain search tool | 17/36 | 16/36 |
| HeyBrain brief | 33/36 | 36/36 |
Did memory make coding sessions cheaper?
No. In these sessions no notes, tool or brief arm had a lower median cost than starting with nothing. Against a fresh session, the brief used about 3% more tokens on Codex (range -5% to +7%) and 37% more on Claude Code (+4% to +91%). Resume, run soon after the previous session while its prompt cache was warm, was the cheapest way to keep decisions: the brief cost 38% more than resume on Claude Code and 172% more on Codex.
So the brief is for the case resume does not cover: when the earlier session cannot be resumed soon after it ends. We did not measure resuming after the cache expires.
What are the limits of this test?
The projects are small (400 to 800 lines, standard library only) and the decisions came from a simulated user. Each configuration ran once. HeyBrain ran as a local server with production's search interface and retrieval code over a per-project store, not the production service. The task specs were reviewed by the study agent, not an independent human. Treat the numbers as a benchmark result, not a forecast for your repository.
About these numbers
HeyBrain tests, Nov 2026: Claude Code (Sonnet 5.5) and Codex (gpt-6.2-sol), 36 sessions each on six small test projects, HeyBrain brief from a local test server, not the live product. Decisions kept = the session's decision tests passed. With a HeyBrain brief Codex kept 36 of 36, Claude Code 33 of 36. Codex's own resume also kept 36 of 36. Token change vs a fresh session with the brief: Codex +3% (-5% to +7%). Up to 97% is Claude Code's figure; Codex's is 94%.
The study was designed and run by the team that builds HeyBrain. Full study and methodology.
Frequently asked questions
Does Claude Code remember decisions from earlier sessions?
Not when a session starts fresh. In our test, a fresh Claude Code session kept earlier project decisions in 1 of 36 later sessions. Its own resume kept 35 of 36 when run soon after the previous session, and a HeyBrain brief at session start kept 33 of 36. These are benchmark results on six small test projects.
Is a memory brief cheaper than resuming a coding session?
Not on a warm cache. When the previous session had just ended, resume cost less: the HeyBrain brief cost 38% more than resume on Claude Code and 172% more on Codex. The brief is useful when a session cannot be resumed soon after it ends. We did not measure resuming after the cache expires.
Why did the HeyBrain search tool keep fewer decisions than the brief?
Agents seldom called the tool while coding, 17 calls in 36 sessions for each agent, so the tool arm kept 17 and 16 of 36 decisions. Asked direct questions about past decisions, the same agents did call it and recalled 35 or 36 of 36. Pushing memory into the session mattered more than offering it.