Lossless Claw Plugin: Fix OpenClaw Memory Loss After Compaction
Prefer to watch? Watch on YouTube · Subscribe for new builds · Read the transcript
In this video I explain why your OpenClaw agent forgets things during long sessions and how I fixed it with a plugin called Lossless Claw. If you run long OpenClaw sessions and keep repeating yourself to your agent, this one is for you. I recorded this in March 2026, and tools like this change fast, so check the current docs before you install anything.
What I cover in this video
- 0:00 The biggest complaint I see about OpenClaw: memory
- 1:30 How the sliding window and context limit work
- 3:01 What compaction does and what it throws away
- 4:33 What Lossless Claw is and the research behind it
- 5:20 How the DAG summary tree works
- 6:07 The three agent tools: LCM grep, LCM describe, LCM expand
- 7:41 Installing it with one command and the settings you can tweak
- 9:11 My honest pros and cons
Why OpenClaw forgets things
OpenClaw keeps your conversation history in a sliding window. Every message you and your agent send gets added to it, and that window is capped by the model's context window. For Claude that's now 1 million tokens, up from 200,000. That's about 750,000 words, which sounds like a lot. But when you're running 12, 18, or 24 hour sessions, reading files and running commands, it fills up faster than you'd think.
When it fills up, OpenClaw runs compaction. It summarizes your old messages and then throws away the originals. The summary keeps the general facts, but the small details get lost: the specific things you said, the preferences you mentioned, the exact way you wanted something done. And your agent doesn't know it lost anything. It keeps going like everything is fine, and an hour later it's asking you the same questions again.
Before this, I had built workarounds. I made a friction markdown file and a preferences markdown file just so I could keep telling my agent the same stuff. That works, but you're fighting the problem instead of fixing it.
What Lossless Claw does
Lossless Claw is a plugin made by Martian Engineering. I found it after Peter posted about it on X. It's based on a research paper called LCM, which stands for lossless context management.
Instead of throwing old messages away when the context window fills up, it saves every message to an SQLite database. Nothing gets deleted. Every message you've sent and every response your agent has given stays there.
It also doesn't dump all of that back into the context window, since that would break things. It builds summaries organized as a DAG (a directed acyclic graph). Think of it like a tree:
- At the bottom are your actual messages, the raw conversation.
- Above those are summaries of the conversation.
- Above those are summaries of summaries.
The tree keeps growing as the conversation gets longer, but the amount your agent has to hold in its head stays manageable. Every summary links back to the original messages, so the agent can always drill down to the exact details when it needs them.
The three tools your agent gets
- LCM grep: a search engine for your whole conversation history, including messages that were compacted hours ago. If you told your agent something at 2:00 a.m., it can still find it at noon.
- LCM describe: gives the agent an overview of what's inside a summary node, so it can see which topics were covered without loading all the raw messages.
- LCM expand: when the agent finds a relevant summary, it can expand it back down to the original messages and get the exact words and instructions.
Put together, your agent goes from goldfish memory to elephant memory.
How to install Lossless Claw
It's one command in your terminal:
openclaw plugins install @martian-engineering/lossless-claw
That installs the plugin, enables it, and sets up the context engine slot. You might need to restart OpenClaw afterward, but the command handles most of the config for you.
You can also hand this video and the repo to your OpenClaw agent and tell it to set it up. Then ask it to explain how the new setup differs from your current one, so you understand what changed.
If you want to tweak things, there are a few settings:
- Fresh tail count: how many recent messages stay raw and don't get summarized.
- Context threshold: the percentage of your context window that triggers compaction.
- Incremental max depth: how deep the summary tree goes.
To be honest, the defaults just work. I've been running them all day while rebuilding my Mission Control dashboard from scratch and haven't needed to change anything.
Pros and cons
Pros:
- Your agent doesn't forget. Every message is saved and every detail can be recovered.
- The agent tools let it search and recall anything from any point in your session.
- One command to install.
- It's based on a real research paper, so it's a well thought out system and not a random hack.
Cons:
- It uses more storage, since the SQLite database grows over time. I run everything on a Mac Mini so it's not a concern for me, but on an older laptop or a small device, keep an eye on it.
- Summarization uses extra tokens. Every compaction makes API calls to create summaries, so your token usage goes up a bit.
- The architecture is a little more complex than the default, and more moving parts means more things that could break. I haven't had any problems so far.
For me the pros easily outweigh the cons. I was spending way too much time repeating myself in my first few weeks with OpenClaw. Paying some extra tokens so I don't have to backtrack was an easy call. If you only run short conversations or one or two automations, the default memory is fine. If you're doing real work over long sessions, like building a SaaS, running AI agent automations, or managing a business, you'll hit that compaction wall eventually.
Key takeaways
- OpenClaw's default compaction summarizes old messages and deletes the originals, so details get lost and the agent doesn't notice.
- Lossless Claw saves every message to an SQLite database and builds a tree of summaries that link back to the originals.
- Your agent gets three tools: LCM grep to search, LCM describe to get an overview, and LCM expand to pull back the exact messages.
- Install it with
openclaw plugins install @martian-engineering/lossless-claw. The default settings work fine. - The tradeoffs are more storage, a bit more token use, and a few more moving parts.
FAQ
Why does my OpenClaw agent forget what I told it?
When the conversation fills the model's context window, OpenClaw runs compaction. It summarizes old messages and throws away the originals, so specific details and preferences are lost and the agent doesn't know it lost them.
How do I install Lossless Claw?
Run openclaw plugins install @martian-engineering/lossless-claw in your terminal. It installs and enables the plugin and sets up the context engine slot, though you may need to restart OpenClaw afterward.
Does Lossless Claw cost more to run?
It uses a bit more in tokens, because every compaction makes API calls to create summaries. It also uses more storage because the SQLite database grows over time.
Do I need to change the Lossless Claw settings?
Usually not. You can adjust the fresh tail count, context threshold, and incremental max depth, but in my experience the defaults work out of the box.
Chapters
- 0:00The problem with OpenClaw's memory
- 1:45What actually happens when context gets compacted
- 3:30What is Lossless Claw?
- 5:15How the DAG summarization system works
- 7:00Installing Lossless Claw (one command)
- 8:30The three agent tools: grep, describe, expand
- 10:00Before vs after: real session comparison
- 11:30Pros, cons, and who this is for
- 13:00Final thoughts
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.
Ready to start building with AI?
Join the Shipping Skool community free. Paid members get live bootcamp calls every week and weekly-updated courses.
Join Shipping SkoolKeep reading
How to Fix OpenClaw Memory Loss: My 3-Layer Memory Setup
To stop OpenClaw from forgetting you, I use three memory layers: a short, curated memory markdown file plus daily logs, an hourly cron job that backs memory up to a Neon Postgres database, and Supermemory as a searchable cloud backup. Updating to OpenClaw 3.8 with its LCM graph memory helps a lot too.
OpenClaw Memory Fix: 4-Layer Setup With Supermemory and Neon
To stop OpenClaw from forgetting, I use four memory layers: bootstrap markdown files, daily memory logs, Supermemory for semantic memory, and Neon (Postgres) for structured data. Every agent searches both systems before a run and writes back to both after it. Lossless Claw and QMD add more on top.
Claude 1M Token Context Window: What It Means for AI Agents
Anthropic made the 1 million token context window generally available for Claude Opus 4.6 and Sonnet 4.6, with no long context price premium and no beta header. For OpenClaw agents and Claude Code, that means far fewer compaction events and longer sessions where nothing important gets forgotten.
