I Fixed OpenClaw's Memory Problem For Good

By Beau Johnson · · 12 min · 9.3K views

Chapters

  1. 0:00The problem with OpenClaw's memory
  2. 1:45What actually happens when context gets compacted
  3. 3:30What is Lossless Claw?
  4. 5:15How the DAG summarization system works
  5. 7:00Installing Lossless Claw (one command)
  6. 8:30The three agent tools: grep, describe, expand
  7. 10:00Before vs after: real session comparison
  8. 11:30Pros, cons, and who this is for
  9. 13:00Final thoughts

About this video

FIX OPENCLAW MEMORY - https://github.com/martian-engineering/lossless-claw I do 4 live bootcamps every week in Shipping Skool! Full courses on OpenClaw and Claude Code! Join Here ⬇️ https://www.shippingskool.com/ Your OpenClaw agent has goldfish memory. After a long session, it literally throws away everything you told it. I found a plugin that fixes this forever. 0:00 The problem with OpenClaw's memory 1:45 What actually happens when context gets compacted 3:30 What is Lossless Claw? 5:15 How the DAG summarization system works 7:00 Installing Lossless Claw (one command) 8:30 The three agent tools: grep, describe, expand 10:00 Before vs after: real session comparison 11:30 Pros, cons, and who this is for 13:00 Final thoughts Join 60 builders shipping real products with AI inside Shipping Skool Get the weekly AI builder newsletter 📕 https://substack.com/@buildnpublic Follow Me On X - https://x.com/BeauJohnson89

Transcript

Read the full transcript

0:00In this video, I'm going to be talking about OpenClaw's biggest problem. I'm scrolling through X every single day and the number one thing that is the problem with OpenClaw is the memory. I'm going to put a link down in the description posted by Peter. It is a GitHub repo that is going to greatly change how the memory system works with OpenClaw. Do it now and you'll thank me later and let me break down what I'm exactly talking about. So, the more important thing that I'm going to be talking about is the plugin and specifically that fixed this memory issue for me and my system. Because if you're running long sessions with your OpenClaw agent, you know exactly what I'm about to say. Your agent forgets stuff and it's not you. Your agent just has a bit of Alzheimer's

0:45and dementia. That's fine. We're going to fix that in this video. And I don't mean like, oh, it kind of sort of loses some context. Sometimes you could go hours and hours working on an automation and the next day it it forgets everything. And that's super annoying. So, like I don't mean you spend 6 hours building something, you tell your agent exactly how you want things done and then an hour later it's asking the same questions again. Like, it's crazy. This happens for everyone and this is the number one problem that you see with OpenClaw, the memory issue. This is why I have two other backups for memory and this is going to help you if you don't have that already in place. It's going to help you with getting OpenClaw installed right out of the box. Get this GitHub repo and it's going to solve a lot of the issues. So, let me break it

1:30down what is actually happening under the hood because once you understand this, the fix makes so much more sense. OpenClaw uses something called a sliding window for your conversation history. So, you and your agent are going back and forth and back and forth in a great friendly chat and every message gets added to this window. But, the thing is that this window has a limit. It's the model's context window. For Claude, now just upgraded to 1 million token context window, which is amazing. Used to be 200,000 before. Real quick, before we keep going, if you're watching this and you want to actually build with some of these tools, not just watch videos about them, then you're going to want to check out our community down below, Shipping School. We have a full Claude code

2:16course, a full open Claude course, and four live bootcamps every single week where we actually help you get set up from scratch. Like actually set this thing up, not just watch a tutorial and figure it out by yourself. And we also provide one-on-one coaching, so you could book a call with me, we could share screens, and I can help you get Claude code or open Claude running on your machine. That's it, no fluff. I built this community because watching YouTube's only gets you so far. We launched it just 3 days ago and we have over 55 members. You need people around you who are actually building, people who hold you accountable, and coaches who can help you when you get stuck. I'll put the link in the description down below. Get in now before the price goes up. So, it does sound like a lot,

3:01but still at the same time, when you're running 12 to 18 to 24-hour coding sessions, building mission control, reading files, and running commands, that window does fill up faster than you think. It's about 750,000 words on the 1 million context window. So, what happens when it fills up? Open Claude does something called compaction, which is just a fancy word for it summarizes your old messages, and then it throws away the originals. Gone, just like that. Wow, that sounds depressing. Now, when it summarizes the context, that's okay, but it does lose the nuances. It lose the details. It keeps the general facts about your conversation, but all those little details that add up to being really important are gone. The specific

3:46things you said are gone. The preferences you mentioned, goodbye. The exact way you wanted something done is gone. And that stuff gets lost all in the summary compacted gone forever. And your agent doesn't even know it lost it. That's the crazy part. You feel like you're insane. The agent is going insane. It just keeps going on like everything's fine. This is crazy. And I know you've been there. I literally had to create files called friction markdown file and preferences markdown file just to keep telling my agent the same stuff over and over, which is pretty cool as as like a workaround. But, you know, it's just the fighting problem that people have when getting open call installed. It's the memory issue. So, here's where this gets really good is I found this pluglin called lossless claw.

4:33And Peter had just posted about today. It's made by Martian engineering. It's based on a research paper called LCM, which stands for lossless context management. And when I tell you this changed everything for today, I mean it changed the entire project. Here's what lossless claw does. Instead of throwing away your old messages when the context window fills up, it saves every single message to an SQLite database. Nothing is ever deleted. Nothing is ever lost. Every message you've ever sent, every response your agent has ever given, it's all there. Thank you, Jesus. But, here's the smart part. It doesn't just dump everything back into the context window. That would break a lot of things. Instead, it creates these summaries

5:20organized in what's called a DAG, a directed acyclic graph. And I know that sounds complicated, but think of it like this. Imagine you have a tree. And at the bottom of that tree, you have your actual messages, the raw conversations. Above that, you have summaries of those conversations. And above that, you have summaries of summaries. So, as your conversation gets longer and longer and the tree gets taller and taller, but the amount of information your agent needs to hold in its head stays manageable. And the key thing is every summary links back to the original message, so your agent can always drill down and get the exact details when it needs them. So, let me tell you about the three tools that lossless claw gives your agent.

6:07This is where it really should click in for you. The first one is called LCM grep. This is like a search engine for your entire conversation history. Your agent can now search through every message you've ever sent, even the ones that got compacted hours ago. So, if you told your agent something specific at 2:00 a.m. and now it's noon, it can still find it. Thank you, Jesus. Second, the tool is an LCM describe. This gives your agent an overview of what's in a particular summary node, so it can look at a chunk of compacted history and understand what topics were covered without loading all of the raw messages. The third one is LCM expand. Basically, this is a magic wand that changes it all. It's like when your agent finds a summary that's relevant to your convo,

6:54it can expand it. And it goes from the summary back down to the original messages. So, it gets the full detail, the exact words, the specific instructions, and nothing is lost. So, your agent basically has perfect recall. It's like going from a goldfish to an elephant memory, which is pretty freaking cool. That's why I had to make a video about this. Many people in our community have also brought this up. How do we fix this memory issue? Well, I'm going to put a link down below, get it going, get it installed. In fact, give this video link to your open claw agent and say, "Do what this guy is saying. Here's the repo, get it going." And you can ask your agent, "Tell me how it's different than our current setup." Then you can really understand the differences between the original out of the box open claw memory and what you

7:41have going on with the lossless claw. So, let me tell you how easy it is to install. You basically just do what I said. It's one command, one command. So, I'm going to give you the command to put in your terminal right now if you really want to get it going without doing all the other stuff I just said. Open Claw plugins install @martian-engineering/lossless-claw. Hit enter, that's it. It installs the plugin, enables it, and sets up the context engine slot. You might need to restart Open Claw after, but the install command handles most of the config for you. And if you want to tweak things, there's a few settings you can adjust. The fresh tail count, which is how many recent messages stay raw, don't get summarized. The context threshold, which is the percentage of your context

8:26window, triggers the compaction. And the incremental max depth, which controls how deep the summary tree goes. But if I'm to be honest with you, the the defaults just work right out of the box. You don't need to go much deeper. I've been running with it for the day, and the defaults have been working amazing, and it's been really more much more enjoyable going back and forth not and knowing that nothing's going to get lost, basically. So, I'm going to be real with y'all the pros and cons, and you know, I'm not just going to hype something up without being honest. The pros, I would say are like number one, your agent never forgets anything. That solves a big issue in the community. Every message is saved. Every detail is recoverable. Number two, the agent tools let it search and recall anything point in your session. Number three, it's a

9:11simple install. You don't got to go through any, you know, headaches to get it going. One command. I guess the next thing is, you know, based on the real research paper. So, this isn't some hack. It's not just some guy eating crayons in the corner. It's a well-thought-out system. Cons, I would say number one is it uses more storage. You know, if you're using an older laptop or something like a cell phone to run your Open Claw, you're going to eat through that storage. I'm running everything on a Mac Mini. I don't have anything to worry about. Fresh install. And so you've got an SQ Lite database that grows over time. For most people, it's not going to be a big deal, but if you're running crazy long sessions on a smaller machine, keep an eye on it. The second thing is the summarization uses extra tokens. So every time it compacts, it's making API calls to create those

9:57summaries. So your token usage will go up a little bit, but I think it's worth it. Number three is a slightly more complex architecture than defaults. So more moving parts means more things that could potentially have issues. Though I haven't had any problems and I've been rebuilding my whole Mission Control dashboard from scratch today. So my honest take is I needed to make a video about this because many people are posting about it. Many people are complaining about it. This is going to solve most of those issues. The pros massively outweigh the cons. I'm spending way more time repeating myself these first few weeks getting it set up and my agent would just forget things. So at the cost of extra tokens, now you don't have to backtrack. It remembers. It was just a no-brainer for me. I went

10:42ahead and installed it the moment it was mentioned on X. So the bottom line is if you're running Open Claw for anything serious, whether you're building a SaaS, running agent automations, managing a business, whatever, get that lossless Claw GitHub repo installed. The default memory system is fine for short conversations, maybe one or two automations, but for people that are actually wanting to grow a business business, you really need to get this going. You know, the moment you start doing real work over long sessions, you're going to hit that compaction wall and it's going to frustrate you the same way it frustrated me and many others in the community. So one command to install it, easy, and your agent goes from forgetting everything to remembering everything. It's plain and simple, y'all. Just get it going. So if you're building anything with AI and you want

11:27to learn how to use these tools and maybe you have an idea, but you don't know how to get Claude code installed or you don't even know how to automate your first automation with Open Claw, that's why we started the community in Shipping School. Almost 59 members in just 5 days. Get in before the price goes up. I'll put a link down below, and we'll see you there. Have a blessed day. Bye-bye.

Build this with us, live

Shipping Skool is a free community with 4 live build sessions a week. Bring your idea.

Join Shipping Skool — Free