Agents need verified memory, not the entire history: how to build context
After moving from Claude Code to Codex, the author debated with Habr readers: do you need conversation history if you have Git and documentation? These turned out to be different tasks: recovering past experience, handing over unfinished work and giving an agent reliable knowledge. An old chat is evidence to check against code and tests, not an instruction.
AI-processed from Habr AI; edited by Hamidun News
When Claude Code was suddenly blocked, the author of an analysis on Habr switched to Codex and discovered an unpleasant problem: the code was still on disk, but months of conversations about architecture, bugs and rejected experiments were stuck in the old tool. Across 25 projects and 53 chats, the built-in importer transferred around 50 sessions, with incorrect project associations. A debate followed in the comments, and it proved more interesting than the migration itself.
They were debating different tasks
Some argued that decisions and plans belong in Git and conversation history is junk. Others suggested skills, knowledge bases and specifications. Still others pointed out that a model's internal reasoning state cannot be transferred between providers. Everyone had a point; they were simply addressing different tasks.
The first task is to give an agent an up-to-date understanding of the project. AGENTS.md or CLAUDE.md, current documentation, ADRs, working plans and tests are enough for this. Larger codebases also need navigation: Aider Repo Map, for example, builds a compact project map within a token budget. The second task is to recover past experience: what was tried, what was rejected and why. The third is to pick up interrupted work when a limit was reached halfway through and nobody wrote HANDOFF.md.
Git itself is not memory. It is version control, and its value depends on what you put into it and how current that material is.
An example: a Windows TUN error
The author develops NetRuleRouter, a traffic-routing application. While investigating Windows TUN error 5010, the agent used Hansard to discover that the TUF test laptop was a separate Windows machine with a local copy of the repository. Details like these do not belong in architectural documentation, but they save time during troubleshooting. The author offers a candid caveat: he has not yet measured whether Hansard made the fix faster.
Similar tools include deja-vu, which indexes coding-agent logs and can resume unfinished work, find sessions by file and flag rejected solutions. Meanwhile, baton transfers sessions between command-line agents when the old agent can no longer respond.
Memory costs money and makes mistakes
In an experiment with MemShelf, by day 38 the index and summaries of 157 episodes occupied around 36,600 tokens, or 18.3% of a 200,000-token window. Over a separate 30-day period, the author found no calls to MCP memory tools. The developers of kaeru, after studying more than 13,000 log files, observed something similar: in a small observational sample, agents never opened saved reasoning across seven sessions. The samples are small, but the problem is clear: memory either sits unused or gets injected too often, cluttering the context.
There is also a more serious risk. One agent records a mistaken conclusion as experience; another reads it and treats it as a verified fact. An old conversation may contain instructions from an untrusted source. If an agent starts following them, the archive becomes a channel for someone else's commands.
What to do in practice
The proposed workflow is straightforward: find the information, establish its status, check whether it is still current, apply it and verify the outcome, then record the result.
- Treat a retrieved conversation as historical data, not a new instruction.
- Establish the source and date, and whether the material was a hypothesis, a confirmed result or a rejected option.
- Check it against the current code, tests and documentation.
- Record verified findings in a plan, ADR or knowledge base.
An archive holds evidence of the past; a knowledge base holds information the project can rely on now. The latter also ages, so current knowledge must be checked against an independent source: code, tests or execution results.
For a small utility, AGENTS.md and tests are enough; elaborate specification graphs are overkill. For a large project with several agents, it makes sense to consider a separate overseer, as one commenter does in practice, and reliability labels for entries. To understand whether memory helps, assess more than whether something was found: evaluate the capabilities covered by LongMemEval (ICLR 2025), including finding information, connecting multiple sessions and accounting for time.
One final point: the author studied most of these tools through documentation and publications, without comparative testing. Treat the review as a map of the landscape, not a ranking.
- Nov 8, 2026Stanford teaches students to submit patches to maintainers: inside CS146S
- Nov 8, 2026Investors Demand a Discount: Anthropic's $1.5 Trillion IPO Valuation in Question
- Nov 8, 2026Three prompt iterations: how an AI fiction assistant fills in characters for the author
- Nov 8, 2026METR: AI Has Doubled the Pace of Research at Anthropic — RSP Threshold Appears to Be Crossed
Key Questions Answered
What are the key details on They were debating different tasks?
Some argued that decisions and plans belong in Git and conversation history is junk. Others suggested skills, knowledge bases and specifications. Still others pointed out that a model's internal reasoning state cannot be transferred between providers. Everyone had a point; they were simply addressing different tasks. The first task is to give an agent an up-to-date understanding of the project. AGENTS.md or CLAUDE.md, current documentation, ADRs, working plans and tests are enough for this.
What are the key details on An example: a Windows TUN error?
The author develops NetRuleRouter, a traffic-routing application. While investigating Windows TUN error 5010, the agent used Hansard to discover that the TUF test laptop was a separate Windows machine with a local copy of the repository. Details like these do not belong in architectural documentation, but they save time during troubleshooting. The author offers a candid caveat: he has not yet measured whether Hansard made the fix faster.
What are the key details on Memory costs money and makes mistakes?
In an experiment with MemShelf, by day 38 the index and summaries of 157 episodes occupied around 36,600 tokens, or 18.3% of a 200,000-token window. Over a separate 30-day period, the author found no calls to MCP memory tools. The developers of kaeru, after studying more than 13,000 log files, observed something similar: in a small observational sample, agents never opened saved reasoning across seven sessions.
Build & Ship Production AI Agents Without Boilerplate Code
Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.