Lossless Claw plugin

An OpenClaw plugin that keeps the whole conversation in SQLite instead of trimming it, condenses it into summaries and lets the agent search history

  • 4,913 ★ on the repository
  • Last commit
  • MIT
Plugin

Extended access

Why this level

  • The plugin stores the full text of all conversations in a local database together with whatever you mentioned in them: customer data, keys, passwords
  • To write summaries it calls the configured model and sends it chunks of history
  • The `/lossless doctor apply` and `lcm config set` commands write to the database and to `openclaw.json`
All reasons and checks

martian-engineering/lossless-claw

Install

Works in

Manual install

openclaw plugins install @martian-engineering/lossless-claw@latest

Requires OpenClaw 2026.9.2 or newer and Node.js 22 or newer. The command enables the plugin and picks compatible slots, including contextEngine.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The plugin stores the full text of all conversations in a local database together with whatever you mentioned in them: customer data, keys, passwords
  • To write summaries it calls the configured model and sends it chunks of history
  • The `/lossless doctor apply` and `lcm config set` commands write to the database and to `openclaw.json`

This is third-party code. Review the repository files before installing.

What it does

Lossless Claw replaces OpenClaw's built-in sliding context window with the lossless context management system described in the LCM paper. When a conversation outgrows the model's window, the plugin does not drop old messages. It saves every message in a SQLite database split by conversation, condenses chunks of older messages into summaries using the model configured in OpenClaw and, as summaries pile up, merges them into higher-level nodes. The result is a directed acyclic graph where each summary links back to its source messages. On every turn the plugin assembles the context from summaries and recent messages. The default threshold is 0.75 of the model's window, and compaction leaves the last 64 messages alone. The agent gets the `lcm_grep` tool to search history, `lcm_describe` to describe a summary and `lcm_expand_query`, which starts a helper agent that expands a summary and returns the original detail. The plugin installs with `openclaw plugins install @martian-engineering/lossless-claw@latest`. It brings a shell command, `lcm`, that reads the `lcm.db` database without changing conversations and can write one validated config value. In chat, `/lossless` and `/lcm` work: status, a database backup, and checking and repairing broken summaries. A separate `lossless-claw-migrate-sessions` command imports old OpenClaw session files into the database once, in dry-run mode by default.

Who it is for. For OpenClaw users with long conversations whose agent loses details once the context is trimmed.

Good fit when

  • An OpenClaw agent works on one task for days and forgets earlier agreements once the context is trimmed
  • You need to find a specific decision or a code fragment in old history that has already left the model's window
  • You want to see how many summaries have piled up and check their integrity with `/lossless doctor`
  • The model's window is large and you need to tune the compaction threshold for it or for particular channels, such as Telegram
  • Old OpenClaw sessions that predate the plugin have to be added to the database

Not a fit when

  • You do not use OpenClaw: the plugin plugs into its context mechanism and does nothing without it
  • Your OpenClaw is older than 2026.9.2: the author requires that release or newer
  • Your Node.js is below 22: the plugin is built for that version
  • You need memory across different agents and projects rather than inside one conversation: MCP Memory Service in the catalog is for that

Example request

Find in our history why we chose the second migration scheme and show the exact wording from that conversation

Limitations

The license is MIT. You need OpenClaw 2026.9.2 or newer, Node.js 22 or newer and a model provider configured in OpenClaw for the summaries.

  • The plugin calls a model to write summaries, so the text of your conversations goes to the provider and uses tokens. The `summaryMaxCallsPerWindow` and `summarySpendBackoffMs` limits guard against runaway spending.
  • The recall-policy hook works only with an explicit `allowConversationAccess` grant in settings; otherwise OpenClaw blocks it.
  • The Context explorer panel is enabled in OpenClaw separately: Settings, Labs, Custom plugin UI.
  • The `transcriptGcEnabled` and `autoRotateSessionFiles` fields from 0.15 configs are ignored in 1.x with a startup warning.
  • The `/lossless` and `/lcm` commands work in chat; the plugin does not register the `openclaw lossless` and `openclaw lcm` root subcommands.

How to disable. Set `LCM_ENABLED=false` or `enabled: false` in the `lossless-claw` entry under `plugins.entries`, put the `contextEngine` slot back to its default and restart OpenClaw. The `lcm.db` database stays on disk; its path comes from `LCM_DATABASE_PATH`.

FAQ

What is actually stored in the database?

Every message in full, grouped by conversation, and the graph of summaries above them. A summary always links to its source messages, so the agent can expand it and get the original text back.

Which model builds the summaries?

The one configured in OpenClaw. You can set a cheaper one through `summaryModel` and `summaryProvider` or the `LCM_SUMMARY_MODEL` and `LCM_SUMMARY_PROVIDER` variables, and expansion is configured separately with `expansionModel`.

How do I keep service sessions out of storage?

With `ignoreSessionPatterns` or the `LCM_IGNORE_SESSION_PATTERNS` variable: patterns like `agent:*:cron:**` create no rows in the database. For sessions that may read history but never write to it there is `LCM_STATELESS_SESSION_PATTERNS`.

How do I set the compaction threshold by window size?

With `contextThresholdOverrides`: a rule with a `modelContextWindowMin` condition replaces the threshold for large-window models, and a rule with `sessionPattern` does the same for particular channels such as Telegram.

What does /lossless doctor do?

It scans the database for broken or truncated summaries. `/lossless doctor apply` repairs them in the current conversation after a safety check, and repairing another conversation needs the explicit `confirm-offline` confirmation.

Is there an interface for browsing the database?

Yes, `lcm-tui` in Go: it can reverse a condensation, repair damaged summaries, rewrite them and transplant a summary tree between conversations. Details are in the repository's `tui/README.md`.

Discussion

No questions or reviews yet.

Plugins

A long-term memory plugin for the OpenClaw agent on LanceDB: captures preferences and decisions itself, hybrid search, noise fading

PluginBroad access4.5KRepository stars
Editors’ pick

Open-source personal AI assistant on your own machine: answers in Telegram, Slack, Discord and WhatsApp, extended with skills and plugins

CLIBroad access393.4KRepository stars

A persistent memory plugin: stores observations from agent sessions and injects relevant context into new ones

PluginBroad access104.1KRepository stars
Official

Local context compression for agents: tool outputs, logs, files and RAG chunks shrink before reaching the LLM. Proxy, CLI, library and MCP

MCP serverBroad access78.2KRepository stars

Awesome OpenClaw

awesome-openclaw

Resources around OpenClaw: official projects, skills, plugins and tools including adjacent security ones. The content is mixed

SkillExtended access747Repository stars

A plugin with memory of past chats: it searches by meaning for decisions and reasons across Claude Code, Codex, Cursor and opencode sessions over MCP

PluginExtended access493Repository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialAuthenticationRepository starsMain difference
Lossless Claw (this entry)no4,913
MCP Memory Servicenonot required2,054long-term memory for different agents through MCP and REST, with semantic search and a knowledge graph
Context Modenonot required32,835an MCP server that keeps large tool output outside the context window

README in short

The description, in English and Chinese, opens with a link to the LCM paper and an animated visualization, then lists five steps of operation: storage, summarizing, condensing, context assembly and search tools. After that it covers the shell and chat commands, the one-time session import, a quick start with the requirements and the context slot setup, the plugin config and a table of environment variables. It closes with sections on development, including a source layout, and on security. The repository holds TypeScript code, the `lcm-tui` interface in Go, vitest tests, specs and documentation in `docs/`, including a reference of the agent tools.

README badge

Report a problem

Foxx AILossless Claw
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.