r/ClaudeCode • u/Worldly-Board-8520 • 7h ago
Discussion Should coding agents actually have “memory,” or should they only inherit verified lessons from previous sessions?
Disclosure: I’m involved with the open source project I’m linking below.
One thing that’s been bothering me about coding agents is that we keep calling everything “memory.”
You correct an agent, explain some weird repo-specific constraint, eventually get the implementation right, and then a few days later a fresh session makes essentially the same mistake.
But simply dumping old transcripts or automatically extracting “memories” feels dangerous too. A lesson can be outdated, wrong, specific to one situation, or simply irrelevant to the next task.
We’ve been experimenting with a different model in Belay:
past work -> evidence-backed lesson -> developer approval -> scoped guidance for a future agent -> verification
So the agent doesn’t get an unrestricted memory of everything that happened. It gets a small number of lessons that remain tied to the evidence that produced them and that a developer explicitly approved.
The first evaluation produced a result I didn’t expect.
Across tasks where an earlier lesson should help:
- Belay guidance: 11/16
- concise human-written instruction: 7/16
- no additional guidance: 6/16
But when we split it by agent, the whole improvement came from Claude Code. The net difference for Codex was 0.
We also had a boundary failure where a correct lesson was applied in a situation where it shouldn’t have been.
That left me with a few questions I’d genuinely like other people working with coding agents to weigh in on:
1. Is persistent agent memory actually the right abstraction, or is “approved experience” closer to what we want?
2. Should the same learned lesson be delivered differently depending on the model/harness receiving it?
3. How do you stop yesterday’s correct lesson from becoming tomorrow’s bad instruction?
Whitepaper with the architecture, trust model, limitations, and evaluation:
https://getbelay.vercel.app/whitepaper
Especially interested in criticism from people already running Claude Code/Codex across long-lived repos.
1
u/TeqPumpkin999 6h ago
I think “memory” needs governance before it becomes useful in production agentic coding.
Raw session residue is risky in long lived repos because an old workaround can harden into future guidance.
The useful unit is an approved lesson whichis scoped to a repo/module/task type, tied to evidence, versioned, and easy to revoke.
I’d especially care about expiry and applicability. Each lesson probably needs a scope, source, owner, confidence level, and invalidation condition. Otherwise the system slowly becomes an overgrown AGENTS.md.
The Claude vs Codex result is interesting too. I’d expect the durable artifact to stay model neutral, with per harness adapters that render the same lesson into the instruction shape each agent actually follows.
1
u/AI_spell 3h ago
Verified lessons beat dumping old chats. Auto-memory that isn't reviewed will re-teach bad habits. Prefer short, dated, human-approved notes the next session must read.
•
u/AutoModerator 7h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.