On the subject of memory, I've been thinking a lot about something I call strategic forgetting. In my mind it has to do with salience. In a human, we don't remember everything all the time. What seems to be the case is memories bubble into awareness at some interval. So there are wave-like properties there, frequency and intensity. Both of these seem malleable, but my intuition suggests that as we reduce the intensity of the occurrence when it enters into awareness it might have some effect on the frequency.
What I mean to say is that the current methods of compaction don't really match my intuitive understanding of how human memory works. Agents don't really have a frequency/intensity relationship with the static files they keep for memory. The system just includes all memory items into every context. I wonder if there is some study worth doing on injecting high-salience items at a higher frequency and low-salience items at a lower frequency, then allowing the AI to score how important the memory was and adjusting the values over time.
I hope they figure out a highly effective way that scales. I've found the built in method in Claude is a disaster. I make the only memory a rule that there are no memories allowed. When working on large projects I find it will add all sorts of memories for things it can just figure out JIT and I'll turn around it is injecting 50Kb worth of memories into each session.
I've tried claude-mem and wasn't impressed with the results. Perhaps those methods work for smaller projects but at scale it seems to be a lot of noise. I've become a context purist, prefer absolutely minimal context injection, and would just rather have the agents go searching for what is needed on demand for now.
I have many repos across the org and agents are spawning workers in other repos, so I had thousands of memories spread across the world. Plus I use a mixture of codex, Claude, Qwen and others.
I turned off auto memory in Claude (the main orchestrator) and have the agents log to a central git repo. It’s been working so far. I wonder if I should adapt some SQL shape to it per the article
>I make the only memory a rule that there are no memories allowed.
i think i should try this. i'm generally annoyed at claude any time it decides it needs to store a memory, and any time it retrieves those memories and gives them preferential weight over other instructions or things it's learned in the current session.
in general, i find that the only time i ever want claude to remember something is if i've explicitly told it "remember that information that we just learned last turn"
I built an AI assistant (https://stavrobot.stavros.io/) that uses a plain SQL database with some niceties (important memories injected directly into the context, less important memories get titles injected and the agent can request the whole note, everything else just gets search) and it works perfectly.
It's not something you plug into Claude Code, but I don't see why you can't just give Claude Code a SQLite database, a skill, and just tell it to store stuff there. It's literally that simple.
The secret will be getting that to scale to huge projects. I suspect we'll eventually end up with something that mimics human biology, where memories that add value become prominent and when they don't they fade out to the point of deletion. If you are working on a giant project and it takes an architectural shift it would be nice to have the memories that just don't apply anymore eventually get deleted automatically without have to manually curate it.
In a related vein I’m a prompt purist, minimal prompt to kick things off, if there are questions it will ask. In contrast to my peers who spend hours drafting (or asking ai to draft) huge spec documents. They perform being busy better but we’re achieving the same impact.
I think that is the most efficient way. You can easily probe to see if their assumptions match your expectations. If they align then you don't have to specify anything.
Then you can selectively steer a little if you need to. For many things that is fine. I very rarely have them build big plans to look over, generally only for big projects like rebuilding a search model training and serving stack. Something that will take weeks of work, I'll have an agent research and build out a plan that I can then read or sometimes just query them about.
In general if you then take large logical domains and run one persistent agent per domain that is enough. You can point them at each other when you need to handoff or reconcile.
Honestly very similar to how a high performing team operates.
I go both ways on that. For small things I absolutely agree. The largest project I'm working on is approaching 1M lines all by Claude with 188 architecture documents that act as the source of truth for how the system works. I don't think it would have been successful without that.
I added this to my system wide CLAUDE.md (the only other thing there is instructions on how to reach our PII filtering DB proxy) and it seems to work well. I will have long lived sessions in different directories and this has made the over all sense of how I work and how things work in the system be more coherent and seems to have continued to gradually improve over time, not destabilize. It's about 10 weeks old.
## Agent continuity layer (supplementary to per-project memory)
- ~/.claude/shared/journal.org — append-only cross-session journal
(conventions in ~/.claude/shared/README.md). Read the tail (~30 lines)
before substantive work; append (and `git commit` in that dir) when you
learn or leave something a later session would trip over: in-flight
work, warmed caches, deploys pending, impressions not yet memory-worthy.
- The per-project memory dirs (~/.claude/projects/<project>/memory/) are
git repos: after editing memory files, `git commit` there with a short
message — the history of belief changes is the point.
- Both are agent-owned repos: committing in them is expected and exempt
from the "leave changes uncommitted" convention (which is about Chris's
code repos). Absolute dates only; facts about systems, never row-level
data.
I've hated memories from day one, and always turn them off everywhere. I hate large context too, and strategically compact often. Context is a distraction more often than not. Keep the model focused on exactly what it needs. There's nothing quite like the magic of a fresh session with a precise prompt before the model starts losing brain cells.
Due to a misconfiguration, I had been using my work agents with memory capped to ~128K tokens and honestly, it was surprisingly fine. Spend was noticeably lower, so it wasn't just churning either. I'm sure there are codebases that need huge context to understand what the heck is happening, but for my applications it was totally fine.
> We modelled our dreaming setup after Anthropic's approach: after every task, and before the next task, we ran a reflection loop to let a dreaming agent create notes and wiki using the event log and task feedback.
This does more than it appears to: it also primes the LLM to know that this data store exists, and that it should be consulted proactively. Half the battle is to make sure the system doesn’t jump to conclusions without consulting its memory at all!
Some of this is captured by effort settings, but you can do a lot with a bit of system prompt tuning, even at lower effort, to make sure the system knows there are things it must consult even something seems simple.
Most harnesses have this partially but with flaws IMHO. When claude says, something along the lines of "this happened before", if you ask it how does it know, it will tell you that it records memories in ~/.claude/project/... which it does in the form of a MEMORY.md file + other single files. however it also says that claude code "inserts other items in the memory and it doesn't know where they come from". looking back at previous work and learning from it by identifying patterns is a great way to learn for humans and works great for agents too. however, i think there are several issues with the current way memory retrieval happens in harnesses now:
first, agents understand all there is to know about what they read, and have no idea about what they don't read. this means the idea of "intuition" is alien to them (obviously, but i mean within the context of memory, as in knowing something without knowing how one knows it). finding correlational information to what agents are looking for and feeding them into their memory recall improves their work quality by a lot (we've run tests with metrics to show).
the second issue, is that learning and memory are different and the best memory systems are good at storage, correlation and retrieval but don't help with learning. by learning i mean summarizing, finding patterns and dropping specifics and generalizing. that is why moving one project's memory is not easy to another project in claude or codex (they are files filled with specifics and stored locally on a disk, which makes them locked into one member of the team, inhibiting organizational learning).
we ran 51 scenarios with and without our memory system (built around the same principles) and these are the result (with vs without):
first review acceptance: 81% vs 46%
correct past decision recalls: 50% vs 85%
token usage drop: 20% (average of 8mm vs 10mm)
repeat corrections by a human: 8 vs 10 (in 100 repeats)
Neat analysis, but they didn't test how effective vector search is in addition to their simple FTS. For example, in the DolphinBench sample, it's unclear how "blue bottle" gets recalled as a restaurant when the query is "order one small latte". I suspect the simple FTS plus embeddings of the raw events would have the strongest results overall.
FTS plus query term expansion using the very same frontier LLM is the answer. You pay a one-time cost when indexing each document to effectively bake your semantic search.
The conclusion seems somewhat unsurprising: it's more effective to keep unedited logs and let agents search those than compress/compact/summarize.
As ever, many companies will be happy to store your data and sell access back to you. The good news is it's easier than ever to retain ownership of your data in sqlite or markdown files.
In fact, you probably should be, if we get to the point where we can more easily customize open models of fully create our own you'll absolutely kick yourself if you don't.
We're apparently not allowed to generate sessions for this purpose but keeping the ones you generate organically...well... Fuck you I won't do what you tell me.
I had good experiences with deepcq to manage the different types of memories. Many agents conflate conversational short term memory with the state of the agent and long-term evidence storage making it difficult to confirm relevance for the intent.
What I mean to say is that the current methods of compaction don't really match my intuitive understanding of how human memory works. Agents don't really have a frequency/intensity relationship with the static files they keep for memory. The system just includes all memory items into every context. I wonder if there is some study worth doing on injecting high-salience items at a higher frequency and low-salience items at a lower frequency, then allowing the AI to score how important the memory was and adjusting the values over time.
I've tried claude-mem and wasn't impressed with the results. Perhaps those methods work for smaller projects but at scale it seems to be a lot of noise. I've become a context purist, prefer absolutely minimal context injection, and would just rather have the agents go searching for what is needed on demand for now.
There's a setting to properly disable it:
I turned off auto memory in Claude (the main orchestrator) and have the agents log to a central git repo. It’s been working so far. I wonder if I should adapt some SQL shape to it per the article
i think i should try this. i'm generally annoyed at claude any time it decides it needs to store a memory, and any time it retrieves those memories and gives them preferential weight over other instructions or things it's learned in the current session.
in general, i find that the only time i ever want claude to remember something is if i've explicitly told it "remember that information that we just learned last turn"
It's not something you plug into Claude Code, but I don't see why you can't just give Claude Code a SQLite database, a skill, and just tell it to store stuff there. It's literally that simple.
Then you can selectively steer a little if you need to. For many things that is fine. I very rarely have them build big plans to look over, generally only for big projects like rebuilding a search model training and serving stack. Something that will take weeks of work, I'll have an agent research and build out a plan that I can then read or sometimes just query them about.
In general if you then take large logical domains and run one persistent agent per domain that is enough. You can point them at each other when you need to handoff or reconcile.
Honestly very similar to how a high performing team operates.
## Agent continuity layer (supplementary to per-project memory)
- ~/.claude/shared/journal.org — append-only cross-session journal (conventions in ~/.claude/shared/README.md). Read the tail (~30 lines) before substantive work; append (and `git commit` in that dir) when you learn or leave something a later session would trip over: in-flight work, warmed caches, deploys pending, impressions not yet memory-worthy. - The per-project memory dirs (~/.claude/projects/<project>/memory/) are git repos: after editing memory files, `git commit` there with a short message — the history of belief changes is the point. - Both are agent-owned repos: committing in them is expected and exempt from the "leave changes uncommitted" convention (which is about Chris's code repos). Absolute dates only; facts about systems, never row-level data.
)the git repos are local only, just for tracking)
This does more than it appears to: it also primes the LLM to know that this data store exists, and that it should be consulted proactively. Half the battle is to make sure the system doesn’t jump to conclusions without consulting its memory at all!
Some of this is captured by effort settings, but you can do a lot with a bit of system prompt tuning, even at lower effort, to make sure the system knows there are things it must consult even something seems simple.
the second issue, is that learning and memory are different and the best memory systems are good at storage, correlation and retrieval but don't help with learning. by learning i mean summarizing, finding patterns and dropping specifics and generalizing. that is why moving one project's memory is not easy to another project in claude or codex (they are files filled with specifics and stored locally on a disk, which makes them locked into one member of the team, inhibiting organizational learning).
we ran 51 scenarios with and without our memory system (built around the same principles) and these are the result (with vs without): first review acceptance: 81% vs 46% correct past decision recalls: 50% vs 85% token usage drop: 20% (average of 8mm vs 10mm) repeat corrections by a human: 8 vs 10 (in 100 repeats)
As ever, many companies will be happy to store your data and sell access back to you. The good news is it's easier than ever to retain ownership of your data in sqlite or markdown files.
In fact, you probably should be, if we get to the point where we can more easily customize open models of fully create our own you'll absolutely kick yourself if you don't.
We're apparently not allowed to generate sessions for this purpose but keeping the ones you generate organically...well... Fuck you I won't do what you tell me.