Say Goodbye to Openclaw Amnesia: A Deep Dive and Complete Guide to lossless-claw

Vibe Tools Expert Team
Published
Updated

Say Goodbye to Openclaw Amnesia: A Deep Dive and Complete Guide to lossless-claw

Welcome back to our tech sharing session. If you frequently work with AI agents, you are likely familiar with the dreaded context window limit. When a conversation gets too long, traditional systems are forced to either delete old messages or compress them into a rough summary. That is how agents lose crucial details, active task state, and important nuance.

Today we are looking at a very different approach: lossless-claw. This guide covers the technical principles behind lossless-claw, the practical advantages it brings to AI engineering, and the exact steps required to get lossless-claw running in OpenClaw.

The Core Principles of lossless-claw

Instead of waiting for the context window to overflow and then scrambling to recover, lossless-claw works continuously and asynchronously in the background.

First, lossless-claw saves every raw message into a SQLite database, which means the original conversation is never discarded. Next, it groups older messages and asks a language model to generate summaries. The key design decision is that those summaries are stored in a directed acyclic graph (DAG), so the system can keep rolling lower-level details into higher-level thematic summaries as the conversation grows.

When an agent needs a precise detail from earlier in the session, lossless-claw exposes retrieval tools such as lcm_expand_query. Those tools let the agent drill back down through the summary graph and recover the original source material instead of relying on a lossy recap.

Why You Need lossless-claw

lossless-claw is compelling because it improves both reliability and operating efficiency for long-running agent workflows.

  1. It delivers strong measured performance. In the OOLONG benchmark, a lossless-claw-powered system scored 74.8, ahead of Claude Code at 70.3.
  2. It removes the need to constantly restart conversations. Agents can keep working for days or weeks while context usage stays within a manageable range.
  3. It avoids the typical "brain damage" effect that follows aggressive lossy compaction, because exact past details remain recoverable.

How to Install and Configure lossless-claw

Getting started with lossless-claw is straightforward once your OpenClaw environment is ready.

1. Verify the prerequisites

Before installation, confirm that you are running Node.js 22 or later and that OpenClaw already has an LLM provider configured for summarization.

For the best search performance, use a Node runtime compiled with SQLite FTS5 support. Without FTS5, lossless-claw can still work, but full-text retrieval will fall back to slower search behavior.

2. Install the plugin

Use the built-in OpenClaw plugin manager:

openclaw plugins install @martian-engineering/lossless-claw

That command downloads the plugin, records it in the plugin registry, and enables lossless-claw for the current system.

3. Set lossless-claw as the default context engine

To make lossless-claw your default context manager, check the OpenClaw JSON configuration and ensure the contextEngine slot points to lossless-claw:

{
  "plugins": {
    "slots": {
      "contextEngine": "lossless-claw"
    }
  }
}

Restart the OpenClaw gateway after updating the configuration so the new context engine is fully loaded.

4. Tune the advanced settings

You can refine lossless-claw behavior with environment variables. A practical baseline is:

  • LCM_FRESH_TAIL_COUNT=32 to protect the 32 most recent messages from compaction.
  • LCM_INCREMENTAL_MAX_DEPTH=-1 to allow the summary tree to grow without an artificial depth limit.
  • LCM_CONTEXT_THRESHOLD=0.75 so compaction begins when the context reaches 75 percent of capacity.

Conclusion

lossless-claw changes long-context memory management from reactive forgetting to active preservation. By storing original messages, compressing them into a retrievable DAG, and letting agents recover exact history on demand, lossless-claw makes persistent OpenClaw sessions much more practical.

If you want an AI assistant that can keep working without constantly losing track of past decisions, lossless-claw is one of the most important OpenClaw plugins to install.

Blog

Latest from the blog

New research, comparisons, and workflow tips from the Vibe Coding Tools team.

The Future of the Agentic Web: How WebMCP Turns Your Website into a High-Performance AI Toolkit

WebMCP replaces brittle screenshot-based automation with structured browser-native tools, letting AI agents interact with websites directly, accurately, and securely.

Vibe Tools Expert Team
Read article
Stop Prompting and Start Managing: A Deep Dive into Claude Code Agent Teams

Learn how Claude Code Agent Teams orchestrates multiple AI teammates with shared tasks and mailbox messaging, and how to launch and scale this workflow.

Vibe Tools Expert Team
Read article
Say Goodbye to Chat-Only AI, Moltbot Is Your Real 24-Hour Digital Employee

Today’s AI assistants are smart but lack memory and initiative—every chat resets context, and they never act unless you ask first. Moltbot changes that.

Vibe Tools Expert Team
Read article