@lossless-claude/lcm 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/.claude-plugin/commands/lcm-compact.md +31 -0
  2. package/.claude-plugin/commands/lcm-curate.md +31 -0
  3. package/.claude-plugin/commands/lcm-diagnose.md +29 -0
  4. package/.claude-plugin/commands/lcm-doctor.md +23 -0
  5. package/.claude-plugin/commands/lcm-dogfood.md +101 -0
  6. package/.claude-plugin/commands/lcm-import.md +48 -0
  7. package/.claude-plugin/commands/lcm-promote.md +29 -0
  8. package/.claude-plugin/commands/lcm-sensitive.md +55 -0
  9. package/.claude-plugin/commands/lcm-stats.md +19 -0
  10. package/.claude-plugin/commands/lcm-status.md +27 -0
  11. package/.claude-plugin/hooks/README.md +47 -0
  12. package/.claude-plugin/marketplace.json +20 -0
  13. package/.claude-plugin/mcp.mjs +12 -0
  14. package/.claude-plugin/plugin.json +46 -0
  15. package/.claude-plugin/skills/lcm-context/SKILL.md +107 -0
  16. package/.claude-plugin/skills/lcm-dogfood/SKILL.md +102 -0
  17. package/.claude-plugin/skills/lcm-dogfood/references/checks.md +239 -0
  18. package/.claude-plugin/skills/lcm-dogfood/references/known-issues.md +11 -0
  19. package/.claude-plugin/skills/lcm-dogfood/scripts/db-integrity.js +40 -0
  20. package/.claude-plugin/skills/lcm-dogfood/scripts/prompt-search-test.js +35 -0
  21. package/.claude-plugin/skills/lcm-e2e/SKILL.md +61 -0
  22. package/.claude-plugin/skills/lcm-e2e/checklist.md +367 -0
  23. package/.claude-plugin/skills/lossless-claude-upgrade/SKILL.md +47 -0
  24. package/LICENSE +21 -0
  25. package/README.md +231 -0
  26. package/dist/bin/lcm.d.ts +2 -0
  27. package/dist/bin/lcm.js +461 -0
  28. package/dist/bin/lcm.js.map +1 -0
  29. package/dist/installer/dry-run-deps.d.ts +23 -0
  30. package/dist/installer/dry-run-deps.js +66 -0
  31. package/dist/installer/dry-run-deps.js.map +1 -0
  32. package/dist/installer/install.d.ts +39 -0
  33. package/dist/installer/install.js +236 -0
  34. package/dist/installer/install.js.map +1 -0
  35. package/dist/installer/uninstall.d.ts +11 -0
  36. package/dist/installer/uninstall.js +80 -0
  37. package/dist/installer/uninstall.js.map +1 -0
  38. package/dist/src/batch-compact.d.ts +16 -0
  39. package/dist/src/batch-compact.js +121 -0
  40. package/dist/src/batch-compact.js.map +1 -0
  41. package/dist/src/compaction.d.ts +198 -0
  42. package/dist/src/compaction.js +964 -0
  43. package/dist/src/compaction.js.map +1 -0
  44. package/dist/src/connectors/constants.d.ts +5 -0
  45. package/dist/src/connectors/constants.js +6 -0
  46. package/dist/src/connectors/constants.js.map +1 -0
  47. package/dist/src/connectors/installer.d.ts +16 -0
  48. package/dist/src/connectors/installer.js +200 -0
  49. package/dist/src/connectors/installer.js.map +1 -0
  50. package/dist/src/connectors/registry.d.ts +4 -0
  51. package/dist/src/connectors/registry.js +264 -0
  52. package/dist/src/connectors/registry.js.map +1 -0
  53. package/dist/src/connectors/template-service.d.ts +5 -0
  54. package/dist/src/connectors/template-service.js +54 -0
  55. package/dist/src/connectors/template-service.js.map +1 -0
  56. package/dist/src/connectors/templates/base.md +1 -0
  57. package/dist/src/connectors/templates/mcp-base.md +1 -0
  58. package/dist/src/connectors/templates/sections/command-reference.md +15 -0
  59. package/dist/src/connectors/templates/sections/mcp-workflow.md +18 -0
  60. package/dist/src/connectors/templates/sections/workflow.md +29 -0
  61. package/dist/src/connectors/templates/skill/SKILL.md +74 -0
  62. package/dist/src/connectors/types.d.ts +19 -0
  63. package/dist/src/connectors/types.js +10 -0
  64. package/dist/src/connectors/types.js.map +1 -0
  65. package/dist/src/daemon/client.d.ts +9 -0
  66. package/dist/src/daemon/client.js +28 -0
  67. package/dist/src/daemon/client.js.map +1 -0
  68. package/dist/src/daemon/config.d.ts +48 -0
  69. package/dist/src/daemon/config.js +67 -0
  70. package/dist/src/daemon/config.js.map +1 -0
  71. package/dist/src/daemon/lifecycle.d.ts +19 -0
  72. package/dist/src/daemon/lifecycle.js +102 -0
  73. package/dist/src/daemon/lifecycle.js.map +1 -0
  74. package/dist/src/daemon/orientation.d.ts +1 -0
  75. package/dist/src/daemon/orientation.js +9 -0
  76. package/dist/src/daemon/orientation.js.map +1 -0
  77. package/dist/src/daemon/project-queue.d.ts +1 -0
  78. package/dist/src/daemon/project-queue.js +17 -0
  79. package/dist/src/daemon/project-queue.js.map +1 -0
  80. package/dist/src/daemon/project.d.ts +7 -0
  81. package/dist/src/daemon/project.js +25 -0
  82. package/dist/src/daemon/project.js.map +1 -0
  83. package/dist/src/daemon/proxy-manager.d.ts +21 -0
  84. package/dist/src/daemon/proxy-manager.js +205 -0
  85. package/dist/src/daemon/proxy-manager.js.map +1 -0
  86. package/dist/src/daemon/routes/compact.d.ts +13 -0
  87. package/dist/src/daemon/routes/compact.js +195 -0
  88. package/dist/src/daemon/routes/compact.js.map +1 -0
  89. package/dist/src/daemon/routes/describe.d.ts +3 -0
  90. package/dist/src/daemon/routes/describe.js +39 -0
  91. package/dist/src/daemon/routes/describe.js.map +1 -0
  92. package/dist/src/daemon/routes/expand.d.ts +3 -0
  93. package/dist/src/daemon/routes/expand.js +41 -0
  94. package/dist/src/daemon/routes/expand.js.map +1 -0
  95. package/dist/src/daemon/routes/grep.d.ts +3 -0
  96. package/dist/src/daemon/routes/grep.js +43 -0
  97. package/dist/src/daemon/routes/grep.js.map +1 -0
  98. package/dist/src/daemon/routes/ingest.d.ts +3 -0
  99. package/dist/src/daemon/routes/ingest.js +101 -0
  100. package/dist/src/daemon/routes/ingest.js.map +1 -0
  101. package/dist/src/daemon/routes/promote.d.ts +4 -0
  102. package/dist/src/daemon/routes/promote.js +104 -0
  103. package/dist/src/daemon/routes/promote.js.map +1 -0
  104. package/dist/src/daemon/routes/prompt-search.d.ts +3 -0
  105. package/dist/src/daemon/routes/prompt-search.js +65 -0
  106. package/dist/src/daemon/routes/prompt-search.js.map +1 -0
  107. package/dist/src/daemon/routes/recent.d.ts +3 -0
  108. package/dist/src/daemon/routes/recent.js +37 -0
  109. package/dist/src/daemon/routes/recent.js.map +1 -0
  110. package/dist/src/daemon/routes/restore.d.ts +3 -0
  111. package/dist/src/daemon/routes/restore.js +120 -0
  112. package/dist/src/daemon/routes/restore.js.map +1 -0
  113. package/dist/src/daemon/routes/search.d.ts +2 -0
  114. package/dist/src/daemon/routes/search.js +66 -0
  115. package/dist/src/daemon/routes/search.js.map +1 -0
  116. package/dist/src/daemon/routes/status.d.ts +3 -0
  117. package/dist/src/daemon/routes/status.js +80 -0
  118. package/dist/src/daemon/routes/status.js.map +1 -0
  119. package/dist/src/daemon/routes/store.d.ts +2 -0
  120. package/dist/src/daemon/routes/store.js +46 -0
  121. package/dist/src/daemon/routes/store.js.map +1 -0
  122. package/dist/src/daemon/server.d.ts +19 -0
  123. package/dist/src/daemon/server.js +183 -0
  124. package/dist/src/daemon/server.js.map +1 -0
  125. package/dist/src/daemon/summarizer.d.ts +11 -0
  126. package/dist/src/daemon/summarizer.js +51 -0
  127. package/dist/src/daemon/summarizer.js.map +1 -0
  128. package/dist/src/db/config.d.ts +31 -0
  129. package/dist/src/db/config.js +83 -0
  130. package/dist/src/db/config.js.map +1 -0
  131. package/dist/src/db/connection.d.ts +3 -0
  132. package/dist/src/db/connection.js +62 -0
  133. package/dist/src/db/connection.js.map +1 -0
  134. package/dist/src/db/features.d.ts +11 -0
  135. package/dist/src/db/features.js +36 -0
  136. package/dist/src/db/features.js.map +1 -0
  137. package/dist/src/db/migration.d.ts +4 -0
  138. package/dist/src/db/migration.js +499 -0
  139. package/dist/src/db/migration.js.map +1 -0
  140. package/dist/src/db/promoted.d.ts +47 -0
  141. package/dist/src/db/promoted.js +96 -0
  142. package/dist/src/db/promoted.js.map +1 -0
  143. package/dist/src/db/redaction-stats.d.ts +6 -0
  144. package/dist/src/db/redaction-stats.js +16 -0
  145. package/dist/src/db/redaction-stats.js.map +1 -0
  146. package/dist/src/diagnose.d.ts +39 -0
  147. package/dist/src/diagnose.js +432 -0
  148. package/dist/src/diagnose.js.map +1 -0
  149. package/dist/src/doctor/doctor.d.ts +4 -0
  150. package/dist/src/doctor/doctor.js +378 -0
  151. package/dist/src/doctor/doctor.js.map +1 -0
  152. package/dist/src/doctor/types.d.ts +24 -0
  153. package/dist/src/doctor/types.js +2 -0
  154. package/dist/src/doctor/types.js.map +1 -0
  155. package/dist/src/expansion.d.ts +100 -0
  156. package/dist/src/expansion.js +268 -0
  157. package/dist/src/expansion.js.map +1 -0
  158. package/dist/src/hooks/auto-heal.d.ts +12 -0
  159. package/dist/src/hooks/auto-heal.js +49 -0
  160. package/dist/src/hooks/auto-heal.js.map +1 -0
  161. package/dist/src/hooks/compact.d.ts +5 -0
  162. package/dist/src/hooks/compact.js +22 -0
  163. package/dist/src/hooks/compact.js.map +1 -0
  164. package/dist/src/hooks/dispatch.d.ts +7 -0
  165. package/dist/src/hooks/dispatch.js +36 -0
  166. package/dist/src/hooks/dispatch.js.map +1 -0
  167. package/dist/src/hooks/probe-precompact.d.ts +2 -0
  168. package/dist/src/hooks/probe-precompact.js +17 -0
  169. package/dist/src/hooks/probe-precompact.js.map +1 -0
  170. package/dist/src/hooks/probe-sessionstart.d.ts +2 -0
  171. package/dist/src/hooks/probe-sessionstart.js +18 -0
  172. package/dist/src/hooks/probe-sessionstart.js.map +1 -0
  173. package/dist/src/hooks/restore.d.ts +5 -0
  174. package/dist/src/hooks/restore.js +19 -0
  175. package/dist/src/hooks/restore.js.map +1 -0
  176. package/dist/src/hooks/session-end.d.ts +16 -0
  177. package/dist/src/hooks/session-end.js +73 -0
  178. package/dist/src/hooks/session-end.js.map +1 -0
  179. package/dist/src/hooks/user-prompt.d.ts +5 -0
  180. package/dist/src/hooks/user-prompt.js +31 -0
  181. package/dist/src/hooks/user-prompt.js.map +1 -0
  182. package/dist/src/import.d.ts +24 -0
  183. package/dist/src/import.js +119 -0
  184. package/dist/src/import.js.map +1 -0
  185. package/dist/src/large-files.d.ts +28 -0
  186. package/dist/src/large-files.js +413 -0
  187. package/dist/src/large-files.js.map +1 -0
  188. package/dist/src/llm/anthropic.d.ts +9 -0
  189. package/dist/src/llm/anthropic.js +54 -0
  190. package/dist/src/llm/anthropic.js.map +1 -0
  191. package/dist/src/llm/claude-process.d.ts +2 -0
  192. package/dist/src/llm/claude-process.js +55 -0
  193. package/dist/src/llm/claude-process.js.map +1 -0
  194. package/dist/src/llm/codex-process.d.ts +15 -0
  195. package/dist/src/llm/codex-process.js +142 -0
  196. package/dist/src/llm/codex-process.js.map +1 -0
  197. package/dist/src/llm/mock-summarizer.d.ts +9 -0
  198. package/dist/src/llm/mock-summarizer.js +17 -0
  199. package/dist/src/llm/mock-summarizer.js.map +1 -0
  200. package/dist/src/llm/openai.d.ts +10 -0
  201. package/dist/src/llm/openai.js +52 -0
  202. package/dist/src/llm/openai.js.map +1 -0
  203. package/dist/src/llm/types.d.ts +6 -0
  204. package/dist/src/llm/types.js +2 -0
  205. package/dist/src/llm/types.js.map +1 -0
  206. package/dist/src/mcp/server.d.ts +9 -0
  207. package/dist/src/mcp/server.js +128 -0
  208. package/dist/src/mcp/server.js.map +1 -0
  209. package/dist/src/mcp/tools/lcm-describe.d.ts +14 -0
  210. package/dist/src/mcp/tools/lcm-describe.js +12 -0
  211. package/dist/src/mcp/tools/lcm-describe.js.map +1 -0
  212. package/dist/src/mcp/tools/lcm-doctor.d.ts +8 -0
  213. package/dist/src/mcp/tools/lcm-doctor.js +9 -0
  214. package/dist/src/mcp/tools/lcm-doctor.js.map +1 -0
  215. package/dist/src/mcp/tools/lcm-expand.d.ts +18 -0
  216. package/dist/src/mcp/tools/lcm-expand.js +13 -0
  217. package/dist/src/mcp/tools/lcm-expand.js.map +1 -0
  218. package/dist/src/mcp/tools/lcm-grep.d.ts +27 -0
  219. package/dist/src/mcp/tools/lcm-grep.js +15 -0
  220. package/dist/src/mcp/tools/lcm-grep.js.map +1 -0
  221. package/dist/src/mcp/tools/lcm-search.d.ts +33 -0
  222. package/dist/src/mcp/tools/lcm-search.js +15 -0
  223. package/dist/src/mcp/tools/lcm-search.js.map +1 -0
  224. package/dist/src/mcp/tools/lcm-stats.d.ts +14 -0
  225. package/dist/src/mcp/tools/lcm-stats.js +11 -0
  226. package/dist/src/mcp/tools/lcm-stats.js.map +1 -0
  227. package/dist/src/mcp/tools/lcm-store.d.ts +26 -0
  228. package/dist/src/mcp/tools/lcm-store.js +22 -0
  229. package/dist/src/mcp/tools/lcm-store.js.map +1 -0
  230. package/dist/src/memory/index.d.ts +22 -0
  231. package/dist/src/memory/index.js +21 -0
  232. package/dist/src/memory/index.js.map +1 -0
  233. package/dist/src/promotion/dedup.d.ts +19 -0
  234. package/dist/src/promotion/dedup.js +42 -0
  235. package/dist/src/promotion/dedup.js.map +1 -0
  236. package/dist/src/promotion/detector.d.ts +15 -0
  237. package/dist/src/promotion/detector.js +31 -0
  238. package/dist/src/promotion/detector.js.map +1 -0
  239. package/dist/src/prompts/condensed-d1.yaml +38 -0
  240. package/dist/src/prompts/condensed-d2.yaml +32 -0
  241. package/dist/src/prompts/condensed-d3plus.yaml +32 -0
  242. package/dist/src/prompts/leaf-aggressive.yaml +34 -0
  243. package/dist/src/prompts/leaf-normal.yaml +34 -0
  244. package/dist/src/prompts/loader.d.ts +9 -0
  245. package/dist/src/prompts/loader.js +37 -0
  246. package/dist/src/prompts/loader.js.map +1 -0
  247. package/dist/src/prompts/promoted-merge.yaml +18 -0
  248. package/dist/src/prompts/system.yaml +5 -0
  249. package/dist/src/retrieval.d.ts +122 -0
  250. package/dist/src/retrieval.js +214 -0
  251. package/dist/src/retrieval.js.map +1 -0
  252. package/dist/src/scrub.d.ts +46 -0
  253. package/dist/src/scrub.js +184 -0
  254. package/dist/src/scrub.js.map +1 -0
  255. package/dist/src/sensitive.d.ts +4 -0
  256. package/dist/src/sensitive.js +258 -0
  257. package/dist/src/sensitive.js.map +1 -0
  258. package/dist/src/stats.d.ts +34 -0
  259. package/dist/src/stats.js +260 -0
  260. package/dist/src/stats.js.map +1 -0
  261. package/dist/src/store/conversation-store.d.ts +115 -0
  262. package/dist/src/store/conversation-store.js +447 -0
  263. package/dist/src/store/conversation-store.js.map +1 -0
  264. package/dist/src/store/fts5-sanitize.d.ts +23 -0
  265. package/dist/src/store/fts5-sanitize.js +30 -0
  266. package/dist/src/store/fts5-sanitize.js.map +1 -0
  267. package/dist/src/store/full-text-fallback.d.ts +16 -0
  268. package/dist/src/store/full-text-fallback.js +60 -0
  269. package/dist/src/store/full-text-fallback.js.map +1 -0
  270. package/dist/src/store/index.d.ts +4 -0
  271. package/dist/src/store/index.js +3 -0
  272. package/dist/src/store/index.js.map +1 -0
  273. package/dist/src/store/summary-store.d.ts +118 -0
  274. package/dist/src/store/summary-store.js +570 -0
  275. package/dist/src/store/summary-store.js.map +1 -0
  276. package/dist/src/summarize.d.ts +59 -0
  277. package/dist/src/summarize.js +619 -0
  278. package/dist/src/summarize.js.map +1 -0
  279. package/dist/src/transcript.d.ts +7 -0
  280. package/dist/src/transcript.js +51 -0
  281. package/dist/src/transcript.js.map +1 -0
  282. package/dist/src/types.d.ts +116 -0
  283. package/dist/src/types.js +8 -0
  284. package/dist/src/types.js.map +1 -0
  285. package/docs/agent-tools.md +187 -0
  286. package/docs/architecture.md +224 -0
  287. package/docs/configuration.md +168 -0
  288. package/docs/fts5.md +161 -0
  289. package/docs/hook-protocol.md +41 -0
  290. package/docs/privacy.md +101 -0
  291. package/mcp.mjs +17 -0
  292. package/package.json +79 -0
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: lcm-compact
3
+ description: Compact conversation messages into DAG summary nodes.
4
+ user_invocable: true
5
+ ---
6
+
7
+ # /lcm-compact
8
+
9
+ Compact unprocessed conversation messages into summarized DAG nodes.
10
+
11
+ ## Instructions
12
+
13
+ Run the following command via Bash:
14
+
15
+ ```bash
16
+ lcm compact --all
17
+ ```
18
+
19
+ ### Options
20
+
21
+ If the user specifies options, append them to the command:
22
+ - `--verbose` — Show per-conversation details
23
+ - `--dry-run` — Preview without writing
24
+
25
+ For example:
26
+ - `/lcm-compact --verbose` → `lcm compact --all --verbose`
27
+ - `/lcm-compact --dry-run` → `lcm compact --all --dry-run`
28
+
29
+ Display the output verbatim.
30
+
31
+ **Note:** `lcm compact` without `--all` falls through to hook dispatch (PreCompact). This command always uses the batch path with `--all`.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: lcm-curate
3
+ description: "Run the full memory curation pipeline: import, compact, and promote."
4
+ user_invocable: true
5
+ ---
6
+
7
+ # /lcm-curate
8
+
9
+ Run the full memory curation pipeline: import, compact, and promote.
10
+
11
+ ## Instructions
12
+
13
+ Run the following commands sequentially via Bash:
14
+
15
+ ```bash
16
+ lcm import --all && lcm compact --all && lcm promote
17
+ ```
18
+
19
+ ### Options
20
+
21
+ If the user specifies options, append them to all three commands:
22
+ - `--verbose` — Show per-step details
23
+ - `--dry-run` — Preview without writing
24
+
25
+ For example:
26
+ - `/lcm-curate --verbose` → `lcm import --all --verbose && lcm compact --all --verbose && lcm promote --verbose`
27
+ - `/lcm-curate --dry-run` → `lcm import --all --dry-run && lcm compact --all --dry-run && lcm promote --dry-run`
28
+
29
+ The pipeline stops on the first failure and reports the result.
30
+
31
+ Display the output verbatim.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: lcm-diagnose
3
+ description: Scan recent Claude Code session transcripts for hook failures, MCP disconnects, and stale lcm hook setup.
4
+ user_invocable: true
5
+ ---
6
+
7
+ # /lcm-diagnose
8
+
9
+ Inspect recent Claude Code transcripts for historical lcm issues.
10
+
11
+ ## Instructions
12
+
13
+ Run `lcm diagnose` via Bash and display the output verbatim.
14
+
15
+ If the user asks for a wider scan, use:
16
+ - `lcm diagnose --all`
17
+ - `lcm diagnose --all --days 30`
18
+ - `lcm diagnose --verbose`
19
+ - `lcm diagnose --json`
20
+
21
+ After showing the results, suggest the next troubleshooting step:
22
+ - `lcm doctor` for current install health
23
+ - `lcm import` if sessions were missed and need recovery
24
+
25
+ ## When to use
26
+
27
+ - After seeing hook errors in a Claude Code session
28
+ - When investigating missing sessions or gaps in ingestion
29
+ - During troubleshooting: `lcm doctor` for current state, `lcm diagnose` for history, `lcm import` for recovery
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: lcm-doctor
3
+ description: Run lossless-claude diagnostics — checks daemon, hooks, MCP server, and summarizer health.
4
+ user_invocable: true
5
+ ---
6
+
7
+ # /lcm-doctor
8
+
9
+ Run diagnostics on the lossless-claude installation.
10
+
11
+ ## Instructions
12
+
13
+ When invoked, call the `lcm_doctor` MCP tool (no arguments).
14
+
15
+ The tool returns pre-formatted markdown with status tables per section. Display the output verbatim — it is already formatted correctly.
16
+
17
+ If any check shows a failure icon, add a **Fix** section listing specific remediation steps for each failure.
18
+
19
+ End with one of:
20
+ - *All checks passed — lossless-claude is healthy.*
21
+ - *N check(s) need attention — see Fix section above.*
22
+
23
+ If `lcm_doctor` is unavailable, run `lcm doctor` via Bash and display the output verbatim.
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: lcm-dogfood
3
+ description: Run the lcm self-test suite — validates all CLI commands, hooks, MCP tools, and resilience across 39 checks in 10 phases.
4
+ user_invocable: true
5
+ ---
6
+
7
+ # lcm Dogfood — Live Self-Test Suite
8
+
9
+ Comprehensive self-test for the lcm system in a live Claude Code session. Covers all 9 CLI commands, 4 hooks, 8 MCP tools, and resilience scenarios across 39 checks in 10 phases.
10
+
11
+ **Arguments:** `all` (default), `health`, `import`, `compact`, `promote`, `sensitive`, `pipeline`, `hooks`, `mcp`, `resilience`, `debug`
12
+
13
+ ## Procedure
14
+
15
+ Execute each phase in order (or just the requested phase). For each check:
16
+
17
+ 1. Run the command or verify the condition
18
+ 2. Record: ✅ PASS, ❌ FAIL, or ⚠️ SKIP (with reason)
19
+ 3. On FAIL: capture error, check daemon logs (`~/.lossless-claude/daemon.log`), continue
20
+ 4. Produce the **Scorecard** at the end
21
+ 5. Write failures to `.xgh/reviews/dogfood-YYYY-MM-DD.md`
22
+
23
+ **Routing:** Use `ctx_execute` (context-mode sandbox) for commands producing large output. Use Bash for short-output commands. Use MCP tools directly for Phase 8.
24
+
25
+ Consult `references/checks.md` for detailed pass/fail criteria for each check.
26
+
27
+ ## Phase Overview
28
+
29
+ | # | Phase | Checks | What it tests |
30
+ |---|-------|--------|---------------|
31
+ | 1 | Health | 3 | Daemon status, doctor, version |
32
+ | 2 | Import | 3 | Transcript ingestion + idempotency |
33
+ | 3 | Compact | 3 | Summarization + idempotency |
34
+ | 4 | Promote | 2 | Insight extraction + stats consistency |
35
+ | 5 | Sensitive | 5 | Pattern list/test/add/remove cycle |
36
+ | 6 | Pipeline | 2 | Full curate + diagnose |
37
+ | 7 | Hooks | 6 | Wiring verification + live tests |
38
+ | 8 | MCP | 8 | All 7 MCP tools + store-retrieve roundtrip |
39
+ | 9 | Resilience | 3 | Kill/restart/graceful degradation |
40
+ | 10 | Debug | 4 | Logs, PWD, DB existence, integrity |
41
+
42
+ ## Key Commands
43
+
44
+ All CLI checks use `node dist/bin/lcm.js <subcommand>`. If `lcm` is on PATH, use that instead.
45
+
46
+ ### Hook Verification
47
+
48
+ Hooks are registered in `.claude-plugin/plugin.json`, NOT `~/.claude/settings.json`. Verify all 4:
49
+ - `SessionStart` → `lcm restore`
50
+ - `UserPromptSubmit` → `lcm user-prompt`
51
+ - `PreCompact` → `lcm compact`
52
+ - `SessionEnd` → `lcm session-end`
53
+
54
+ For live hook testing, pipe JSON to stdin:
55
+ ```bash
56
+ echo '{}' | node dist/bin/lcm.js restore
57
+ ```
58
+
59
+ The UserPromptSubmit hook requires `prompt` and `cwd` fields:
60
+ ```bash
61
+ node -e 'console.log(JSON.stringify({prompt:"test query",cwd:process.cwd()}))' | node dist/bin/lcm.js user-prompt
62
+ ```
63
+
64
+ ### MCP Tool Testing
65
+
66
+ Call lcm MCP tools directly from the session. All 8 tools to test:
67
+ `lcm_doctor`, `lcm_stats`, `lcm_search`, `lcm_grep`, `lcm_store`, `lcm_expand`, `lcm_describe` + store-retrieve roundtrip.
68
+
69
+ ## Scorecard Template
70
+
71
+ ```
72
+ | Phase | Checks | ✅ Pass | ❌ Fail | ⚠️ Skip/Known |
73
+ |-------------|--------|---------|---------|---------------|
74
+ | Health | 3 | | | |
75
+ | Import | 3 | | | |
76
+ | Compact | 3 | | | |
77
+ | Promote | 2 | | | |
78
+ | Sensitive | 5 | | | |
79
+ | Pipeline | 2 | | | |
80
+ | Hooks | 6 | | | |
81
+ | MCP | 8 | | | |
82
+ | Resilience | 3 | | | |
83
+ | Debug | 4 | | | |
84
+ | **TOTAL** | **39** | | | |
85
+ ```
86
+
87
+ For ❌ FAIL items, include: error message, daemon log excerpt, suggested fix.
88
+ For ⚠️ KNOWN items, reference the bug number from `.claude-plugin/skills/lcm-dogfood/references/known-issues.md`.
89
+
90
+ ## Bundled Resources
91
+
92
+ ### Scripts
93
+
94
+ Utility scripts for checks that require custom logic:
95
+ - **`.claude-plugin/skills/lcm-dogfood/scripts/prompt-search-test.js`** — Test the daemon `/prompt-search` endpoint directly. Usage: `node .claude-plugin/skills/lcm-dogfood/scripts/prompt-search-test.js "query" [cwd]`
96
+ - **`.claude-plugin/skills/lcm-dogfood/scripts/db-integrity.js`** — Check PRAGMA integrity_check on all project databases. Usage: `node .claude-plugin/skills/lcm-dogfood/scripts/db-integrity.js`
97
+
98
+ ### Reference Files
99
+
100
+ - **`references/checks.md`** — All 39 checks with detailed pass/fail criteria, organized by phase
101
+ - **`.claude-plugin/skills/lcm-dogfood/references/known-issues.md`** — Known bugs with root causes, affected checks, and fix status
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: lcm-import
3
+ description: Import Claude Code session transcripts into lcm memory
4
+ user_invocable: true
5
+ ---
6
+
7
+ # /lcm-import
8
+
9
+ Import Claude Code session transcripts into lcm memory.
10
+
11
+ ## Instructions
12
+
13
+ Run the following command via Bash:
14
+
15
+ ```bash
16
+ lcm import
17
+ ```
18
+
19
+ ### Options
20
+
21
+ If the user specifies options, append them to the command:
22
+ - `--all` — Import all projects (default when no path given)
23
+ - `--verbose` — Show per-session details
24
+ - `--dry-run` — Preview without writing
25
+
26
+ For example:
27
+ - `/lcm-import --all` → `lcm import --all`
28
+ - `/lcm-import --all --verbose` → `lcm import --all --verbose`
29
+ - `/lcm-import --dry-run` → `lcm import --dry-run`
30
+
31
+ Display the output verbatim.
32
+
33
+ After importing, suggest running `lcm compact --all` to summarize the imported sessions.
34
+
35
+ ## When to use
36
+
37
+ - After installing lcm for the first time (backfill existing sessions)
38
+ - After a session that failed to ingest (hook error, daemon down)
39
+ - To recover lost conversations
40
+ - After upgrading lcm (ensure all sessions are captured)
41
+
42
+ ## Commands
43
+
44
+ - `lcm import` — import current project's sessions
45
+ - `lcm import --all` — import all projects
46
+ - `lcm import --verbose` — show per-session details
47
+ - `lcm import --dry-run` — preview without writing
48
+ - `lcm compact --all` — summarize all uncompacted sessions (run after import)
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: lcm-promote
3
+ description: Promote durable insights from summaries into cross-session memory.
4
+ user_invocable: true
5
+ ---
6
+
7
+ # /lcm-promote
8
+
9
+ Promote durable insights from summaries into cross-session memory.
10
+
11
+ ## Instructions
12
+
13
+ Run the following command via Bash:
14
+
15
+ ```bash
16
+ lcm promote --all
17
+ ```
18
+
19
+ ### Options
20
+
21
+ If the user specifies options, append them to the command:
22
+ - `--verbose` — Show per-conversation details
23
+ - `--dry-run` — Preview without writing
24
+
25
+ For example:
26
+ - `/lcm-promote --verbose` → `lcm promote --all --verbose`
27
+ - `/lcm-promote --dry-run` → `lcm promote --all --dry-run`
28
+
29
+ Display the output verbatim.
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: lcm-sensitive
3
+ description: Manage sensitive patterns for lossless-claude secret redaction — list, add, remove, test, or purge patterns.
4
+ user_invocable: true
5
+ ---
6
+
7
+ # /lcm-sensitive
8
+
9
+ Manage the sensitive patterns used by lossless-claude to redact secrets before storing conversation messages.
10
+
11
+ ## Usage
12
+
13
+ ```
14
+ /lcm-sensitive list
15
+ /lcm-sensitive add <pattern>
16
+ /lcm-sensitive add --global <pattern>
17
+ /lcm-sensitive remove <pattern>
18
+ /lcm-sensitive test <text>
19
+ /lcm-sensitive purge [--all] --yes
20
+ ```
21
+
22
+ ## Instructions
23
+
24
+ Run the appropriate `lcm sensitive` subcommand via Bash based on the user's intent:
25
+
26
+ ```bash
27
+ lcm sensitive list
28
+ lcm sensitive add "MY_SECRET_TOKEN"
29
+ lcm sensitive add --global "SHARED_API_KEY"
30
+ lcm sensitive remove "OLD_PATTERN"
31
+ lcm sensitive test "some text containing MY_SECRET_TOKEN"
32
+ lcm sensitive purge --yes
33
+ lcm sensitive purge --all --yes
34
+ ```
35
+
36
+ ### Subcommands
37
+
38
+ - **list** — Show all active patterns: built-in, global, and project-specific
39
+ - **add `<pattern>`** — Add a regex pattern to the current project's sensitive patterns file
40
+ - **add --global `<pattern>`** — Add a pattern to the global config (applies to all projects)
41
+ - **remove `<pattern>`** — Remove a pattern from the project's sensitive patterns file
42
+ - **test `<text>`** — Test what gets redacted from the given text (shows `[REDACTED]` substitutions)
43
+ - **purge** — Delete the current project's data directory (`~/.lossless-claude/projects/{hash}/`) (requires `--yes`)
44
+ - **purge --all** — Delete all project data directories under `~/.lossless-claude/projects/` (requires `--yes`)
45
+
46
+ All `purge` variants require `--yes` to confirm the destructive action.
47
+
48
+ ### Pattern Guidelines
49
+
50
+ - Patterns are JavaScript-compatible regular expressions
51
+ - Prefer specific token patterns (e.g., `MY_APP_SECRET_[A-Z0-9]+`) over broad ones (e.g., `MY_APP.*`)
52
+ - Patterns containing spaces or `\s` are applied to full message text; others are applied per token
53
+ - Built-in patterns already cover common secrets: OpenAI keys, Anthropic keys, GitHub tokens, AWS keys, PEM keys, Bearer tokens, password assignments
54
+
55
+ Display the command output verbatim. If the command fails, show the error and suggest running `lcm doctor` to check installation health.
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: lcm-stats
3
+ description: Show lossless-claude memory inventory, compression ratios, and DAG statistics.
4
+ user_invocable: true
5
+ ---
6
+
7
+ # /lcm-stats
8
+
9
+ Show memory and compression statistics from lossless-claude.
10
+
11
+ ## Instructions
12
+
13
+ When invoked, call the `lcm_stats` MCP tool with `{"verbose": true}`.
14
+
15
+ The tool returns pre-formatted markdown with Memory and Compression tables. Display the output verbatim — it is already formatted correctly.
16
+
17
+ If `lcm_stats` is unavailable, run `lcm stats -v` via Bash and display the output verbatim.
18
+
19
+ Do not add commentary — just the stats output.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: lcm-status
3
+ description: Show daemon state and project memory statistics.
4
+ user_invocable: true
5
+ ---
6
+
7
+ # /lcm-status
8
+
9
+ Show daemon state and project memory statistics.
10
+
11
+ ## Instructions
12
+
13
+ Run the following command via Bash:
14
+
15
+ ```bash
16
+ lcm status
17
+ ```
18
+
19
+ ### Options
20
+
21
+ If the user specifies options, append them to the command:
22
+ - `--json` — Return output in JSON format
23
+
24
+ For example:
25
+ - `/lcm-status --json` → `lcm status --json`
26
+
27
+ Display the output verbatim.
@@ -0,0 +1,47 @@
1
+ # lossless-claude — Hooks
2
+
3
+ **Usage**: Lossless context management — every conversation is captured, compressed, and restored across sessions.
4
+
5
+ ## Hooks
6
+
7
+ All hooks auto-heal: each validates that all 4 hooks are registered in `settings.json` before executing. If any are missing, they're silently repaired.
8
+
9
+ | Hook | Command | What it does |
10
+ |------|---------|-------------|
11
+ | PreCompact | `lcm compact` | Intercepts compaction, runs LLM summarization into a DAG, returns the summary (exit 2 = replace native) |
12
+ | SessionStart | `lcm restore` | Restores project context + recent summaries + promoted memories from prior sessions |
13
+ | SessionEnd | `lcm session-end` | Ingests the session transcript into the database for future recall |
14
+ | UserPromptSubmit | `lcm user-prompt` | Searches promoted memory for relevant context, surfaces it as `<memory-context>` hints |
15
+
16
+ ## Lifecycle
17
+
18
+ ```
19
+ SessionStart ──→ conversation ──→ UserPromptSubmit (each turn)
20
+
21
+ PreCompact (if context fills)
22
+
23
+ SessionEnd (conversation exits)
24
+ ```
25
+
26
+ 1. **SessionStart**: daemon wakes, orientation + episodic + promoted context injected
27
+ 2. **UserPromptSubmit**: each user message triggers a background memory search — relevant context appears as hints
28
+ 3. **PreCompact**: when Claude's context window fills, lossless-claude intercepts and produces a DAG-based summary (nothing lost)
29
+ 4. **SessionEnd**: full transcript ingested into SQLite for future sessions
30
+
31
+ ## MCP Tools
32
+
33
+ Available alongside hooks for direct memory access:
34
+
35
+ ```
36
+ lcm_search # Search across episodic + promoted memory
37
+ lcm_grep # Regex/full-text search across messages + summaries
38
+ lcm_expand # Drill into a summary node for full detail
39
+ lcm_describe # Summary metadata (depth, tokens, parent/child)
40
+ lcm_store # Write to promoted knowledge store
41
+ lcm_stats # Compression ratios and usage statistics
42
+ lcm_doctor # Diagnostics — daemon, hooks, MCP, summarizer
43
+ ```
44
+
45
+ ## Why
46
+
47
+ Without lossless-claude, conversation history is lost when Claude compacts or when a session ends. With it, every message is preserved in a SQLite DAG, summaries are hierarchical (leaf → condensed → session → durable), and relevant context from past sessions surfaces automatically on each prompt.
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3
+ "name": "lossless-claude",
4
+ "owner": {
5
+ "name": "lossless-claude",
6
+ "url": "https://github.com/lossless-claude"
7
+ },
8
+ "plugins": [
9
+ {
10
+ "name": "lossless-claude",
11
+ "source": {
12
+ "source": "github",
13
+ "repo": "lossless-claude/lcm"
14
+ },
15
+ "description": "Lossless context management — DAG-based summarization that preserves every message",
16
+ "version": "0.1.0",
17
+ "strict": true
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ // MCP entrypoint for plugin system — delegates to the built lcm MCP server.
3
+ // Uses import.meta.url to resolve paths relative to this file, so it works
4
+ // regardless of how the plugin cache resolves ${CLAUDE_PLUGIN_ROOT}.
5
+ import { fileURLToPath } from "node:url";
6
+ import { join, dirname } from "node:path";
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const serverModule = join(__dirname, "dist", "src", "mcp", "server.js");
10
+
11
+ const { startMcpServer } = await import(serverModule);
12
+ await startMcpServer();
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "lossless-claude",
3
+ "version": "0.2.0",
4
+ "description": "Lossless context management — DAG-based summarization that preserves every message",
5
+ "author": {
6
+ "name": "Pedro Almeida",
7
+ "url": "https://github.com/ipedro"
8
+ },
9
+ "homepage": "https://lossless-claude.com",
10
+ "repository": "https://github.com/lossless-claude/lcm",
11
+ "license": "MIT",
12
+ "keywords": ["context", "memory", "compaction", "summarization", "lcm"],
13
+ "commands": "./.claude-plugin/commands/",
14
+ "mcpServers": {
15
+ "lcm": {
16
+ "command": "lcm",
17
+ "args": ["mcp"]
18
+ }
19
+ },
20
+ "hooks": {
21
+ "PreCompact": [
22
+ {
23
+ "matcher": "",
24
+ "hooks": [{ "type": "command", "command": "lcm compact" }]
25
+ }
26
+ ],
27
+ "SessionStart": [
28
+ {
29
+ "matcher": "",
30
+ "hooks": [{ "type": "command", "command": "lcm restore" }]
31
+ }
32
+ ],
33
+ "SessionEnd": [
34
+ {
35
+ "matcher": "",
36
+ "hooks": [{ "type": "command", "command": "lcm session-end" }]
37
+ }
38
+ ],
39
+ "UserPromptSubmit": [
40
+ {
41
+ "matcher": "",
42
+ "hooks": [{ "type": "command", "command": "lcm user-prompt" }]
43
+ }
44
+ ]
45
+ }
46
+ }
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: lcm-context
3
+ description: "Use when deciding which lcm MCP tool to call — lcm_search, lcm_grep, lcm_expand, lcm_describe, lcm_store, lcm_doctor, or lcm_stats — or when an lcm tool returns an error."
4
+ ---
5
+
6
+ # lcm Memory Tool Guide
7
+
8
+ Lossless-claude provides 7 MCP tools. This skill helps you pick the right one and recover from errors.
9
+
10
+ > **Hooks already inject memory at session start.** Do NOT re-query what was already injected. This skill is for active retrieval, storage, and error recovery — not session initialization.
11
+
12
+ ## Tool Decision Tree
13
+
14
+ ### Retrieval Tools (search → grep → expand)
15
+
16
+ These three tools **chain** from broad to deep:
17
+
18
+ 1. **lcm_search** — Broad concept recall across sessions
19
+ - Use: "how was auth implemented?", "what decisions were made about compaction?"
20
+ - Returns: ranked results from FTS5 + semantic layers
21
+ - Options: `tags` to filter, `layers` to scope (episodic/semantic)
22
+
23
+ 2. **lcm_grep** — Exact keyword/regex in raw transcripts
24
+ - Use: "JWT", "socket.unref", specific error messages
25
+ - Returns: matching messages/summaries with context
26
+ - Options: `scope` (messages/summaries/all), `since` date filter
27
+
28
+ 3. **lcm_expand** — Drill into a compressed summary node
29
+ - Use: when a search/grep result references a summary nodeId and you need the full content
30
+ - Returns: decompressed source content from the DAG
31
+ - Options: `depth` to control traversal levels
32
+
33
+ **Chaining pattern:** Start with `lcm_search` for broad recall → use `lcm_grep` to find exact references → use `lcm_expand` to decompress interesting nodes.
34
+
35
+ ### Inspection Tool
36
+
37
+ 4. **lcm_describe** — Check a node's metadata without loading content
38
+ - Use: when a nodeId came from grep and you don't know if it's worth expanding. Saves tokens if the node is stale, shallow, or unrelated.
39
+ - Returns: depth, token count, parent/child links, promotion status
40
+
41
+ ### Storage Tool
42
+
43
+ 5. **lcm_store** — Persist a decision or finding for future sessions
44
+ - Use: architectural decisions, bug root causes, user preferences, integration patterns
45
+ - Options: `tags` for categorization, `metadata` for project/session context
46
+
47
+ ### Operational Tools
48
+
49
+ 6. **lcm_doctor** — Check system health (daemon, hooks, MCP, summarizer)
50
+ 7. **lcm_stats** — View compression ratios and token savings
51
+
52
+ ## When to Use / When NOT to Use
53
+
54
+ ### Retrieval
55
+ **Use when:**
56
+ - You need context that wasn't in the hook-injected summary
57
+ - You're looking for a specific past decision or conversation
58
+ - A summary node looks relevant but needs more detail
59
+
60
+ **Do NOT use when:**
61
+ - The information is already in your current context (hook injected it)
62
+ - You're looking for general knowledge, not project memory
63
+ - You can answer from code/git alone
64
+
65
+ ### Storage
66
+ **Use when:**
67
+ - An architectural decision was made with rationale worth preserving
68
+ - A bug root cause was identified (the "why", not just the fix)
69
+ - User expressed a preference or feedback that affects future work
70
+ - A non-obvious integration pattern was discovered
71
+
72
+ **Do NOT use when:**
73
+ - The information is already in git (code, commit messages)
74
+ - It's a transient debugging step or ephemeral task detail
75
+ - It's already documented in CLAUDE.md or memory files
76
+ - It's general knowledge, not project-specific
77
+
78
+ ## Error Self-Healing
79
+
80
+ ### Agent-Fixable (handle automatically)
81
+
82
+ | Error | Recovery |
83
+ |---|---|
84
+ | Daemon not running | Run `lcm start` via Bash, then retry |
85
+ | "No results" from search | Try `lcm_grep` with different keywords, or broaden the query |
86
+ | Node not found on expand | Use `lcm_search` to find the correct nodeId |
87
+ | Store succeeds but daemon restarted before SessionEnd | Call `lcm_doctor` to verify persistence; re-store if the node is missing |
88
+
89
+ ### User Action Required (surface to user)
90
+
91
+ | Error | What to tell the user |
92
+ |---|---|
93
+ | MCP server disconnected | Restart the session, then run `/lcm-diagnose` to audit for gaps |
94
+ | Hooks not firing | Call `lcm_doctor` to confirm; if hooks are missing, tell user to run `lcm install` |
95
+ | Summarizer failing | Tell user to run `/lcm-doctor` for full diagnostics |
96
+
97
+ ## Quick Reference
98
+
99
+ ```
100
+ lcm_search → broad concept recall (FTS5 + semantic)
101
+ lcm_grep → exact keyword/regex match
102
+ lcm_expand → decompress a summary node
103
+ lcm_describe → inspect node metadata (check before expanding)
104
+ lcm_store → persist decisions/findings
105
+ lcm_doctor → health check
106
+ lcm_stats → compression metrics
107
+ ```