@lh8ppl/claude-memory-kit 0.1.0 → 0.1.1

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 (38) hide show
  1. package/README.md +77 -0
  2. package/bin/cmk-auto-extract.mjs +62 -0
  3. package/bin/cmk-capture-prompt.mjs +65 -0
  4. package/bin/cmk-capture-turn.mjs +76 -0
  5. package/bin/cmk-compress-lazy.mjs +0 -0
  6. package/bin/cmk-compress-session.mjs +64 -0
  7. package/bin/cmk-daily-distill.mjs +0 -0
  8. package/bin/cmk-inject-context.mjs +69 -0
  9. package/bin/cmk-observe-edit.mjs +57 -0
  10. package/bin/cmk-weekly-curate.mjs +0 -0
  11. package/bin/cmk.mjs +11 -11
  12. package/package.json +10 -2
  13. package/src/audit-log.mjs +1 -0
  14. package/src/claude-md.mjs +212 -212
  15. package/src/doctor.mjs +16 -5
  16. package/src/frontmatter.mjs +73 -73
  17. package/src/install.mjs +49 -1
  18. package/src/merge-facts.mjs +213 -213
  19. package/src/provenance.mjs +217 -217
  20. package/src/reindex.mjs +134 -134
  21. package/src/repair.mjs +26 -96
  22. package/src/settings-hooks.mjs +186 -0
  23. package/src/subcommands.mjs +13 -2
  24. package/template/.gitignore.fragment +12 -12
  25. package/template/CLAUDE.md.template +49 -49
  26. package/template/docs/journey/journey-log.md.template +292 -292
  27. package/template/project/memory/INDEX.md.template +47 -47
  28. package/template/support/cron-jobs/daily-memory-distill.md +15 -15
  29. package/template/support/cron-jobs/nightly-memsearch-index.md +17 -17
  30. package/template/support/cron-jobs/weekly-memory-curator.md +15 -15
  31. package/template/support/milvus-deploy/README.md +57 -57
  32. package/template/support/milvus-deploy/docker-compose.yml +66 -66
  33. package/template/support/scripts/auto-extract-memory.sh +102 -102
  34. package/template/support/scripts/memsearch-index-with-flush.sh +59 -59
  35. package/template/support/scripts/refresh-distill-timestamp.py +35 -35
  36. package/template/support/scripts/register-crons.py +242 -242
  37. package/template/support/scripts/run-daily-distill.sh +67 -67
  38. package/template/support/scripts/run-weekly-curate.sh +58 -58
@@ -1,12 +1,12 @@
1
- # claude-memory-kit — added by `cmk install`. Do not edit by hand;
2
- # `cmk install` refreshes these lines idempotently. Remove via
3
- # `cmk uninstall`.
4
-
5
- # Local-tier (per-machine, never committed)
6
- context.local/
7
-
8
- # SQLite + FTS5 read cache (regenerable from markdown)
9
- context/.index/
10
-
11
- # Run-time locks + transient state
12
- context/.locks/
1
+ # claude-memory-kit — added by `cmk install`. Do not edit by hand;
2
+ # `cmk install` refreshes these lines idempotently. Remove via
3
+ # `cmk uninstall`.
4
+
5
+ # Local-tier (per-machine, never committed)
6
+ context.local/
7
+
8
+ # SQLite + FTS5 read cache (regenerable from markdown)
9
+ context/.index/
10
+
11
+ # Run-time locks + transient state
12
+ context/.locks/
@@ -1,49 +1,49 @@
1
- ## Memory System — claude-memory-kit
2
-
3
- This project uses **claude-memory-kit** for per-project, in-repo memory that survives session boundaries. Memory lives in `context/` (committed) and `context.local/` (gitignored). Cross-project memory lives at `~/.claude-memory-kit/` (or `$MEMORY_KIT_USER_DIR`).
4
-
5
- > v0.1.0 is under active development. This block is the runtime contract. Specific mechanisms (auto-extract, memory-write skill, MCP search) come online incrementally — `cmk doctor` will tell you which layers are active in the current install. Full architecture: <https://github.com/LH8PPL/claude-memory-kit/blob/main/docs/journey/v0.1.0-build-log.md>
6
-
7
- ### Where memory lives
8
-
9
- | Tier | Path | Travels with `git clone`? |
10
- | --- | --- | --- |
11
- | **User** | `~/.claude-memory-kit/` | No — machine-local, cross-project |
12
- | **Project** | `<repo>/context/` | **Yes** — committed |
13
- | **Local** | `<repo>/context.local/` | No — gitignored, per-machine |
14
-
15
- Precedence at session start: local > project > user (most-specific wins, others are logged as shadowed).
16
-
17
- ### How memory works
18
-
19
- - **Session start** — the kit injects a frozen snapshot (≤10 KB) from the three tiers into Claude's context. Loaded once, never mutated mid-session — preserves the prefix cache.
20
- - **During the session** — durable facts get captured automatically by the Stop hook + `memory-write` skill (once Layer 4 is live). The user can also explicitly say "remember this", "from now on", "we decided X".
21
- - **End of session** — the rolling-window pipeline compresses `sessions/now.md` into a daily summary. Cron jobs distill into `recent.md` and `archive.md` over time (Layer 6, optional).
22
-
23
- ### Health checks (when `cmk doctor` is live)
24
-
25
- Health checks (HC-1..HC-8) verify each layer is wired correctly: install integrity, hook registration, transcript capture freshness, INDEX accuracy, cron registration, semantic search backend, native Auto Memory coexistence. See [`docs/adr/`](docs/adr/) and [`specs/v0.1.0/design.md`](specs/v0.1.0/design.md) for the full contract.
26
-
27
- ### Memory write rules (for Claude)
28
-
29
- When you learn something durable about this project or the user:
30
-
31
- 1. **Working state** (current threads, today's environment, open decisions) → write to `context/MEMORY.md` (≤2,500 chars). Consolidate at the cap.
32
- 2. **Typed durable fact** (user role / project decision / feedback / external reference) → create `context/memory/<type>_<slug>.md` with full YAML frontmatter; add a one-line entry to `context/memory/INDEX.md`.
33
- 3. **Cross-project lesson** → user-tier `~/.claude-memory-kit/LESSONS.md` (via `cmk lessons promote`).
34
- 4. **Never duplicate** between scratchpad and granular archive. If a working-state item becomes durable, MOVE it.
35
- 5. **Confirm silently.** Frozen-snapshot semantics mean the write takes effect next session.
36
-
37
- ### Privacy
38
-
39
- Anything inside `<private>...</private>` tags in a user prompt is stripped before any disk write — never persisted in any form. Per-fact `private: true` frontmatter excludes a fact from the session-start digest.
40
-
41
- ### Uninstall / remove this block
42
-
43
- This block is managed by `cmk install`. To remove it cleanly:
44
-
45
- ```bash
46
- cmk uninstall
47
- ```
48
-
49
- Everything outside the `claude-memory-kit:start` / `:end` markers is byte-preserved.
1
+ ## Memory System — claude-memory-kit
2
+
3
+ This project uses **claude-memory-kit** for per-project, in-repo memory that survives session boundaries. Memory lives in `context/` (committed) and `context.local/` (gitignored). Cross-project memory lives at `~/.claude-memory-kit/` (or `$MEMORY_KIT_USER_DIR`).
4
+
5
+ > v0.1.0 is under active development. This block is the runtime contract. Specific mechanisms (auto-extract, memory-write skill, MCP search) come online incrementally — `cmk doctor` will tell you which layers are active in the current install. Full architecture: <https://github.com/LH8PPL/claude-memory-kit/blob/main/docs/journey/v0.1.0-build-log.md>
6
+
7
+ ### Where memory lives
8
+
9
+ | Tier | Path | Travels with `git clone`? |
10
+ | --- | --- | --- |
11
+ | **User** | `~/.claude-memory-kit/` | No — machine-local, cross-project |
12
+ | **Project** | `<repo>/context/` | **Yes** — committed |
13
+ | **Local** | `<repo>/context.local/` | No — gitignored, per-machine |
14
+
15
+ Precedence at session start: local > project > user (most-specific wins, others are logged as shadowed).
16
+
17
+ ### How memory works
18
+
19
+ - **Session start** — the kit injects a frozen snapshot (≤10 KB) from the three tiers into Claude's context. Loaded once, never mutated mid-session — preserves the prefix cache.
20
+ - **During the session** — durable facts get captured automatically by the Stop hook + `memory-write` skill (once Layer 4 is live). The user can also explicitly say "remember this", "from now on", "we decided X".
21
+ - **End of session** — the rolling-window pipeline compresses `sessions/now.md` into a daily summary. Cron jobs distill into `recent.md` and `archive.md` over time (Layer 6, optional).
22
+
23
+ ### Health checks (when `cmk doctor` is live)
24
+
25
+ Health checks (HC-1..HC-8) verify each layer is wired correctly: install integrity, hook registration, transcript capture freshness, INDEX accuracy, cron registration, semantic search backend, native Auto Memory coexistence. See [`docs/adr/`](docs/adr/) and [`specs/v0.1.0/design.md`](specs/v0.1.0/design.md) for the full contract.
26
+
27
+ ### Memory write rules (for Claude)
28
+
29
+ When you learn something durable about this project or the user:
30
+
31
+ 1. **Working state** (current threads, today's environment, open decisions) → write to `context/MEMORY.md` (≤2,500 chars). Consolidate at the cap.
32
+ 2. **Typed durable fact** (user role / project decision / feedback / external reference) → create `context/memory/<type>_<slug>.md` with full YAML frontmatter; add a one-line entry to `context/memory/INDEX.md`.
33
+ 3. **Cross-project lesson** → user-tier `~/.claude-memory-kit/LESSONS.md` (via `cmk lessons promote`).
34
+ 4. **Never duplicate** between scratchpad and granular archive. If a working-state item becomes durable, MOVE it.
35
+ 5. **Confirm silently.** Frozen-snapshot semantics mean the write takes effect next session.
36
+
37
+ ### Privacy
38
+
39
+ Anything inside `<private>...</private>` tags in a user prompt is stripped before any disk write — never persisted in any form. Per-fact `private: true` frontmatter excludes a fact from the session-start digest.
40
+
41
+ ### Uninstall / remove this block
42
+
43
+ This block is managed by `cmk install`. To remove it cleanly:
44
+
45
+ ```bash
46
+ cmk uninstall
47
+ ```
48
+
49
+ Everything outside the `claude-memory-kit:start` / `:end` markers is byte-preserved.