Skip to main content
Back

Lossless Claw Stops AI Coding Agents From Forgetting Long Sessions

A DAG-based context engine for OpenClaw persists every message in SQLite and summarizes older chunks hierarchically, so agents stop forgetting.

Repo, Full Access
  • Lossless Claw is an OpenClaw plugin that replaces sliding-window truncation with a DAG-based summary graph.
  • Every message is persisted in SQLite; older chunks are summarized and condensed into hierarchical nodes.
  • Agents get lcm_grep, lcm_describe, and lcm_expand tools to drill back into original messages on demand.
  • Release 0.9.3 adds cache-aware compaction that fires before overflow, plus Codex, DeepSeek, and Bedrock fixes.
  • Summarization can be routed to a cheaper model like gpt-5.4-mini or Haiku while the main agent stays premium.
  • MIT licensed, 4.9k stars, requires Node 22+ and OpenClaw with plugin context-engine support.

If you have ever watched a long-running coding agent trip over its own history the moment the context window fills up, Lossless Claw is trying to make that failure mode disappear. It is a plugin for the OpenClaw agent runtime that swaps out the default sliding-window compaction for a persistent, hierarchical summary graph. The repo has crossed 4.9k stars, and the latest 0.9.3 release focuses on stability rather than headline features.

Truncation is out, DAGs are in

By default, OpenClaw uses a legacy context engine that truncates or slides old messages out of the window as conversations grow. Once messages fall off, the agent loses them for good. Lossless Claw (LCM stands for Lossless Context Management) takes the opposite stance: keep everything, compress intelligently.

Under the hood, it does five things every turn:

  1. Persists every message in a SQLite database, organized by conversation
  2. Summarizes chunks of older messages using your configured LLM
  3. Condenses those summaries into higher-level nodes as they accumulate, forming a DAG (directed acyclic graph)
  4. Assembles context each turn by combining summaries with recent raw messages
  5. Exposes recall tools (lcm_grep, lcm_describe, lcm_expand) so the agent can search compacted history and drill back into original detail on demand