Write memory - not code
2026-10-26Current AI agents don't have memory - they have context. Context is built by loading existing files from disk at the start of every new session. E.g. Claude Code reads markdown files (.md) from the folder where the session is opened (in addition to any global context with general instructions).
But context is like RAM for the computer: It disappears when you shut down your agent.
Also, the next developer won't get the same context as the one who generated the code - unless you think about it as a developer.
We should use some of the time we save on writing code to write memory that preserves critical decisions and important elements of the solution.
A simple example from a solution I've built: An AI news agent that sends me an email every morning at 06:00 with the day's AI news. It currently works from 12 different RSS feeds, which are in priority order. There is also a check for whether different sources have roughly the same news story. If so, it shouldn't be repeated - but simply marked with the different sources as links.
Without a written design decision to uphold this principle, it's quite likely that my AI agent would simply add a new source at the bottom of the order when I ask for a new source. With a written note like this:
Xyz
the agent is guided to ask me where in the order a new source should be added - or it will remind me that the sources are prioritised, so I can change the placement afterwards.
Design decisions of this kind are important to preserve, for the sake of future maintenance. You may be the next one to revisit the solution in 3 months - and even for you as the original builder, it can be hard to remember all the decisions and why we made them. It costs time, tokens and risk.
Write memory instead of code
So use some of the time we save on less manual coding to write down and preserve important design choices, decisions and their background. As well as things the agent always should ask about - rather than simply assuming and quietly carrying on.
Make this knowledge shared and version-controlled by placing it side by side with the code in its repo.
The agent can help maintain it, once it's been started and/or you ask it to.
This creates a need to read the file(s) that make up the memory. It's worth making sure the memory is up to date and precise before you hand the project/product over again.
Without this written memory, maintenance gets harder and harder over time - and it becomes harder for your agent to run autonomously for longer periods.
Use the scout principle here:
Always leave the memory in a better state than when you arrived.