[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-74794":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},74794,"lossless-claw","Martian-Engineering\u002Flossless-claw","Martian-Engineering","Lossless Claw — LCM (Lossless Context Management) plugin for OpenClaw","",null,"TypeScript",4825,420,23,140,0,9,26,213,27,29.87,"MIT License",false,"main",[],"2026-06-12 02:03:28","# lossless-claw\n\nLossless Context Management plugin for [OpenClaw](https:\u002F\u002Fgithub.com\u002Fopenclaw\u002Fopenclaw), based on the [LCM paper](https:\u002F\u002Fpapers.voltropy.com\u002FLCM) from [Voltropy](https:\u002F\u002Fx.com\u002FVoltropy). Replaces OpenClaw's built-in sliding-window compaction with a DAG-based summarization system that preserves every message while keeping active context within model token limits.\n\n## Table of contents\n\n- [What it does](#what-it-does)\n- [Quick start](#quick-start)\n- [Configuration](#configuration)\n- [Commands And Skill](#commands-and-skill)\n- [Documentation](#documentation)\n- [Development](#development)\n- [License](#license)\n\n## What it does\n\nTwo ways to learn: read the below, or [check out this super cool animated visualization](https:\u002F\u002Flosslesscontext.ai).\n\nWhen a conversation grows beyond the model's context window, OpenClaw (just like all of the other agents) normally truncates older messages. LCM instead:\n\n1. **Persists every message** in a SQLite database, organized by conversation\n2. **Summarizes chunks** of older messages into summaries using your configured LLM\n3. **Condenses summaries** into higher-level nodes as they accumulate, forming a DAG (directed acyclic graph)\n4. **Assembles context** each turn by combining summaries + recent raw messages\n5. **Provides tools** (`lcm_grep`, `lcm_describe`, `lcm_expand`) so agents can search and recall details from compacted history\n\nNothing is lost. Raw messages stay in the database. Summaries link back to their source messages. Agents can drill into any summary to recover the original detail.\n\n**It feels like talking to an agent that never forgets. Because it doesn't. In normal operation, you'll never need to think about compaction again.**\n\n## Commands And Skill\n\nThe plugin now ships a bundled `lossless-claw` skill plus a small plugin command surface for supported OpenClaw chat\u002Fnative command providers:\n\n- `\u002Flcm` shows version, enablement\u002Fselection state, DB path and size, summary counts, and summary-health status\n- `\u002Flcm backup` creates a timestamped backup of the current LCM SQLite database\n- `\u002Flcm rotate` rewrites the active session transcript into a compact tail-preserving form without changing the live OpenClaw session identity or current LCM conversation\n- `\u002Flcm doctor` scans for broken or truncated summaries\n- `\u002Flcm doctor clean` shows read-only high-confidence junk diagnostics for archived subagents, cron sessions, and NULL-key orphaned subagent runs\n- `\u002Flcm status` shows plugin, conversation, and maintenance state including deferred compaction debt\n- `\u002Flossless` is an alias for `\u002Flcm` on supported native command surfaces\n\nThese are plugin slash\u002Fnative commands, not root shell CLI subcommands. Supported examples:\n\n- `\u002Flcm`\n- `\u002Flcm backup`\n- `\u002Flcm rotate`\n- `\u002Flcm doctor`\n- `\u002Flcm doctor clean`\n- `\u002Flossless`\n\nNot currently supported as root CLI commands:\n\n- `openclaw lcm`\n- `openclaw lossless`\n- `openclaw \u002Flcm`\n\nThe bundled skill focuses on configuration, diagnostics, architecture, and recall-tool usage. Its reference set lives under `skills\u002Flossless-claw\u002Freferences\u002F`.\n\n## Quick start\n\n### Prerequisites\n\n- OpenClaw with plugin context engine support\n- Node.js 22+\n- An LLM provider configured in OpenClaw (used for summarization)\n\n### Install the plugin\n\nUse OpenClaw's plugin installer (recommended):\n\n```bash\nopenclaw plugins install @martian-engineering\u002Flossless-claw\n```\n\nIf you're running from a local OpenClaw checkout, use:\n\n```bash\npnpm openclaw plugins install @martian-engineering\u002Flossless-claw\n```\n\nFor local plugin development, build your working copy first, then link it instead of copying files:\n\n```bash\ncd \u002Fpath\u002Fto\u002Flossless-claw\npnpm build\n\nopenclaw plugins install --link \u002Fpath\u002Fto\u002Flossless-claw\n# or from a local OpenClaw checkout:\n# pnpm openclaw plugins install --link \u002Fpath\u002Fto\u002Flossless-claw\n```\n\nRe-run `pnpm build` after local source changes so the linked plugin's `dist\u002F` output stays current.\n\nThe install command records the plugin, enables it, and applies compatible slot selection (including `contextEngine` when applicable).\n\n> **Note:** If your OpenClaw config uses `plugins.allow`, allowlist the plugin id `lossless-claw` plus any other active plugins you rely on. Do not add command tokens or aliases like `lossless` or `\u002Flcm` to `plugins.allow`; that setting only accepts plugin ids. In some setups, narrowing the allowlist can prevent plugin-backed integrations from loading, even if `lossless-claw` itself is installed correctly. Restart the gateway after plugin config changes.\n\n### Configure OpenClaw\n\nIn most cases, no manual JSON edits are needed after `openclaw plugins install`.\n\nIf you need to set it manually, ensure the context engine slot points at lossless-claw:\n\n```json\n{\n  \"plugins\": {\n    \"slots\": {\n      \"contextEngine\": \"lossless-claw\"\n    }\n  }\n}\n```\n\nRestart OpenClaw after configuration changes.\n\n## Configuration\n\nLCM is configured through a combination of plugin config and environment variables. Environment variables take precedence for backward compatibility.\n\n### Plugin config\n\nAdd a `lossless-claw` entry under `plugins.entries` in your OpenClaw config:\n\n```json\n{\n  \"plugins\": {\n    \"entries\": {\n      \"lossless-claw\": {\n        \"enabled\": true,\n        \"llm\": {\n          \"allowModelOverride\": true,\n          \"allowedModels\": [\"openai\u002Fgpt-5.4-mini\"]\n        },\n        \"config\": {\n          \"freshTailCount\": 64,\n          \"leafChunkTokens\": 80000,\n          \"newSessionRetainDepth\": 2,\n          \"contextThreshold\": 0.75,\n          \"incrementalMaxDepth\": 1,\n          \"cacheAwareCompaction\": {\n            \"enabled\": true,\n            \"cacheTTLSeconds\": 300\n          },\n          \"ignoreSessionPatterns\": [\n            \"agent:*:cron:**\"\n          ],\n          \"transcriptGcEnabled\": false,\n          \"proactiveThresholdCompactionMode\": \"deferred\",\n          \"summaryModel\": \"openai\u002Fgpt-5.4-mini\",\n          \"expansionModel\": \"openai\u002Fgpt-5.4-mini\",\n          \"delegationTimeoutMs\": 300000,\n          \"summaryTimeoutMs\": 60000\n        }\n      }\n    }\n  }\n}\n```\n\n`leafChunkTokens` controls how many source tokens can accumulate in a leaf compaction chunk before summarization is triggered. The default is `20000`, but quota-limited summary providers may benefit from a larger value to reduce compaction frequency. `summaryModel` and `summaryProvider` let you request a cheaper or faster compaction model through OpenClaw's `api.runtime.llm.complete` capability; OpenClaw still owns provider dispatch and auth. Explicit summary model requests require `llm.allowModelOverride` and matching `llm.allowedModels` policy entries for `lossless-claw`. `expansionModel` does the same for `lcm_expand_query` sub-agent calls (drilling into summaries to recover detail). `delegationTimeoutMs` controls how long `lcm_expand_query` waits for that delegated sub-agent to finish before returning a timeout error; it defaults to `120000` (120s). `summaryTimeoutMs` controls the per-call timeout for model-backed LCM summarization; it defaults to `60000` (60s). When unset, the model settings still fall back to OpenClaw's configured default model\u002Fprovider. See [Expansion model override requirements](#expansion-model-override-requirements) for the required `subagent` trust policy when using `expansionModel`.\n\n### Environment variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `LCM_ENABLED` | `true` | Enable\u002Fdisable the plugin |\n| `LCM_DATABASE_PATH` | `~\u002F.openclaw\u002Flcm.db` | Path to the SQLite database |\n| `LCM_IGNORE_SESSION_PATTERNS` | `\"\"` | Comma-separated glob patterns for session keys to exclude from LCM storage |\n| `LCM_STATELESS_SESSION_PATTERNS` | `\"\"` | Comma-separated glob patterns for session keys that may read from LCM but never write to it |\n| `LCM_SKIP_STATELESS_SESSIONS` | `true` | Enable stateless-session write skipping for matching session keys |\n| `LCM_CONTEXT_THRESHOLD` | `0.75` | Fraction of context window that triggers compaction (0.0–1.0) |\n| `LCM_FRESH_TAIL_COUNT` | `64` | Number of recent messages protected from compaction |\n| `LCM_NEW_SESSION_RETAIN_DEPTH` | `2` | Context retained after `\u002Fnew` (`-1` keeps all context, `2` keeps d2+) |\n| `LCM_LEAF_MIN_FANOUT` | `8` | Minimum raw messages per leaf summary |\n| `LCM_CONDENSED_MIN_FANOUT` | `4` | Minimum summaries per condensed node |\n| `LCM_CONDENSED_MIN_FANOUT_HARD` | `2` | Relaxed fanout for forced compaction sweeps |\n| `LCM_INCREMENTAL_MAX_DEPTH` | `1` | How deep incremental compaction goes (0 = leaf only, 1 = one condensed pass, -1 = unlimited) |\n| `LCM_LEAF_CHUNK_TOKENS` | `20000` | Max source tokens per leaf compaction chunk |\n| `LCM_LEAF_TARGET_TOKENS` | `1200` | Target token count for leaf summaries |\n| `LCM_CONDENSED_TARGET_TOKENS` | `2000` | Target token count for condensed summaries |\n| `LCM_MAX_EXPAND_TOKENS` | `4000` | Token cap for sub-agent expansion queries |\n| `LCM_LARGE_FILE_TOKEN_THRESHOLD` | `25000` | File blocks above this size are intercepted and stored separately |\n| `LCM_LARGE_FILE_SUMMARY_PROVIDER` | `\"\"` | Provider override for large-file summarization |\n| `LCM_LARGE_FILE_SUMMARY_MODEL` | `\"\"` | Model override for large-file summarization |\n| `LCM_SUMMARY_MODEL` | `\"\"` | Model override for compaction summarization; falls back to OpenClaw's default model when unset |\n| `LCM_SUMMARY_PROVIDER` | `\"\"` | Provider override for compaction summarization; falls back to `OPENCLAW_PROVIDER` or the provider embedded in the model ref |\n| `LCM_SUMMARY_BASE_URL` | *(from OpenClaw \u002F provider default)* | Base URL override for summarization API calls |\n| `LCM_EXPANSION_MODEL` | *(from OpenClaw)* | Model override for `lcm_expand_query` sub-agent (e.g. `openai\u002Fgpt-5.4-mini`) |\n| `LCM_EXPANSION_PROVIDER` | *(from OpenClaw)* | Provider override for `lcm_expand_query` sub-agent |\n| `LCM_DELEGATION_TIMEOUT_MS` | `120000` | Max time to wait for delegated `lcm_expand_query` sub-agent completion |\n| `LCM_SUMMARY_TIMEOUT_MS` | `60000` | Max time to wait for a single model-backed LCM summarizer call |\n| `LCM_PRUNE_HEARTBEAT_OK` | `false` | Retroactively delete `HEARTBEAT_OK` turn cycles from LCM storage |\n| `LCM_TRANSCRIPT_GC_ENABLED` | `false` | Enable transcript rewrite GC during `maintain()` |\n| `LCM_PROACTIVE_THRESHOLD_COMPACTION_MODE` | `deferred` | Choose whether proactive threshold compaction is deferred into maintenance debt or kept inline for legacy behavior |\n| `LCM_CACHE_TTL_SECONDS` | `300` | Cache TTL used by cache-aware deferred compaction when provider\u002Fruntime telemetry does not supply a more specific retention window |\n\nTranscript GC rewrites are disabled by default. Set `transcriptGcEnabled` or `LCM_TRANSCRIPT_GC_ENABLED` to turn them on explicitly.\nDeferred proactive compaction is also the default. Set `proactiveThresholdCompactionMode` or `LCM_PROACTIVE_THRESHOLD_COMPACTION_MODE` to `inline` only if you need legacy foreground compaction behavior. In deferred mode, lossless-claw records one coalesced prompt-mutating debt item after the turn, leaves background `maintain()` to process only non-prompt-mutating work while Anthropic cache is still hot, and then consumes that debt pre-assembly once the cache is cold or the prompt is approaching overflow.\n\n### Expansion model override requirements\n\nIf you want `lcm_expand_query` to run on a dedicated model via `expansionModel` or `LCM_EXPANSION_MODEL`, OpenClaw must explicitly trust the plugin to request sub-agent model overrides.\n\nFor most setups, `openai\u002Fgpt-5.4-mini` is a better starting point than Anthropic Haiku because it is cheap, fast, and does not depend on Anthropic quota remaining.\n\nAdd a `subagent` policy under `plugins.entries.lossless-claw` and allowlist the canonical `provider\u002Fmodel` target you want the plugin to use:\n\n```json\n{\n  \"models\": {\n    \"openai\u002Fgpt-4.1-mini\": {}\n  },\n  \"plugins\": {\n    \"entries\": {\n      \"lossless-claw\": {\n        \"enabled\": true,\n        \"subagent\": {\n          \"allowModelOverride\": true,\n          \"allowedModels\": [\"openai\u002Fgpt-4.1-mini\"]\n        },\n        \"config\": {\n          \"expansionModel\": \"openai\u002Fgpt-4.1-mini\"\n        }\n      }\n    }\n  }\n}\n```\n\n- `subagent.allowModelOverride` is required for OpenClaw to honor plugin-requested per-run `provider`\u002F`model` overrides.\n- `subagent.allowedModels` is optional but recommended. Use `\"*\"` only if you intentionally want to trust any target model.\n- The chosen expansion target must also be available in OpenClaw's normal model catalog. If it is not already configured elsewhere, add it under the top-level `models` map as shown above.\n- If you prefer splitting provider and model, set `config.expansionProvider` and use a bare `config.expansionModel`.\n\nPlugin config equivalents:\n\n- `ignoreSessionPatterns`\n- `statelessSessionPatterns`\n- `skipStatelessSessions`\n- `transcriptGcEnabled`\n- `newSessionRetainDepth`\n- `summaryModel`\n- `summaryProvider`\n- `delegationTimeoutMs`\n- `summaryTimeoutMs`\n\nEnvironment variables still win over plugin config when both are set.\n\n### Summary model priority\n\nFor compaction summarization, lossless-claw resolves the model in this order:\n\n1. `LCM_SUMMARY_MODEL` \u002F `LCM_SUMMARY_PROVIDER`\n2. Plugin config `summaryModel` \u002F `summaryProvider`\n3. OpenClaw's default compaction model\u002Fprovider\n4. Runtime\u002Fsession model\u002Fprovider hints from OpenClaw\n\nIf `summaryModel` already includes a provider prefix such as `anthropic\u002Fclaude-sonnet-4-20250514`, `summaryProvider` is ignored for that choice. Otherwise, the provider falls back to the matching override, then `OPENCLAW_PROVIDER`, then the provider inferred by the caller.\n\nSummary calls are dispatched through OpenClaw's runtime LLM layer, so auth profiles, OAuth refresh, API keys, base URLs, and provider-specific request preparation remain host-owned. Run `openclaw doctor --fix` after adding explicit summary model overrides if you want OpenClaw to add the matching `plugins.entries.lossless-claw.llm` policy.\n\n### Recommended starting configuration\n\n```\nLCM_FRESH_TAIL_COUNT=64\nLCM_LEAF_CHUNK_TOKENS=20000\nLCM_INCREMENTAL_MAX_DEPTH=1\nLCM_CONTEXT_THRESHOLD=0.75\nLCM_SUMMARY_MODEL=openai\u002Fgpt-5.4-mini\nLCM_EXPANSION_MODEL=openai\u002Fgpt-5.4-mini\n```\n\n- **freshTailCount=64** protects the last 64 messages from compaction, giving the model more recent context for continuity.\n- **leafChunkTokens=20000** limits how large each leaf compaction chunk can grow before LCM summarizes it. Increase this when your summary provider is quota-limited and frequent leaf compactions are exhausting that quota.\n- **incrementalMaxDepth=1** runs one condensed pass after each leaf compaction by default. Set to `0` for leaf-only behavior, a larger positive integer for a deeper cap, or `-1` for unlimited cascading.\n- **contextThreshold=0.75** triggers compaction when context reaches 75% of the model's window, leaving headroom for the model's response.\n\n### Session exclusion patterns\n\n### Session reset semantics\n\nLossless-claw distinguishes OpenClaw's two session-reset commands:\n\n- `\u002Fnew` keeps the active conversation row and all stored summaries, but prunes `context_items` so the next turn rebuilds context from retained summaries instead of the fresh tail.\n- `\u002Freset` archives the active conversation row and creates a new active row for the same stable `sessionKey`, giving the next turn a clean LCM conversation while preserving prior history.\n\nFor large sessions, neither command is a perfect “keep my live agent context, but stop writing into this giant active LCM row” tool:\n\n- `\u002Fnew` keeps writing into the same active LCM conversation row.\n- `\u002Freset` changes OpenClaw session flow, which is heavier than users often want when their real problem is just LCM row size.\n\n`\u002Flcm rotate` fills that gap. It replaces one rolling `rotate-latest` SQLite backup, rewrites the current session transcript down to the preserved live tail plus current session settings, and refreshes the bootstrap frontier on the same active LCM conversation so dropped transcript history is not replayed. Existing summaries, context items, and conversation identity stay in place; only the transcript backing is compacted. If you want additional timestamped snapshots instead, run `\u002Flcm backup`.\n\n`newSessionRetainDepth` (or `LCM_NEW_SESSION_RETAIN_DEPTH`) controls how much summary structure survives `\u002Fnew`:\n\n- `-1`: keep all existing context items\n- `0`: keep all summaries, drop only fresh-tail messages\n- `1`: keep d1+ summaries\n- `2`: keep d2+ summaries; recommended default\n- `3+`: keep only deeper, more abstract summaries\n\nLossless-claw applies `\u002Fnew` pruning through `before_reset` and uses `session_end` to catch transcript rollovers such as `\u002Freset`, idle or daily session rotation, compaction session replacement, and deletions. User-facing confirmation text after `\u002Fnew` or `\u002Freset` must still be emitted by OpenClaw's command handlers.\n\nUse `ignoreSessionPatterns` or `LCM_IGNORE_SESSION_PATTERNS` to keep low-value sessions completely out of LCM. Matching sessions do not create conversations, do not store messages, and do not participate in compaction or delegated expansion grants.\n\nPattern rules:\n\n- `*` matches any characters except `:`\n- `**` matches anything, including `:`\n- Patterns match the full session key\n\nExamples:\n\n- `agent:*:cron:**` excludes cron sessions for any agent, including isolated run sessions like `agent:main:cron:daily-digest:run:run-123`\n- `agent:main:subagent:**` excludes all main-agent subagent sessions\n- `agent:ops:**` excludes every session under the `ops` agent id\n\nEnvironment variable example:\n\n```bash\nLCM_IGNORE_SESSION_PATTERNS=agent:*:cron:**,agent:main:subagent:**\n```\n\nPlugin config example:\n\n```json\n{\n  \"plugins\": {\n    \"entries\": {\n      \"lossless-claw\": {\n        \"config\": {\n          \"ignoreSessionPatterns\": [\n            \"agent:*:cron:**\",\n            \"agent:main:subagent:**\"\n          ]\n        }\n      }\n    }\n  }\n}\n```\n\n### Stateless session patterns\n\nUse `statelessSessionPatterns` or `LCM_STATELESS_SESSION_PATTERNS` for sessions that should still be able to read from existing LCM context, but should never create or mutate LCM state themselves. This is useful for delegated or temporary sub-agent sessions that should benefit from retained context without polluting the database.\n\nWhen `skipStatelessSessions` or `LCM_SKIP_STATELESS_SESSIONS` is enabled, matching sessions:\n\n- skip bootstrap imports\n- skip message persistence during ingest and after-turn hooks\n- skip compaction writes and delegated expansion grant writes\n- can still assemble context from already-persisted conversations when a matching conversation exists\n\nPattern rules are the same as `ignoreSessionPatterns`, and matching is done against the full session key.\n\nEnvironment variable example:\n\n```bash\nLCM_STATELESS_SESSION_PATTERNS=agent:*:subagent:**,agent:ops:subagent:**\nLCM_SKIP_STATELESS_SESSIONS=true\n```\n\nPlugin config example:\n\n```json\n{\n  \"plugins\": {\n    \"entries\": {\n      \"lossless-claw\": {\n        \"config\": {\n          \"statelessSessionPatterns\": [\n            \"agent:*:subagent:**\",\n            \"agent:ops:subagent:**\"\n          ],\n          \"skipStatelessSessions\": true\n        }\n      }\n    }\n  }\n}\n```\n\n### OpenClaw session reset settings\n\nLCM preserves history through compaction, but it does **not** change OpenClaw's core session reset policy. If sessions are resetting sooner than you want, increase OpenClaw's `session.reset.idleMinutes` or use a channel\u002Ftype-specific override.\n\n```json\n{\n  \"session\": {\n    \"reset\": {\n      \"mode\": \"idle\",\n      \"idleMinutes\": 10080\n    }\n  }\n}\n```\n\n- `session.reset.mode: \"idle\"` keeps a session alive until the idle window expires.\n- `session.reset.idleMinutes` is the actual reset interval in minutes.\n- OpenClaw does **not** currently enforce a maximum `idleMinutes`; in source it is validated only as a positive integer.\n- If you also use daily reset mode, `idleMinutes` acts as a secondary guard and the session resets when **either** the daily boundary or the idle window is reached first.\n- Legacy `session.idleMinutes` still works, but OpenClaw prefers `session.reset.idleMinutes`.\n\nUseful values:\n\n- `1440` = 1 day\n- `10080` = 7 days\n- `43200` = 30 days\n- `525600` = 365 days\n\nFor most long-lived LCM setups, a good starting point is:\n\n```json\n{\n  \"session\": {\n    \"reset\": {\n      \"mode\": \"idle\",\n      \"idleMinutes\": 10080\n    }\n  }\n}\n```\n\n## Documentation\n\n- [Configuration guide](docs\u002Fconfiguration.md)\n- [Architecture](docs\u002Farchitecture.md)\n- [Agent tools](docs\u002Fagent-tools.md)\n- [TUI Reference](docs\u002Ftui.md)\n- [lcm-tui](tui\u002FREADME.md)\n- [Optional: enable FTS5 for fast full-text search](docs\u002Ffts5.md)\n\n## Development\n\n```bash\n# Build (bundles TypeScript to dist\u002Findex.js)\npnpm build\n\n# Run tests\nnpx vitest\n\n# Type check\nnpx tsc --noEmit\n\n# Run a specific test file\nnpx vitest test\u002Fengine.test.ts\n```\n\n### Project structure\n\n```\nindex.ts                    # Plugin entry point and registration\nsrc\u002F\n  engine.ts                 # LcmContextEngine — implements ContextEngine interface\n  assembler.ts              # Context assembly (summaries + messages → model context)\n  compaction.ts             # CompactionEngine — leaf passes, condensation, sweeps\n  summarize.ts              # Depth-aware prompt generation and LLM summarization\n  retrieval.ts              # RetrievalEngine — grep, describe, expand operations\n  expansion.ts              # DAG expansion logic for lcm_expand_query\n  expansion-auth.ts         # Delegation grants for sub-agent expansion\n  expansion-policy.ts       # Depth\u002Ftoken policy for expansion\n  large-files.ts            # File interception, storage, and exploration summaries\n  integrity.ts              # DAG integrity checks and repair utilities\n  transcript-repair.ts      # Tool-use\u002Fresult pairing sanitization\n  types.ts                  # Core type definitions (dependency injection contracts)\n  openclaw-bridge.ts        # Bridge utilities\n  db\u002F\n    config.ts               # LcmConfig resolution from env vars\n    connection.ts           # SQLite connection management\n    migration.ts            # Schema migrations\n  store\u002F\n    conversation-store.ts   # Message persistence and retrieval\n    summary-store.ts        # Summary DAG persistence and context item management\n    fts5-sanitize.ts        # FTS5 query sanitization\n  tools\u002F\n    lcm-grep-tool.ts        # lcm_grep tool implementation\n    lcm-describe-tool.ts    # lcm_describe tool implementation\n    lcm-expand-tool.ts      # lcm_expand tool (sub-agent only)\n    lcm-expand-query-tool.ts # lcm_expand_query tool (main agent wrapper)\n    lcm-conversation-scope.ts # Conversation scoping utilities\n    common.ts               # Shared tool utilities\ntest\u002F                       # Vitest test suite\nspecs\u002F                      # Design specifications\nopenclaw.plugin.json        # Plugin manifest with config schema and UI hints\ntui\u002F                        # Interactive terminal UI (Go)\n  main.go                   # Entry point and bubbletea app\n  data.go                   # Data loading and SQLite queries\n  dissolve.go               # Summary dissolution\n  repair.go                 # Corrupted summary repair\n  rewrite.go                # Summary re-summarization\n  transplant.go             # Cross-conversation DAG copy\n  prompts\u002F                  # Depth-aware prompt templates\n.goreleaser.yml             # GoReleaser config for TUI binary releases\n```\n\n## License\n\nMIT\n","Lossless Claw 是一个为OpenClaw设计的无损上下文管理插件，基于Voltropy的LCM论文。它通过DAG（有向无环图）结构化地存储和总结对话信息，确保即使在超出模型上下文窗口限制时也能保留所有消息。核心功能包括持久化存储每条消息至SQLite数据库、使用配置的语言模型对旧消息进行分块总结、将这些总结进一步压缩成更高级别的节点，并在每次交互中结合最近的消息和总结来构建上下文。此外，提供了一系列工具如`lcm_grep`、`lcm_describe`等，允许用户或代理从压缩的历史记录中检索特定细节。适用于需要长期记忆支持的聊天机器人场景，特别是在对话历史对于理解当前讨论至关重要时。",2,"2026-06-11 03:50:50","high_star"]