@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.
- package/.claude-plugin/commands/lcm-compact.md +31 -0
- package/.claude-plugin/commands/lcm-curate.md +31 -0
- package/.claude-plugin/commands/lcm-diagnose.md +29 -0
- package/.claude-plugin/commands/lcm-doctor.md +23 -0
- package/.claude-plugin/commands/lcm-dogfood.md +101 -0
- package/.claude-plugin/commands/lcm-import.md +48 -0
- package/.claude-plugin/commands/lcm-promote.md +29 -0
- package/.claude-plugin/commands/lcm-sensitive.md +55 -0
- package/.claude-plugin/commands/lcm-stats.md +19 -0
- package/.claude-plugin/commands/lcm-status.md +27 -0
- package/.claude-plugin/hooks/README.md +47 -0
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/mcp.mjs +12 -0
- package/.claude-plugin/plugin.json +46 -0
- package/.claude-plugin/skills/lcm-context/SKILL.md +107 -0
- package/.claude-plugin/skills/lcm-dogfood/SKILL.md +102 -0
- package/.claude-plugin/skills/lcm-dogfood/references/checks.md +239 -0
- package/.claude-plugin/skills/lcm-dogfood/references/known-issues.md +11 -0
- package/.claude-plugin/skills/lcm-dogfood/scripts/db-integrity.js +40 -0
- package/.claude-plugin/skills/lcm-dogfood/scripts/prompt-search-test.js +35 -0
- package/.claude-plugin/skills/lcm-e2e/SKILL.md +61 -0
- package/.claude-plugin/skills/lcm-e2e/checklist.md +367 -0
- package/.claude-plugin/skills/lossless-claude-upgrade/SKILL.md +47 -0
- package/LICENSE +21 -0
- package/README.md +231 -0
- package/dist/bin/lcm.d.ts +2 -0
- package/dist/bin/lcm.js +461 -0
- package/dist/bin/lcm.js.map +1 -0
- package/dist/installer/dry-run-deps.d.ts +23 -0
- package/dist/installer/dry-run-deps.js +66 -0
- package/dist/installer/dry-run-deps.js.map +1 -0
- package/dist/installer/install.d.ts +39 -0
- package/dist/installer/install.js +236 -0
- package/dist/installer/install.js.map +1 -0
- package/dist/installer/uninstall.d.ts +11 -0
- package/dist/installer/uninstall.js +80 -0
- package/dist/installer/uninstall.js.map +1 -0
- package/dist/src/batch-compact.d.ts +16 -0
- package/dist/src/batch-compact.js +121 -0
- package/dist/src/batch-compact.js.map +1 -0
- package/dist/src/compaction.d.ts +198 -0
- package/dist/src/compaction.js +964 -0
- package/dist/src/compaction.js.map +1 -0
- package/dist/src/connectors/constants.d.ts +5 -0
- package/dist/src/connectors/constants.js +6 -0
- package/dist/src/connectors/constants.js.map +1 -0
- package/dist/src/connectors/installer.d.ts +16 -0
- package/dist/src/connectors/installer.js +200 -0
- package/dist/src/connectors/installer.js.map +1 -0
- package/dist/src/connectors/registry.d.ts +4 -0
- package/dist/src/connectors/registry.js +264 -0
- package/dist/src/connectors/registry.js.map +1 -0
- package/dist/src/connectors/template-service.d.ts +5 -0
- package/dist/src/connectors/template-service.js +54 -0
- package/dist/src/connectors/template-service.js.map +1 -0
- package/dist/src/connectors/templates/base.md +1 -0
- package/dist/src/connectors/templates/mcp-base.md +1 -0
- package/dist/src/connectors/templates/sections/command-reference.md +15 -0
- package/dist/src/connectors/templates/sections/mcp-workflow.md +18 -0
- package/dist/src/connectors/templates/sections/workflow.md +29 -0
- package/dist/src/connectors/templates/skill/SKILL.md +74 -0
- package/dist/src/connectors/types.d.ts +19 -0
- package/dist/src/connectors/types.js +10 -0
- package/dist/src/connectors/types.js.map +1 -0
- package/dist/src/daemon/client.d.ts +9 -0
- package/dist/src/daemon/client.js +28 -0
- package/dist/src/daemon/client.js.map +1 -0
- package/dist/src/daemon/config.d.ts +48 -0
- package/dist/src/daemon/config.js +67 -0
- package/dist/src/daemon/config.js.map +1 -0
- package/dist/src/daemon/lifecycle.d.ts +19 -0
- package/dist/src/daemon/lifecycle.js +102 -0
- package/dist/src/daemon/lifecycle.js.map +1 -0
- package/dist/src/daemon/orientation.d.ts +1 -0
- package/dist/src/daemon/orientation.js +9 -0
- package/dist/src/daemon/orientation.js.map +1 -0
- package/dist/src/daemon/project-queue.d.ts +1 -0
- package/dist/src/daemon/project-queue.js +17 -0
- package/dist/src/daemon/project-queue.js.map +1 -0
- package/dist/src/daemon/project.d.ts +7 -0
- package/dist/src/daemon/project.js +25 -0
- package/dist/src/daemon/project.js.map +1 -0
- package/dist/src/daemon/proxy-manager.d.ts +21 -0
- package/dist/src/daemon/proxy-manager.js +205 -0
- package/dist/src/daemon/proxy-manager.js.map +1 -0
- package/dist/src/daemon/routes/compact.d.ts +13 -0
- package/dist/src/daemon/routes/compact.js +195 -0
- package/dist/src/daemon/routes/compact.js.map +1 -0
- package/dist/src/daemon/routes/describe.d.ts +3 -0
- package/dist/src/daemon/routes/describe.js +39 -0
- package/dist/src/daemon/routes/describe.js.map +1 -0
- package/dist/src/daemon/routes/expand.d.ts +3 -0
- package/dist/src/daemon/routes/expand.js +41 -0
- package/dist/src/daemon/routes/expand.js.map +1 -0
- package/dist/src/daemon/routes/grep.d.ts +3 -0
- package/dist/src/daemon/routes/grep.js +43 -0
- package/dist/src/daemon/routes/grep.js.map +1 -0
- package/dist/src/daemon/routes/ingest.d.ts +3 -0
- package/dist/src/daemon/routes/ingest.js +101 -0
- package/dist/src/daemon/routes/ingest.js.map +1 -0
- package/dist/src/daemon/routes/promote.d.ts +4 -0
- package/dist/src/daemon/routes/promote.js +104 -0
- package/dist/src/daemon/routes/promote.js.map +1 -0
- package/dist/src/daemon/routes/prompt-search.d.ts +3 -0
- package/dist/src/daemon/routes/prompt-search.js +65 -0
- package/dist/src/daemon/routes/prompt-search.js.map +1 -0
- package/dist/src/daemon/routes/recent.d.ts +3 -0
- package/dist/src/daemon/routes/recent.js +37 -0
- package/dist/src/daemon/routes/recent.js.map +1 -0
- package/dist/src/daemon/routes/restore.d.ts +3 -0
- package/dist/src/daemon/routes/restore.js +120 -0
- package/dist/src/daemon/routes/restore.js.map +1 -0
- package/dist/src/daemon/routes/search.d.ts +2 -0
- package/dist/src/daemon/routes/search.js +66 -0
- package/dist/src/daemon/routes/search.js.map +1 -0
- package/dist/src/daemon/routes/status.d.ts +3 -0
- package/dist/src/daemon/routes/status.js +80 -0
- package/dist/src/daemon/routes/status.js.map +1 -0
- package/dist/src/daemon/routes/store.d.ts +2 -0
- package/dist/src/daemon/routes/store.js +46 -0
- package/dist/src/daemon/routes/store.js.map +1 -0
- package/dist/src/daemon/server.d.ts +19 -0
- package/dist/src/daemon/server.js +183 -0
- package/dist/src/daemon/server.js.map +1 -0
- package/dist/src/daemon/summarizer.d.ts +11 -0
- package/dist/src/daemon/summarizer.js +51 -0
- package/dist/src/daemon/summarizer.js.map +1 -0
- package/dist/src/db/config.d.ts +31 -0
- package/dist/src/db/config.js +83 -0
- package/dist/src/db/config.js.map +1 -0
- package/dist/src/db/connection.d.ts +3 -0
- package/dist/src/db/connection.js +62 -0
- package/dist/src/db/connection.js.map +1 -0
- package/dist/src/db/features.d.ts +11 -0
- package/dist/src/db/features.js +36 -0
- package/dist/src/db/features.js.map +1 -0
- package/dist/src/db/migration.d.ts +4 -0
- package/dist/src/db/migration.js +499 -0
- package/dist/src/db/migration.js.map +1 -0
- package/dist/src/db/promoted.d.ts +47 -0
- package/dist/src/db/promoted.js +96 -0
- package/dist/src/db/promoted.js.map +1 -0
- package/dist/src/db/redaction-stats.d.ts +6 -0
- package/dist/src/db/redaction-stats.js +16 -0
- package/dist/src/db/redaction-stats.js.map +1 -0
- package/dist/src/diagnose.d.ts +39 -0
- package/dist/src/diagnose.js +432 -0
- package/dist/src/diagnose.js.map +1 -0
- package/dist/src/doctor/doctor.d.ts +4 -0
- package/dist/src/doctor/doctor.js +378 -0
- package/dist/src/doctor/doctor.js.map +1 -0
- package/dist/src/doctor/types.d.ts +24 -0
- package/dist/src/doctor/types.js +2 -0
- package/dist/src/doctor/types.js.map +1 -0
- package/dist/src/expansion.d.ts +100 -0
- package/dist/src/expansion.js +268 -0
- package/dist/src/expansion.js.map +1 -0
- package/dist/src/hooks/auto-heal.d.ts +12 -0
- package/dist/src/hooks/auto-heal.js +49 -0
- package/dist/src/hooks/auto-heal.js.map +1 -0
- package/dist/src/hooks/compact.d.ts +5 -0
- package/dist/src/hooks/compact.js +22 -0
- package/dist/src/hooks/compact.js.map +1 -0
- package/dist/src/hooks/dispatch.d.ts +7 -0
- package/dist/src/hooks/dispatch.js +36 -0
- package/dist/src/hooks/dispatch.js.map +1 -0
- package/dist/src/hooks/probe-precompact.d.ts +2 -0
- package/dist/src/hooks/probe-precompact.js +17 -0
- package/dist/src/hooks/probe-precompact.js.map +1 -0
- package/dist/src/hooks/probe-sessionstart.d.ts +2 -0
- package/dist/src/hooks/probe-sessionstart.js +18 -0
- package/dist/src/hooks/probe-sessionstart.js.map +1 -0
- package/dist/src/hooks/restore.d.ts +5 -0
- package/dist/src/hooks/restore.js +19 -0
- package/dist/src/hooks/restore.js.map +1 -0
- package/dist/src/hooks/session-end.d.ts +16 -0
- package/dist/src/hooks/session-end.js +73 -0
- package/dist/src/hooks/session-end.js.map +1 -0
- package/dist/src/hooks/user-prompt.d.ts +5 -0
- package/dist/src/hooks/user-prompt.js +31 -0
- package/dist/src/hooks/user-prompt.js.map +1 -0
- package/dist/src/import.d.ts +24 -0
- package/dist/src/import.js +119 -0
- package/dist/src/import.js.map +1 -0
- package/dist/src/large-files.d.ts +28 -0
- package/dist/src/large-files.js +413 -0
- package/dist/src/large-files.js.map +1 -0
- package/dist/src/llm/anthropic.d.ts +9 -0
- package/dist/src/llm/anthropic.js +54 -0
- package/dist/src/llm/anthropic.js.map +1 -0
- package/dist/src/llm/claude-process.d.ts +2 -0
- package/dist/src/llm/claude-process.js +55 -0
- package/dist/src/llm/claude-process.js.map +1 -0
- package/dist/src/llm/codex-process.d.ts +15 -0
- package/dist/src/llm/codex-process.js +142 -0
- package/dist/src/llm/codex-process.js.map +1 -0
- package/dist/src/llm/mock-summarizer.d.ts +9 -0
- package/dist/src/llm/mock-summarizer.js +17 -0
- package/dist/src/llm/mock-summarizer.js.map +1 -0
- package/dist/src/llm/openai.d.ts +10 -0
- package/dist/src/llm/openai.js +52 -0
- package/dist/src/llm/openai.js.map +1 -0
- package/dist/src/llm/types.d.ts +6 -0
- package/dist/src/llm/types.js +2 -0
- package/dist/src/llm/types.js.map +1 -0
- package/dist/src/mcp/server.d.ts +9 -0
- package/dist/src/mcp/server.js +128 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/tools/lcm-describe.d.ts +14 -0
- package/dist/src/mcp/tools/lcm-describe.js +12 -0
- package/dist/src/mcp/tools/lcm-describe.js.map +1 -0
- package/dist/src/mcp/tools/lcm-doctor.d.ts +8 -0
- package/dist/src/mcp/tools/lcm-doctor.js +9 -0
- package/dist/src/mcp/tools/lcm-doctor.js.map +1 -0
- package/dist/src/mcp/tools/lcm-expand.d.ts +18 -0
- package/dist/src/mcp/tools/lcm-expand.js +13 -0
- package/dist/src/mcp/tools/lcm-expand.js.map +1 -0
- package/dist/src/mcp/tools/lcm-grep.d.ts +27 -0
- package/dist/src/mcp/tools/lcm-grep.js +15 -0
- package/dist/src/mcp/tools/lcm-grep.js.map +1 -0
- package/dist/src/mcp/tools/lcm-search.d.ts +33 -0
- package/dist/src/mcp/tools/lcm-search.js +15 -0
- package/dist/src/mcp/tools/lcm-search.js.map +1 -0
- package/dist/src/mcp/tools/lcm-stats.d.ts +14 -0
- package/dist/src/mcp/tools/lcm-stats.js +11 -0
- package/dist/src/mcp/tools/lcm-stats.js.map +1 -0
- package/dist/src/mcp/tools/lcm-store.d.ts +26 -0
- package/dist/src/mcp/tools/lcm-store.js +22 -0
- package/dist/src/mcp/tools/lcm-store.js.map +1 -0
- package/dist/src/memory/index.d.ts +22 -0
- package/dist/src/memory/index.js +21 -0
- package/dist/src/memory/index.js.map +1 -0
- package/dist/src/promotion/dedup.d.ts +19 -0
- package/dist/src/promotion/dedup.js +42 -0
- package/dist/src/promotion/dedup.js.map +1 -0
- package/dist/src/promotion/detector.d.ts +15 -0
- package/dist/src/promotion/detector.js +31 -0
- package/dist/src/promotion/detector.js.map +1 -0
- package/dist/src/prompts/condensed-d1.yaml +38 -0
- package/dist/src/prompts/condensed-d2.yaml +32 -0
- package/dist/src/prompts/condensed-d3plus.yaml +32 -0
- package/dist/src/prompts/leaf-aggressive.yaml +34 -0
- package/dist/src/prompts/leaf-normal.yaml +34 -0
- package/dist/src/prompts/loader.d.ts +9 -0
- package/dist/src/prompts/loader.js +37 -0
- package/dist/src/prompts/loader.js.map +1 -0
- package/dist/src/prompts/promoted-merge.yaml +18 -0
- package/dist/src/prompts/system.yaml +5 -0
- package/dist/src/retrieval.d.ts +122 -0
- package/dist/src/retrieval.js +214 -0
- package/dist/src/retrieval.js.map +1 -0
- package/dist/src/scrub.d.ts +46 -0
- package/dist/src/scrub.js +184 -0
- package/dist/src/scrub.js.map +1 -0
- package/dist/src/sensitive.d.ts +4 -0
- package/dist/src/sensitive.js +258 -0
- package/dist/src/sensitive.js.map +1 -0
- package/dist/src/stats.d.ts +34 -0
- package/dist/src/stats.js +260 -0
- package/dist/src/stats.js.map +1 -0
- package/dist/src/store/conversation-store.d.ts +115 -0
- package/dist/src/store/conversation-store.js +447 -0
- package/dist/src/store/conversation-store.js.map +1 -0
- package/dist/src/store/fts5-sanitize.d.ts +23 -0
- package/dist/src/store/fts5-sanitize.js +30 -0
- package/dist/src/store/fts5-sanitize.js.map +1 -0
- package/dist/src/store/full-text-fallback.d.ts +16 -0
- package/dist/src/store/full-text-fallback.js +60 -0
- package/dist/src/store/full-text-fallback.js.map +1 -0
- package/dist/src/store/index.d.ts +4 -0
- package/dist/src/store/index.js +3 -0
- package/dist/src/store/index.js.map +1 -0
- package/dist/src/store/summary-store.d.ts +118 -0
- package/dist/src/store/summary-store.js +570 -0
- package/dist/src/store/summary-store.js.map +1 -0
- package/dist/src/summarize.d.ts +59 -0
- package/dist/src/summarize.js +619 -0
- package/dist/src/summarize.js.map +1 -0
- package/dist/src/transcript.d.ts +7 -0
- package/dist/src/transcript.js +51 -0
- package/dist/src/transcript.js.map +1 -0
- package/dist/src/types.d.ts +116 -0
- package/dist/src/types.js +8 -0
- package/dist/src/types.js.map +1 -0
- package/docs/agent-tools.md +187 -0
- package/docs/architecture.md +224 -0
- package/docs/configuration.md +168 -0
- package/docs/fts5.md +161 -0
- package/docs/hook-protocol.md +41 -0
- package/docs/privacy.md +101 -0
- package/mcp.mjs +17 -0
- 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
|
+
```
|