File-based memory compounds corrections across sessions
The simplest agent memory is a markdown file in the repo. The agent reads it at the start of every session and writes corrections to it during the session. Each fix persists; the model stops repeating old mistakes. This is the single highest-leverage habit for daily-driver agents.
File-based memory is deterministic: the same file produces the same context every time. It requires no infrastructure (no vector store, no database, no service). Tools like OpenCode Autolearn and the autolearn pattern automate this by observing corrections in real time and escalating them to persistent rule files. The tradeoff is that files cannot do semantic retrieval; the agent reads everything rather than searching for relevance. See an LLM wiki compounds where rag rediscovers.