ReleaseInsight · On RadarHabr AI→ original

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
Agents need verified memory, not the entire history: how to build context
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1Check current knowledge against code, tests and execution results
Key metric #2Persistent memory consumed 18.3% of a 200,000-token context window
The sequencefind, assess status, verify, apply, record

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.

Story

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.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

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.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…