explaingit

martian-engineering/lossless-claw

4,634TypeScriptAudience · vibe coderComplexity · 2/5Setup · easy

TLDR

Lossless Claw is an OpenClaw plugin that gives AI agents a perfect memory for long conversations. Instead of deleting old messages, it saves everything to a local database, auto-summarizes older chunks, and lets the agent search its full history, so nothing is ever lost.

Mindmap

mindmap
  root((Lossless Claw))
    Memory Storage
      Local SQLite DB
      Raw messages kept
      No data discarded
    Smart Compression
      Auto summarization
      Tree of summaries
      Tunable chunk size
    Agent Tools
      Keyword search
      Chunk description
      Expand summary
    Configuration
      Compression aggressiveness
      Summarization model
      Chunk size threshold
    Management Commands
      Status check
      Database backup
      Session rotation
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Give your AI agent a perfect memory so it never forgets anything said earlier in a long chat session.

USE CASE 2

Build long-running projects with an AI assistant where context from days or weeks ago still matters.

USE CASE 3

Let your agent search back through hundreds of past messages to find a specific detail or decision.

USE CASE 4

Keep full conversation archives locally on your machine without relying on any cloud storage.

Tech stack

TypeScriptNode.jsSQLiteOpenClaw

Getting it running

Difficulty · easy Time to first run · 30min

Requires Node.js 22+ and a working OpenClaw installation. Install via OpenClaw's plugin system with a single command. Configure compression settings, summarization model, and chunk size via plugin config options.

License not mentioned in the explanation.

In plain English

Lossless Claw is a plugin for OpenClaw, an AI agent platform, that changes how the agent handles long conversations. AI models can only hold a limited amount of text in their active memory at one time. When a conversation grows too long, the agent normally discards the oldest messages to make room for new ones. Lossless Claw replaces that discard behavior with a smarter system that keeps everything. Instead of throwing away old messages, the plugin stores them in a local SQLite database, a lightweight file-based database that stays on your machine. As older messages accumulate, the plugin automatically summarizes groups of them using the connected language model, producing a compressed version. Those summaries can in turn be summarized further, creating a tree-like structure of condensed history. When the agent needs to respond, it combines the recent raw messages with the relevant summaries to stay within the model's memory limit. Nothing from the original conversation is discarded. The raw messages stay in the database, and every summary links back to the source messages it was created from. The plugin also gives the agent three tools it can use itself: one to search the conversation history by keyword, one to get a description of a compressed chunk, and one to expand a summary back into its original detail. This means the agent can actively look up things from far back in the conversation rather than simply having no access to them. Installation is handled through OpenClaw's plugin system with a single command. Configuration options let you tune how aggressively the plugin compresses older messages, which model it uses for summarization, and how large a chunk of messages must grow before it is compressed. A set of slash commands inside OpenClaw let you check the plugin's status, back up the database, diagnose broken summaries, and rotate session transcripts. The plugin is written in TypeScript and requires Node.js 22 or later alongside a working OpenClaw setup.

Copy-paste prompts

Prompt 1
I have installed Lossless Claw in OpenClaw. How do I configure it to compress older messages more aggressively and use a faster model for summarization?
Prompt 2
Using Lossless Claw with OpenClaw, show me how the agent can search conversation history by keyword and expand a compressed summary back into its full detail.
Prompt 3
I want to back up my Lossless Claw SQLite database and rotate my session transcript. Which slash commands do I use inside OpenClaw?
Prompt 4
Explain the tree-of-summaries structure Lossless Claw uses. How does it decide when to summarize a group of messages, and how does it combine summaries with recent messages when responding?
Prompt 5
My Lossless Claw setup has some broken summaries. Walk me through using the built-in diagnostic slash command to find and fix the issue.
Open on GitHub → Explain another repo

← martian-engineering on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.