hmem-mcp 7.4.0 → 8.0.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 (315) hide show
  1. package/README.md +266 -54
  2. package/dist/cli-checkpoint-agent.d.ts +27 -0
  3. package/dist/cli-checkpoint-agent.js +320 -0
  4. package/dist/cli-checkpoint-agent.js.map +1 -0
  5. package/dist/cli-checkpoint.js +165 -78
  6. package/dist/cli-checkpoint.js.map +1 -1
  7. package/dist/cli-context-inject.d.ts +7 -7
  8. package/dist/cli-context-inject.js +54 -41
  9. package/dist/cli-context-inject.js.map +1 -1
  10. package/dist/cli-doctor.d.ts +7 -0
  11. package/dist/cli-doctor.js +156 -0
  12. package/dist/cli-doctor.js.map +1 -0
  13. package/dist/cli-hook-startup.d.ts +1 -0
  14. package/dist/cli-hook-startup.js +97 -10
  15. package/dist/cli-hook-startup.js.map +1 -1
  16. package/dist/cli-init.d.ts +0 -4
  17. package/dist/cli-init.js +48 -6
  18. package/dist/cli-init.js.map +1 -1
  19. package/dist/cli-log-exchange.js +10 -2
  20. package/dist/cli-log-exchange.js.map +1 -1
  21. package/dist/cli-mcp-add-curate.d.ts +7 -0
  22. package/dist/cli-mcp-add-curate.js +40 -0
  23. package/dist/cli-mcp-add-curate.js.map +1 -0
  24. package/dist/cli-migrate.d.ts +57 -0
  25. package/dist/cli-migrate.js +394 -0
  26. package/dist/cli-migrate.js.map +1 -0
  27. package/dist/cli-session-summary.d.ts +1 -1
  28. package/dist/cli-session-summary.js +9 -54
  29. package/dist/cli-session-summary.js.map +1 -1
  30. package/dist/cli-statusline.js +15 -11
  31. package/dist/cli-statusline.js.map +1 -1
  32. package/dist/cli-sync-pull.d.ts +3 -0
  33. package/dist/cli-sync-pull.js +79 -0
  34. package/dist/cli-sync-pull.js.map +1 -0
  35. package/dist/cli-sync-push.d.ts +4 -0
  36. package/dist/cli-sync-push.js +85 -0
  37. package/dist/cli-sync-push.js.map +1 -0
  38. package/dist/cli-sync-setup.d.ts +18 -0
  39. package/dist/cli-sync-setup.js +308 -0
  40. package/dist/cli-sync-setup.js.map +1 -0
  41. package/dist/cli-sync-status.d.ts +1 -0
  42. package/dist/cli-sync-status.js +20 -0
  43. package/dist/cli-sync-status.js.map +1 -0
  44. package/dist/cli-v2-checkpoint.d.ts +38 -0
  45. package/dist/cli-v2-checkpoint.js +134 -0
  46. package/dist/cli-v2-checkpoint.js.map +1 -0
  47. package/dist/cli.js +154 -34
  48. package/dist/cli.js.map +1 -1
  49. package/dist/config/config.d.ts +29 -0
  50. package/dist/config/config.js +123 -0
  51. package/dist/config/config.js.map +1 -0
  52. package/dist/diagnostics.js +1 -6
  53. package/dist/diagnostics.js.map +1 -1
  54. package/dist/extensions/pi-hmem.js +141 -35
  55. package/dist/extensions/pi-hmem.js.map +1 -1
  56. package/dist/hmem-config.d.ts +30 -5
  57. package/dist/hmem-config.js +50 -8
  58. package/dist/hmem-config.js.map +1 -1
  59. package/dist/hmem-store.d.ts +60 -2
  60. package/dist/hmem-store.js +205 -26
  61. package/dist/hmem-store.js.map +1 -1
  62. package/dist/hooks/binding-resolver.d.ts +13 -0
  63. package/dist/hooks/binding-resolver.js +42 -0
  64. package/dist/hooks/binding-resolver.js.map +1 -0
  65. package/dist/hooks/brief.d.ts +2 -0
  66. package/dist/hooks/brief.js +26 -0
  67. package/dist/hooks/brief.js.map +1 -0
  68. package/dist/hooks/dispatch.d.ts +5 -0
  69. package/dist/hooks/dispatch.js +119 -0
  70. package/dist/hooks/dispatch.js.map +1 -0
  71. package/dist/hooks/git-probe.d.ts +4 -0
  72. package/dist/hooks/git-probe.js +46 -0
  73. package/dist/hooks/git-probe.js.map +1 -0
  74. package/dist/hooks/harness/claude-code.d.ts +10 -0
  75. package/dist/hooks/harness/claude-code.js +133 -0
  76. package/dist/hooks/harness/claude-code.js.map +1 -0
  77. package/dist/hooks/harness/hermes.d.ts +4 -0
  78. package/dist/hooks/harness/hermes.js +20 -0
  79. package/dist/hooks/harness/hermes.js.map +1 -0
  80. package/dist/hooks/harness/pi.d.ts +4 -0
  81. package/dist/hooks/harness/pi.js +21 -0
  82. package/dist/hooks/harness/pi.js.map +1 -0
  83. package/dist/hooks/prompt-submit.d.ts +16 -0
  84. package/dist/hooks/prompt-submit.js +11 -0
  85. package/dist/hooks/prompt-submit.js.map +1 -0
  86. package/dist/hooks/session-start.d.ts +3 -0
  87. package/dist/hooks/session-start.js +31 -0
  88. package/dist/hooks/session-start.js.map +1 -0
  89. package/dist/hooks/stable-context.d.ts +11 -0
  90. package/dist/hooks/stable-context.js +117 -0
  91. package/dist/hooks/stable-context.js.map +1 -0
  92. package/dist/hooks/stop-log.d.ts +4 -0
  93. package/dist/hooks/stop-log.js +12 -0
  94. package/dist/hooks/stop-log.js.map +1 -0
  95. package/dist/hooks/summarizer-pick.d.ts +8 -0
  96. package/dist/hooks/summarizer-pick.js +18 -0
  97. package/dist/hooks/summarizer-pick.js.map +1 -0
  98. package/dist/hooks/transcript.d.ts +6 -0
  99. package/dist/hooks/transcript.js +72 -0
  100. package/dist/hooks/transcript.js.map +1 -0
  101. package/dist/hooks/types.d.ts +56 -0
  102. package/dist/hooks/types.js +2 -0
  103. package/dist/hooks/types.js.map +1 -0
  104. package/dist/mcp-curate-server.js +50 -4
  105. package/dist/mcp-curate-server.js.map +1 -1
  106. package/dist/mcp-server.js +121 -58
  107. package/dist/mcp-server.js.map +1 -1
  108. package/dist/mcp-shared.js +119 -29
  109. package/dist/mcp-shared.js.map +1 -1
  110. package/dist/memory-search.d.ts +5 -2
  111. package/dist/memory-search.js +5 -2
  112. package/dist/memory-search.js.map +1 -1
  113. package/dist/migrate/o-decompose.d.ts +14 -0
  114. package/dist/migrate/o-decompose.js +112 -0
  115. package/dist/migrate/o-decompose.js.map +1 -0
  116. package/dist/migrate/tree.d.ts +16 -0
  117. package/dist/migrate/tree.js +102 -0
  118. package/dist/migrate/tree.js.map +1 -0
  119. package/dist/migrate/v1-reader.d.ts +38 -0
  120. package/dist/migrate/v1-reader.js +34 -0
  121. package/dist/migrate/v1-reader.js.map +1 -0
  122. package/dist/migrate/v1-to-v2.d.ts +25 -0
  123. package/dist/migrate/v1-to-v2.js +127 -0
  124. package/dist/migrate/v1-to-v2.js.map +1 -0
  125. package/dist/session-state.d.ts +3 -0
  126. package/dist/session-state.js +7 -5
  127. package/dist/session-state.js.map +1 -1
  128. package/dist/store/db.d.ts +25 -0
  129. package/dist/store/db.js +159 -0
  130. package/dist/store/db.js.map +1 -0
  131. package/dist/store/entries.d.ts +48 -0
  132. package/dist/store/entries.js +145 -0
  133. package/dist/store/entries.js.map +1 -0
  134. package/dist/store/events-fts.d.ts +18 -0
  135. package/dist/store/events-fts.js +18 -0
  136. package/dist/store/events-fts.js.map +1 -0
  137. package/dist/store/events.d.ts +30 -0
  138. package/dist/store/events.js +48 -0
  139. package/dist/store/events.js.map +1 -0
  140. package/dist/store/fts.d.ts +24 -0
  141. package/dist/store/fts.js +35 -0
  142. package/dist/store/fts.js.map +1 -0
  143. package/dist/store/links.d.ts +24 -0
  144. package/dist/store/links.js +29 -0
  145. package/dist/store/links.js.map +1 -0
  146. package/dist/store/schema-engine.d.ts +20 -0
  147. package/dist/store/schema-engine.js +41 -0
  148. package/dist/store/schema-engine.js.map +1 -0
  149. package/dist/store/schema-v2.sql +149 -0
  150. package/dist/store/sessions.d.ts +38 -0
  151. package/dist/store/sessions.js +98 -0
  152. package/dist/store/sessions.js.map +1 -0
  153. package/dist/store/types.d.ts +74 -0
  154. package/dist/store/types.js +3 -0
  155. package/dist/store/types.js.map +1 -0
  156. package/dist/store/ulid.d.ts +1 -0
  157. package/dist/store/ulid.js +10 -0
  158. package/dist/store/ulid.js.map +1 -0
  159. package/dist/summarize/anthropic.d.ts +8 -0
  160. package/dist/summarize/anthropic.js +38 -0
  161. package/dist/summarize/anthropic.js.map +1 -0
  162. package/dist/summarize/loop.d.ts +40 -0
  163. package/dist/summarize/loop.js +64 -0
  164. package/dist/summarize/loop.js.map +1 -0
  165. package/dist/sync/api.d.ts +49 -0
  166. package/dist/sync/api.js +99 -0
  167. package/dist/sync/api.js.map +1 -0
  168. package/dist/sync/config.d.ts +16 -0
  169. package/dist/sync/config.js +27 -0
  170. package/dist/sync/config.js.map +1 -0
  171. package/dist/sync/conflict.d.ts +24 -0
  172. package/dist/sync/conflict.js +125 -0
  173. package/dist/sync/conflict.js.map +1 -0
  174. package/dist/sync/crypto.d.ts +53 -0
  175. package/dist/sync/crypto.js +140 -0
  176. package/dist/sync/crypto.js.map +1 -0
  177. package/dist/sync/passphrase.d.ts +1 -0
  178. package/dist/sync/passphrase.js +17 -0
  179. package/dist/sync/passphrase.js.map +1 -0
  180. package/dist/sync/v2/dispatch.d.ts +6 -0
  181. package/dist/sync/v2/dispatch.js +24 -0
  182. package/dist/sync/v2/dispatch.js.map +1 -0
  183. package/dist/sync/v2/envelope.d.ts +13 -0
  184. package/dist/sync/v2/envelope.js +36 -0
  185. package/dist/sync/v2/envelope.js.map +1 -0
  186. package/dist/sync/v2/export.d.ts +10 -0
  187. package/dist/sync/v2/export.js +32 -0
  188. package/dist/sync/v2/export.js.map +1 -0
  189. package/dist/sync/v2/import.d.ts +10 -0
  190. package/dist/sync/v2/import.js +130 -0
  191. package/dist/sync/v2/import.js.map +1 -0
  192. package/dist/sync/v2/queue.d.ts +18 -0
  193. package/dist/sync/v2/queue.js +59 -0
  194. package/dist/sync/v2/queue.js.map +1 -0
  195. package/dist/sync/v2/reconcile.d.ts +3 -0
  196. package/dist/sync/v2/reconcile.js +18 -0
  197. package/dist/sync/v2/reconcile.js.map +1 -0
  198. package/dist/sync/v2/staging.d.ts +27 -0
  199. package/dist/sync/v2/staging.js +46 -0
  200. package/dist/sync/v2/staging.js.map +1 -0
  201. package/dist/sync/v2/sync.d.ts +18 -0
  202. package/dist/sync/v2/sync.js +63 -0
  203. package/dist/sync/v2/sync.js.map +1 -0
  204. package/dist/sync/v2/transport.d.ts +43 -0
  205. package/dist/sync/v2/transport.js +20 -0
  206. package/dist/sync/v2/transport.js.map +1 -0
  207. package/dist/sync-bridge.d.ts +2 -0
  208. package/dist/sync-bridge.js +134 -0
  209. package/dist/sync-bridge.js.map +1 -0
  210. package/dist/tools/analyze-v1.d.ts +1 -0
  211. package/dist/tools/analyze-v1.js +142 -0
  212. package/dist/tools/analyze-v1.js.map +1 -0
  213. package/dist/util/iso.d.ts +8 -0
  214. package/dist/util/iso.js +15 -0
  215. package/dist/util/iso.js.map +1 -0
  216. package/dist/utils.d.ts +7 -0
  217. package/dist/utils.js +14 -0
  218. package/dist/utils.js.map +1 -0
  219. package/dist/v2/addressing.d.ts +9 -0
  220. package/dist/v2/addressing.js +55 -0
  221. package/dist/v2/addressing.js.map +1 -0
  222. package/dist/v2/checkpoint-agent.d.ts +75 -0
  223. package/dist/v2/checkpoint-agent.js +231 -0
  224. package/dist/v2/checkpoint-agent.js.map +1 -0
  225. package/dist/v2/checkpoint-select.d.ts +60 -0
  226. package/dist/v2/checkpoint-select.js +106 -0
  227. package/dist/v2/checkpoint-select.js.map +1 -0
  228. package/dist/v2/checkpoint.d.ts +62 -0
  229. package/dist/v2/checkpoint.js +103 -0
  230. package/dist/v2/checkpoint.js.map +1 -0
  231. package/dist/v2/curation.d.ts +23 -0
  232. package/dist/v2/curation.js +118 -0
  233. package/dist/v2/curation.js.map +1 -0
  234. package/dist/v2/projects.d.ts +29 -0
  235. package/dist/v2/projects.js +60 -0
  236. package/dist/v2/projects.js.map +1 -0
  237. package/dist/v2/read-render.d.ts +31 -0
  238. package/dist/v2/read-render.js +150 -0
  239. package/dist/v2/read-render.js.map +1 -0
  240. package/dist/v2/related.d.ts +8 -0
  241. package/dist/v2/related.js +35 -0
  242. package/dist/v2/related.js.map +1 -0
  243. package/dist/v2/search.d.ts +6 -0
  244. package/dist/v2/search.js +24 -0
  245. package/dist/v2/search.js.map +1 -0
  246. package/dist/v2/session-id.d.ts +7 -0
  247. package/dist/v2/session-id.js +14 -0
  248. package/dist/v2/session-id.js.map +1 -0
  249. package/dist/v2/sessions-tools.d.ts +11 -0
  250. package/dist/v2/sessions-tools.js +30 -0
  251. package/dist/v2/sessions-tools.js.map +1 -0
  252. package/dist/v2/store-facade.d.ts +23 -0
  253. package/dist/v2/store-facade.js +33 -0
  254. package/dist/v2/store-facade.js.map +1 -0
  255. package/dist/v2/summarize-adapter.d.ts +11 -0
  256. package/dist/v2/summarize-adapter.js +19 -0
  257. package/dist/v2/summarize-adapter.js.map +1 -0
  258. package/dist/v2/writes.d.ts +30 -0
  259. package/dist/v2/writes.js +135 -0
  260. package/dist/v2/writes.js.map +1 -0
  261. package/hmem.config.example.json +92 -10
  262. package/opencode-plugin/hmem.js +5 -2
  263. package/package.json +7 -3
  264. package/plugins/hermes-hmem/README.md +56 -0
  265. package/plugins/hermes-hmem/__init__.py +187 -0
  266. package/plugins/hermes-hmem/plugin.yaml +8 -0
  267. package/server.json +2 -2
  268. package/skills/hmem-activate/SKILL.md +1 -1
  269. package/skills/hmem-config/SKILL.md +70 -5
  270. package/skills/hmem-curate/SKILL.md +13 -6
  271. package/skills/hmem-dispatch/SKILL.md +1 -1
  272. package/skills/hmem-migrate-o/SKILL.md +3 -8
  273. package/skills/hmem-new-error/SKILL.md +1 -9
  274. package/skills/hmem-new-project/SKILL.md +1 -9
  275. package/skills/hmem-new-rule/SKILL.md +93 -0
  276. package/skills/hmem-read/SKILL.md +16 -8
  277. package/skills/hmem-release/SKILL.md +108 -9
  278. package/skills/hmem-search/SKILL.md +48 -25
  279. package/skills/hmem-session-start/SKILL.md +147 -46
  280. package/skills/hmem-setup/SKILL.md +3 -3
  281. package/skills/hmem-sync-setup/SKILL.md +1 -5
  282. package/skills/hmem-update/SKILL.md +345 -19
  283. package/skills/hmem-wipe/SKILL.md +41 -7
  284. package/skills/hmem-write/SKILL.md +1 -12
  285. package/skills/hmem-activate-workspace/evals/evals.json +0 -29
  286. package/skills/hmem-activate-workspace/iteration-1/benchmark.json +0 -370
  287. package/skills/hmem-activate-workspace/iteration-1/benchmark.md +0 -13
  288. package/skills/hmem-activate-workspace/iteration-1/eval-1-simple-switch/eval_metadata.json +0 -23
  289. package/skills/hmem-activate-workspace/iteration-1/eval-1-simple-switch/with_skill/grading.json +0 -55
  290. package/skills/hmem-activate-workspace/iteration-1/eval-1-simple-switch/with_skill/outputs/response.md +0 -121
  291. package/skills/hmem-activate-workspace/iteration-1/eval-1-simple-switch/with_skill/run-1/grading.json +0 -55
  292. package/skills/hmem-activate-workspace/iteration-1/eval-1-simple-switch/without_skill/grading.json +0 -44
  293. package/skills/hmem-activate-workspace/iteration-1/eval-1-simple-switch/without_skill/outputs/response.md +0 -78
  294. package/skills/hmem-activate-workspace/iteration-1/eval-1-simple-switch/without_skill/run-1/grading.json +0 -44
  295. package/skills/hmem-activate-workspace/iteration-1/eval-2-misrouting-fix/eval_metadata.json +0 -23
  296. package/skills/hmem-activate-workspace/iteration-1/eval-2-misrouting-fix/with_skill/grading.json +0 -49
  297. package/skills/hmem-activate-workspace/iteration-1/eval-2-misrouting-fix/with_skill/outputs/response.md +0 -98
  298. package/skills/hmem-activate-workspace/iteration-1/eval-2-misrouting-fix/with_skill/run-1/grading.json +0 -49
  299. package/skills/hmem-activate-workspace/iteration-1/eval-2-misrouting-fix/without_skill/grading.json +0 -44
  300. package/skills/hmem-activate-workspace/iteration-1/eval-2-misrouting-fix/without_skill/outputs/response.md +0 -57
  301. package/skills/hmem-activate-workspace/iteration-1/eval-2-misrouting-fix/without_skill/run-1/grading.json +0 -44
  302. package/skills/hmem-activate-workspace/iteration-1/eval-3-temporary-load/eval_metadata.json +0 -23
  303. package/skills/hmem-activate-workspace/iteration-1/eval-3-temporary-load/with_skill/grading.json +0 -48
  304. package/skills/hmem-activate-workspace/iteration-1/eval-3-temporary-load/with_skill/outputs/response.md +0 -69
  305. package/skills/hmem-activate-workspace/iteration-1/eval-3-temporary-load/with_skill/run-1/grading.json +0 -48
  306. package/skills/hmem-activate-workspace/iteration-1/eval-3-temporary-load/without_skill/grading.json +0 -44
  307. package/skills/hmem-activate-workspace/iteration-1/eval-3-temporary-load/without_skill/outputs/response.md +0 -59
  308. package/skills/hmem-activate-workspace/iteration-1/eval-3-temporary-load/without_skill/run-1/grading.json +0 -44
  309. package/skills/hmem-activate-workspace/iteration-1/eval-4-wrong-project/eval_metadata.json +0 -23
  310. package/skills/hmem-activate-workspace/iteration-1/eval-4-wrong-project/with_skill/grading.json +0 -55
  311. package/skills/hmem-activate-workspace/iteration-1/eval-4-wrong-project/with_skill/outputs/response.md +0 -182
  312. package/skills/hmem-activate-workspace/iteration-1/eval-4-wrong-project/with_skill/run-1/grading.json +0 -55
  313. package/skills/hmem-activate-workspace/iteration-1/eval-4-wrong-project/without_skill/grading.json +0 -44
  314. package/skills/hmem-activate-workspace/iteration-1/eval-4-wrong-project/without_skill/outputs/response.md +0 -43
  315. package/skills/hmem-activate-workspace/iteration-1/eval-4-wrong-project/without_skill/run-1/grading.json +0 -44
package/README.md CHANGED
@@ -2,7 +2,26 @@
2
2
 
3
3
  > Your AI forgets everything between sessions. **hmem fixes that.**
4
4
 
5
- One `load_project()` call. 5k tokens. Your agent knows everything important about a project, every past mistake, every decision you ever made together — across sessions, devices, and AI providers. No setup per conversation. No "let me re-read the codebase." It just *remembers*.
5
+ One `load_project()` call. ~3000 tokens. Your agent knows everything important about a project every past mistake, every decision, every open task**across sessions, devices, and AI providers.** No setup per conversation. No "let me re-read the codebase." It just *remembers*.
6
+
7
+ > **AI agent?** Skip this file. Read [AGENT_SETUP.md](AGENT_SETUP.md) — written for you, not for humans.
8
+
9
+ > **Naming note (v8.0):** This package was briefly published as `its-over-9k` (1.x). It is now `hmem` again — pure memory framework, nothing else. The `its-over-9k` name lives on as a separate project: the [o9k token-efficiency meta-framework](https://github.com/Bumblebiber/its-over-9k), which combines skills/plugins like this one. Related: [TIM](https://github.com/Bumblebiber/tim) — hmem's next-generation successor (hypergraph memory, CRDT sync).
10
+
11
+ ---
12
+
13
+ ## What This Is
14
+
15
+ hmem is not a note-taking plugin. It's a **memory framework** for AI agents — a complete infrastructure layer for persistent, portable, token-efficient knowledge that survives session boundaries, device switches, and provider changes.
16
+
17
+ Four core guarantees:
18
+
19
+ | Pillar | What it means |
20
+ |--------|--------------|
21
+ | **Token efficiency** | 5-level lazy loading — you pay for what you read, never more |
22
+ | **Portability** | Same memory across Claude, Gemini, GPT, local models, any MCP client |
23
+ | **Efficient storage** | Hierarchical tree structure — context scales with depth, not flat append |
24
+ | **No context waste** | Auto-session capture + project briefing = zero re-read overhead |
6
25
 
7
26
  ---
8
27
 
@@ -15,11 +34,11 @@ You've tried workarounds — CLAUDE.md files, custom prompts, manually pasting c
15
34
  ## The Solution
16
35
 
17
36
  ```
18
- You: "Load project hmem"
37
+ You: "Load project"
19
38
  Agent: [calls load_project("P0048") — 3000 tokens]
20
- Agent: "Got it. v5.0.0, TypeScript/SQLite/npm, 10 source files,
21
- 3 open tasks, 9 ideas. Last session you implemented
22
- auto-checkpoints via Haiku. What's next?"
39
+ Agent: "v1.2.9, TypeScript/SQLite/npm. 3 open bugs, 8 roadmap items.
40
+ Last session: rebrand complete, rename_id bug fixed (89 changes).
41
+ Next: O-Entry Auto-Purge. What's the focus today?"
23
42
  ```
24
43
 
25
44
  That's it. 3000 tokens for a complete project briefing. The agent knows the stack, the architecture, the open bugs, the recent decisions, and exactly where you left off — even if "you" was a different AI on a different machine yesterday.
@@ -36,13 +55,13 @@ Level 1 ── One-line summary (always loaded — ~5k tokens for 300
36
55
  Level 5 ── Raw/verbatim data (loaded on demand)
37
56
  ```
38
57
 
39
- At session start, the agent loads Level 1 summaries — one line per memory. When it needs detail, it drills down. Your 300-entry memory costs 5k tokens to overview. A single project costs 700.
58
+ At session start, the agent loads Level 1 summaries — one line per memory. When it needs detail, it drills down. Your 300-entry memory costs 5k tokens to overview. A single project costs ~3000 tokens.
40
59
 
41
- **Nothing is summarized away.** Level 1 is a summary, but Levels 2-5 hold the complete original text, word for word, accessible on demand.
60
+ **Nothing is summarized away.** Level 1 is a compressed view, but Levels 25 hold the complete original text, word for word, accessible on demand.
42
61
 
43
62
  ---
44
63
 
45
- ## What Makes v5 Different
64
+ ## Framework Features
46
65
 
47
66
  ### Automatic Session Memory
48
67
 
@@ -54,11 +73,11 @@ You type → Agent responds → Stop hook fires → Exchange saved to O-en
54
73
  → Haiku auto-titles the session
55
74
  ```
56
75
 
57
- Switch projects mid-session? The O-entry switches too. Start a new session on a different PC? The next agent sees every exchange from every device — **the conversation never dies**.
76
+ Switch projects mid-session? The O-entry switches too. Start a new session on a different device? The next agent sees every exchange from every device — **the conversation never dies**.
58
77
 
59
78
  ### Haiku Background Checkpoints
60
79
 
61
- Every 20 exchanges, a Haiku subagent wakes up in the background. It reads the recent conversation, extracts lessons learned, errors encountered, and decisions made, then writes them to long-term memory — with full MCP tool access. Your main agent is never interrupted.
80
+ Every N exchanges (configurable, default 5), a Haiku subagent wakes up in the background. It reads the recent conversation, extracts lessons learned, errors encountered, and decisions made, then writes them to long-term memory — with full MCP tool access. Your main agent is never interrupted.
62
81
 
63
82
  The checkpoint also writes a **handoff note** to the project: "Here's what was done, here's what's in progress, here's the next step." The next agent — on any device, any provider — picks up exactly where you left off.
64
83
 
@@ -68,42 +87,199 @@ Sessions are meaningless. Projects are everything.
68
87
 
69
88
  - O-entries are linked to the active project, not the session
70
89
  - Checkpoint counters count project exchanges, not session messages
71
- - 10 messages on your laptop + 10 on your server = checkpoint fires on message 20
72
90
  - `load_project` shows recent conversations with full context — across all devices
73
91
 
92
+ ### Skills System
93
+
94
+ hmem ships with a complete **skills layer** — structured behavior files that agents load on demand. Skills define *how* an agent should do something (debug, write memory, curate entries, handle a session start) — separate from memory, separate from prompts.
95
+
96
+ ```bash
97
+ npx hmem update-skills # Pull latest skills to your AI tool's skill directory
98
+ ```
99
+
100
+ Skills are versioned and updated independently. Your agents get smarter without reinstalling. 21 skills ship by default:
101
+
102
+ | Skill | Triggers when… |
103
+ |-------|----------------|
104
+ | `hmem-session-start` | Every session start — loads project + surfaces pending git work, open tasks, misrouted O-entries |
105
+ | `hmem-using-hmem` | Meta-skill loaded at session start; defines mandatory memory habits |
106
+ | `hmem-read` | Reading from long-term memory (search, prefix filter, find_related, cross-project read) |
107
+ | `hmem-write` | Writing to hmem — picks prefix, tree location, tags, detects duplicates |
108
+ | `hmem-search` | User references something without an ID ("the bug we had", "letzte Woche") |
109
+ | `hmem-new-project` | Creating a P-entry — handles schema, sections, O-entry linking |
110
+ | `hmem-new-error` | Creating an E-entry with the strict 5-level scaffold |
111
+ | `hmem-activate` | Switching active project mid-session, plus fixing misrouted exchanges |
112
+ | `hmem-context` | Loading specific context when load_project output isn't enough |
113
+ | `hmem-recall` | Dispatching a Haiku sub-agent to search hmem |
114
+ | `hmem-dispatch` | Dispatching an isolated sub-agent for any search/lookup/calculation |
115
+ | `hmem-curate` | Cleaning up an .hmem file (mark obsolete, fix titles, consolidate dupes) |
116
+ | `hmem-migrate-o` | Migrating O-entries to the project-bound 5-level structure |
117
+ | `hmem-consolidate` | Merging session checkpoint summaries into one final O-entry summary |
118
+ | `hmem-wipe` | Prep for `/clear` — save high-value knowledge, update Next Steps |
119
+ | `hmem-config` | View/change memory settings, hooks, sync, checkpoints |
120
+ | `hmem-setup` | First-time install of hmem for Claude Code / Gemini CLI / OpenCode |
121
+ | `hmem-sync-setup` | Set up `hmem-sync` for cross-device sync |
122
+ | `hmem-update` | Update flow — runs `npm update -g`, syncs skills, applies migrations |
123
+ | `hmem-release` | Pre-publish checklist for hmem itself |
124
+ | `hmem-subagent` | Template for sub-agents dispatched by `hmem-dispatch` |
125
+
126
+ ### Company Memory
127
+
128
+ Beyond personal memory, agents can maintain a **shared company store** — a separate `company.hmem` that multiple agents and team members can read from. Personal and company memory coexist; agents query both simultaneously.
129
+
130
+ ```typescript
131
+ import { openCompanyMemory } from 'hmem';
132
+ const store = openCompanyMemory('/path/to/project');
133
+ ```
134
+
135
+ ### Embeddable SDK
136
+
137
+ hmem ships as a fully documented TypeScript SDK — import `HmemStore` directly into your own agents, tools, or automation pipelines:
138
+
139
+ ```typescript
140
+ import {
141
+ HmemStore, openCompanyMemory, resolveHmemPath,
142
+ loadHmemConfig, saveHmemConfig, DEFAULT_CONFIG, DEFAULT_PREFIXES, formatPrefixList,
143
+ searchMemory,
144
+ } from 'hmem';
145
+ import type {
146
+ AgentRole, MemoryEntry, MemoryNode, HmemConfig,
147
+ SearchResult, SearchOptions, SearchScope,
148
+ } from 'hmem';
149
+
150
+ const store = new HmemStore('/path/to/agent.hmem');
151
+ const results = searchMemory('/path/to/project', 'auth token bug', { maxResults: 5 });
152
+ ```
153
+
154
+ ---
155
+
156
+ ## MCP Tools
157
+
158
+ hmem ships **two** MCP servers:
159
+
160
+ - **`hmem`** (daily-use, 13 tools) — read, write, search, project lifecycle.
161
+ - **`hmem-curate`** (maintenance, 11 tools) — bulk edits, schema migrations, backup/restore. Activate only when curating.
162
+
163
+ ### `hmem` — daily-use server (13)
164
+
165
+ | Tool | What it does |
166
+ |------|-------------|
167
+ | `read_memory` | 5-level lazy read — by ID, prefix, search, time, or tag |
168
+ | `write_memory` | Create new entries with title, body, tags, links |
169
+ | `append_memory` | Add child nodes to existing entries |
170
+ | `update_memory` | Patch fields: title, body, tags, irrelevant, links |
171
+ | `search_memory` | FTS5 full-text search with sub-node attribution |
172
+ | `find_related` | Find contextually related entries by tag overlap |
173
+ | `load_project` | Activate a project + get full briefing + recent sessions |
174
+ | `read_project` | Read project without activating (comparison/reference) |
175
+ | `create_project` | Scaffold a new project entry with standard schema |
176
+ | `list_projects` | List all projects with status summary |
177
+ | `flush_context` | Persist current session context to long-term memory |
178
+ | `move_nodes` | Move a subtree under a different parent (also in curate server) |
179
+ | `set_active_device` | Register and switch between devices |
180
+
181
+ ### `hmem-curate` — maintenance server (11)
182
+
183
+ | Tool | What it does |
184
+ |------|-------------|
185
+ | `memory_stats` | Per-prefix counts, total tokens, favorites, hashtags, stale-list |
186
+ | `memory_health` | Find broken links, orphan tags, empty entries, dangling chains |
187
+ | `export_memory` | Export the full .hmem to a portable JSON snapshot |
188
+ | `import_memory` | Import a JSON snapshot back into a .hmem (destructive) |
189
+ | `update_many` | Bulk-patch a set of entries (irrelevant, tags, body, etc.) |
190
+ | `tag_bulk` | Add/remove a tag across many entries |
191
+ | `tag_rename` | Rename a tag globally across all entries |
192
+ | `move_memory` | Move an entire entry to a new ID slot |
193
+ | `move_nodes` | Move a subtree under a different parent (also in main server) |
194
+ | `rename_id` | Rename an entry's ID; rewrites all inbound links |
195
+ | `reset_memory_cache` | Invalidate the in-memory L1 cache (after raw SQL writes) |
196
+
197
+ The daily `hmem` server is registered automatically by `hmem init`. `hmem-curate` is opt-in because its tools are destructive — register it when you need to curate:
198
+
199
+ ```
200
+ npx hmem mcp-add-curate # adds the curate server to Claude Code (user scope)
201
+ ```
202
+
203
+ Then toggle it via `/mcp` only during curation sessions. For other MCP clients, see [Manual setup](#manual-setup).
204
+
74
205
  ---
75
206
 
76
- ## Key Features
77
-
78
- | Feature | What it does |
79
- |---------|--------------|
80
- | **5-level lazy loading** | Tokens scale with need, not memory size |
81
- | **Smart bulk reads** | Expands newest + most-accessed; compresses the rest to titles |
82
- | **Project gate** | Activate a project — only relevant memories are expanded |
83
- | **Duplicate detection** | Warns before creating entries that already exist |
84
- | **Encrypted sync** | AES-256-GCM, zero-knowledge server, multi-server redundancy |
85
- | **Auto-logging** | Every exchange recorded via Stop hook (O-prefix) |
86
- | **Auto-checkpoint** | Haiku extracts L/D/E entries every N exchanges |
87
- | **Project handoff** | Background agent maintains "current state" in Protocol section |
88
- | **User skill tracking** | Agents track your expertise (1-10) and adapt communication |
89
- | **Hashtags** | Cross-cutting tags for discovery across all categories |
90
- | **Obsolete chains** | Mark entries wrong with correction reference — auto-follows |
91
- | **Cross-provider** | Claude, Gemini, GPT, DeepSeek, local models — same memory |
92
- | **Cross-tool** | Claude Code, Gemini CLI, Cursor, Windsurf, OpenCode, Cline |
93
- | **Import/Export** | Share memories between agents or back up as Markdown |
94
-
95
- ### Categories
207
+ ## CLI Commands
208
+
209
+ After `npm install -g hmem-mcp`, the `hmem` binary is on PATH.
210
+
211
+ ### User-facing
212
+
213
+ | Command | Purpose |
214
+ |---------|---------|
215
+ | `hmem init` | Interactive installer for AI tools (Claude Code, OpenCode, Gemini CLI, Cursor, Windsurf, Cline). Flags: `--global` / `--local` / `--tools <list>` / `--dir <path>` / `--no-example` |
216
+ | `hmem update-skills` | Copy/sync bundled skill files to detected AI tools (called automatically on `npm install`) |
217
+ | `hmem mcp-add-curate` | Register the `hmem-curate` MCP server with Claude Code (opt-in; toggle via `/mcp` when curating) |
218
+ | `hmem doctor` | Detect stale or deprecated hmem MCP entries in host configs |
219
+ | `hmem stats` | Memory statistics + per-project token estimates + 🔴 4k threshold flagging |
220
+ | `hmem setup-hook` | Re-add the SessionStart hook to Claude Code settings (if removed) |
221
+ | `hmem version` | Show version |
222
+
223
+ ### Hook drivers (called by AI tools, not by hand)
224
+
225
+ | Command | Wired into | What it does |
226
+ |---------|-----------|--------------|
227
+ | `hmem hook-startup` | UserPromptSubmit | First-message context injection (memory overview, project list, sync status). Periodic checkpoint reminders. Reads JSON from stdin |
228
+ | `hmem log-exchange` | Stop (sync) | Append the latest exchange to the active O-entry |
229
+ | `hmem checkpoint` | Stop (async) | Background Haiku/DeepSeek call — extracts lessons, errors, decisions; updates project handoff note |
230
+ | `hmem context-inject` | SessionStart[clear] | Inject project + rules context after `/clear` |
231
+ | `hmem deactivate` | SessionStart[clear] | Clear active project for current session |
232
+ | `hmem statusline` | statusLine | Render Claude Code statusline (device · active project · checkpoint counter). Reads JSON from stdin |
233
+
234
+ ### Curation
235
+
236
+ | Command | Purpose |
237
+ |---------|---------|
238
+ | `hmem delete <ID>` | Permanently delete an entry (curator only, never synced) |
239
+ | `hmem migrate-o-entries` | Migrate O-entries to the current project-bound schema |
240
+ | `hmem summarize-session <id>` | Generate a summary node for a session |
241
+
242
+ ### Sync (requires `hmem-sync` installed)
243
+
244
+ | Command | Purpose |
245
+ |---------|---------|
246
+ | `hmem sync push` | Push local memory to the sync server |
247
+ | `hmem sync pull` | Pull latest memory from the sync server |
248
+ | `hmem sync status` | Show server URL · auth state · last-sync timestamp |
249
+ | `hmem sync setup [--join]` | Interactive passphrase + device setup |
250
+
251
+ ### Backup / migration
252
+
253
+ | Command | Purpose |
254
+ |---------|---------|
255
+ | `hmem export-staging <hmem> <json>` | Export `.hmem` SQLite to a portable JSON staging file |
256
+ | `hmem import-staging <json> <hmem>` | Import a JSON staging file back into a `.hmem` |
257
+
258
+ `hmem serve` starts the MCP stdio server directly — your AI tool launches it automatically; you only run it by hand for debugging.
259
+
260
+ ---
261
+
262
+ ## Memory Categories
263
+
264
+ Default prefixes (configurable via `prefixes` in `hmem.config.json`):
96
265
 
97
266
  | Prefix | Category | Example |
98
267
  |--------|----------|---------|
99
- | **P** | Project | `hmem-mcp \| Active \| TS/SQLite/npm \| Persistent AI memory` |
268
+ | **P** | Project | `hmem \| Active \| TS/SQLite/npm` |
100
269
  | **L** | Lesson | `HMEM_AGENT_ID must be set in hooks — resolveHmemPath falls back to wrong DB` |
270
+ | **T** | Task | `T0033 hmem-sync SaaS monetization — recurring monthly tier design` |
101
271
  | **E** | Error | `158 spurious O-entries created when Haiku MCP lacked HMEM_NO_SESSION guard` |
102
272
  | **D** | Decision | `Project-based O-entries over session-based — sessions are meaningless` |
273
+ | **M** | Milestone | `v1.0.0 — package renamed to hmem, npm rebrand complete` |
274
+ | **S** | Skill | `Skill: TypeScript debugging with source maps` |
275
+ | **N** | Navigator | High-level navigation entry (table of contents for a topic) |
103
276
  | **H** | Human | `User Skill: TypeScript 9, Architecture 9, React 3` |
104
277
  | **R** | Rule | `Max one npm publish per day — batch changes` |
105
278
  | **O** | Original | Auto-recorded conversation history (every exchange, every device) |
106
- | **I** | Infra | `Strato Server \| Active \| Linux \| Ubuntu 22.04` |
279
+ | **I** | Infrastructure | `Strato Server \| Active \| Linux \| Ubuntu 22.04` |
280
+ | **C** | Convention | `Tag scheme: lowercase, prefer existing tags before inventing` |
281
+
282
+ Add custom prefixes (e.g. `A` for App, `F` for Function reference) by listing them under `prefixes` in `hmem.config.json` — they show up in `read_memory({ prefix: "X" })` filters automatically.
107
283
 
108
284
  ---
109
285
 
@@ -121,11 +297,11 @@ npm install -g hmem-mcp
121
297
  npx hmem init
122
298
  ```
123
299
 
124
- This detects your AI tools, creates the memory directory, configures MCP, and installs all 4 hooks:
300
+ Detects your AI tools, creates the memory directory, configures MCP, and installs all hooks:
125
301
 
126
302
  | Hook | When | What |
127
303
  |------|------|------|
128
- | `UserPromptSubmit` | Every message | First message: load memory. Every Nth: checkpoint reminder |
304
+ | `UserPromptSubmit` | Every message | First message: load memory overview. Every Nth: checkpoint reminder |
129
305
  | `Stop` (sync) | Every response | Log exchange to active O-entry |
130
306
  | `Stop` (async) | Every response | Haiku auto-titles untitled sessions |
131
307
  | `SessionStart[clear]` | After /clear | Re-inject project context |
@@ -142,8 +318,6 @@ Empty response = working (first run). Error = check the [troubleshooting section
142
318
 
143
319
  ### Manual setup
144
320
 
145
- If you prefer manual configuration over `hmem init`:
146
-
147
321
  <details>
148
322
  <summary>Claude Code — edit ~/.claude/.mcp.json</summary>
149
323
 
@@ -152,7 +326,7 @@ If you prefer manual configuration over `hmem init`:
152
326
  "mcpServers": {
153
327
  "hmem": {
154
328
  "command": "/absolute/path/to/node",
155
- "args": ["/absolute/path/to/hmem-mcp/dist/mcp-server.js"],
329
+ "args": ["/absolute/path/to/hmem/dist/mcp-server.js"],
156
330
  "env": {
157
331
  "HMEM_PROJECT_DIR": "/home/yourname/.hmem",
158
332
  "HMEM_AGENT_ID": "DEVELOPER"
@@ -165,7 +339,7 @@ If you prefer manual configuration over `hmem init`:
165
339
  Find the paths:
166
340
  ```bash
167
341
  echo "Node: $(which node)"
168
- echo "Server: $(npm root -g)/hmem-mcp/dist/mcp-server.js"
342
+ echo "Server: $(npm root -g)/hmem/dist/mcp-server.js"
169
343
  ```
170
344
  </details>
171
345
 
@@ -177,7 +351,7 @@ echo "Server: $(npm root -g)/hmem-mcp/dist/mcp-server.js"
177
351
  "mcp": {
178
352
  "hmem": {
179
353
  "type": "local",
180
- "command": ["/absolute/path/to/node", "/absolute/path/to/hmem-mcp/dist/mcp-server.js"],
354
+ "command": ["/absolute/path/to/node", "/absolute/path/to/hmem/dist/mcp-server.js"],
181
355
  "environment": { "HMEM_PROJECT_DIR": "/home/yourname/.hmem" },
182
356
  "enabled": true
183
357
  }
@@ -196,7 +370,7 @@ Edit `~/.cursor/mcp.json`, `~/.codeium/windsurf/mcp_config.json`, or `.vscode/mc
196
370
  "mcpServers": {
197
371
  "hmem": {
198
372
  "command": "/absolute/path/to/node",
199
- "args": ["/absolute/path/to/hmem-mcp/dist/mcp-server.js"],
373
+ "args": ["/absolute/path/to/hmem/dist/mcp-server.js"],
200
374
  "env": { "HMEM_PROJECT_DIR": "/home/yourname/.hmem" }
201
375
  }
202
376
  }
@@ -216,7 +390,7 @@ Edit `~/.cursor/mcp.json`, `~/.codeium/windsurf/mcp_config.json`, or `.vscode/mc
216
390
  "maxCharsPerLevel": [200, 2500, 10000, 25000, 50000],
217
391
  "maxDepth": 5,
218
392
  "checkpointMode": "auto",
219
- "checkpointInterval": 20,
393
+ "checkpointInterval": 5,
220
394
  "recentOEntries": 10,
221
395
  "maxTitleChars": 50,
222
396
  "prefixes": { "X": "Custom" }
@@ -232,17 +406,52 @@ Edit `~/.cursor/mcp.json`, `~/.codeium/windsurf/mcp_config.json`, or `.vscode/mc
232
406
 
233
407
  | Key | Default | What it does |
234
408
  |-----|---------|-------------|
235
- | `checkpointMode` | `"remind"` | `"auto"` = Haiku writes L/D/E in background. `"remind"` = asks the main agent |
236
- | `checkpointInterval` | `20` | Exchanges between checkpoints. Set `0` to disable |
409
+ | `checkpointMode` | `"remind"` | `"auto"` = background agent writes L/D/E. `"remind"` = prompts the main agent |
410
+ | `checkpointInterval` | `5` | Exchanges between checkpoints. `0` = disabled |
411
+ | `checkpointProvider` | `"anthropic"` | `"anthropic"` or `"openai"` (any OpenAI-compatible: DeepSeek, Groq, …) |
412
+ | `checkpointModel` | `"claude-haiku-4-5-20251001"` | Model name for the configured provider |
413
+ | `checkpointBaseUrl` | — | OpenAI-compatible base URL (e.g. `https://api.deepseek.com/v1`) |
414
+ | `checkpointApiKeyEnv` | provider default | Env var holding the API key. Defaults: `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` |
237
415
  | `recentOEntries` | `10` | How many recent sessions to show in `load_project` |
416
+ | `prefixes` | built-in | Add custom entry types |
238
417
 
239
418
  All keys are optional. Missing keys use defaults.
240
419
 
420
+ ### Checkpoint setup per harness
421
+
422
+ The auto-checkpoint agent runs in the background after every Nth exchange. It needs an LLM call — three paths, picked automatically:
423
+
424
+ 1. **API key in environment** (any harness) → direct provider API loop. Configure `checkpointProvider` + `checkpointModel` + `checkpointApiKeyEnv` in `hmem.config.json`. Works from Pi, Hermes, OpenCode, and Claude Code.
425
+ 2. **No API key, but `claude` CLI in PATH** → subprocess fallback (`claude -p`). Zero-config for Claude Code / Claude Max users.
426
+ 3. **Neither** → checkpoint fails with a config-hint error.
427
+
428
+ **Recommended cheap setup (DeepSeek, ~10× cheaper than Haiku):**
429
+
430
+ ```json
431
+ {
432
+ "memory": {
433
+ "checkpointMode": "auto",
434
+ "checkpointProvider": "openai",
435
+ "checkpointModel": "deepseek-chat",
436
+ "checkpointBaseUrl": "https://api.deepseek.com/v1",
437
+ "checkpointApiKeyEnv": "DEEPSEEK_API_KEY"
438
+ }
439
+ }
440
+ ```
441
+
442
+ Then `export DEEPSEEK_API_KEY=sk-...` in your shell profile. Works for any harness.
443
+
444
+ **Claude Code / Claude Max (zero-config):** no provider settings needed — the subprocess fallback uses your existing `claude` login.
445
+
446
+ **Per-harness exchange logging:** Claude Code uses `Stop` hooks (installed by `npx hmem init`). Pi uses the built-in extension (`src/extensions/pi-hmem.ts`). Hermes needs the `hermes-hmem` plugin (see `plugins/hermes-hmem/README.md`). OpenCode uses the same hook system as Claude Code.
447
+
448
+ > **⚠ Pi users:** Hook-based exchange logging is currently not working in the Pi runtime. Exchanges are not saved to O-entries automatically. Manual checkpointing via `hmem checkpoint` is the workaround until this is resolved.
449
+
241
450
  ---
242
451
 
243
452
  ## Cross-Device Sync
244
453
 
245
- Sync memories across all devices with zero-knowledge encryption.
454
+ Sync memories across all devices with zero-knowledge AES-256-GCM encryption.
246
455
 
247
456
  ```bash
248
457
  npm install -g hmem-sync
@@ -257,7 +466,7 @@ Add `HMEM_SYNC_PASSPHRASE` to your MCP config for automatic sync on every read/w
257
466
  {
258
467
  "sync": [
259
468
  { "name": "primary", "serverUrl": "https://server1/hmem-sync", "userId": "me", "salt": "...", "token": "..." },
260
- { "name": "backup", "serverUrl": "https://server2/hmem-sync", "userId": "me", "salt": "...", "token": "..." }
469
+ { "name": "backup", "serverUrl": "https://server2/hmem-sync", "userId": "me", "salt": "...", "token": "..." }
261
470
  ]
262
471
  }
263
472
  ```
@@ -270,14 +479,15 @@ Broadcast to all synced agents across all devices:
270
479
  npx hmem-sync announce --message "Server URL changing — update your config!"
271
480
  ```
272
481
 
482
+ ---
273
483
 
274
484
  ## Windows
275
485
 
276
- On Windows with Git for Windows installed, Claude Code routes hook and statusLine commands through Git Bash by default. Git Bash's MSYS2 runtime crashes transiently at startup, killing the command before it runs.
486
+ On Windows with Git for Windows, Claude Code routes hook and statusLine commands through Git Bash by default. Git Bash's MSYS2 runtime crashes transiently at startup, killing the command before it runs.
277
487
 
278
488
  **Fix: add `"shell": "powershell"` to every hook command and to `statusLine` in `~/.claude/settings.json`.**
279
489
 
280
- See [`settings.windows.example.json`](settings.windows.example.json) for the full working config. Key differences from Unix:
490
+ See [`settings.windows.example.json`](settings.windows.example.json) for the full working config. Key differences:
281
491
 
282
492
  ```json
283
493
  {
@@ -289,14 +499,14 @@ See [`settings.windows.example.json`](settings.windows.example.json) for the ful
289
499
  "matcher": "",
290
500
  "hooks": [{
291
501
  "type": "command",
292
- "command": "node C:/Users/YOUR_USERNAME/AppData/Roaming/npm/node_modules/hmem-mcp/dist/cli.js log-exchange",
502
+ "command": "node C:/Users/YOUR_USERNAME/AppData/Roaming/npm/node_modules/hmem/dist/cli.js log-exchange",
293
503
  "shell": "powershell"
294
504
  }]
295
505
  }]
296
506
  },
297
507
  "statusLine": {
298
508
  "type": "command",
299
- "command": "node C:/Users/YOUR_USERNAME/AppData/Roaming/npm/node_modules/hmem-mcp/dist/cli.js statusline",
509
+ "command": "node C:/Users/YOUR_USERNAME/AppData/Roaming/npm/node_modules/hmem/dist/cli.js statusline",
300
510
  "shell": "powershell"
301
511
  }
302
512
  }
@@ -305,6 +515,7 @@ See [`settings.windows.example.json`](settings.windows.example.json) for the ful
305
515
  Run `npm root -g` to get the correct `node_modules` path for your machine.
306
516
 
307
517
  > **statusLine on Windows:** Stable with `"shell": "powershell"`. Without it the statusline disappears intermittently.
518
+
308
519
  ---
309
520
 
310
521
  ## Troubleshooting
@@ -313,7 +524,8 @@ Run `npm root -g` to get the correct `node_modules` path for your machine.
313
524
  |---------|-----|
314
525
  | `read_memory()` fails | Check `HMEM_PROJECT_DIR` is absolute path and directory exists |
315
526
  | nvm: `node not found` | Use absolute path: `which node` → use as `"command"` |
316
- | Hooks not firing | Restart Claude Code. Check `~/.claude/settings.json` has all 4 hooks |
527
+ | Hooks not firing (Claude Code) | Restart Claude Code. Check `~/.claude/settings.json` has all 4 hooks |
528
+ | Hooks not firing (Pi) | Known issue — Pi hook integration is currently broken. Use `hmem checkpoint` manually as a workaround |
317
529
  | Exchanges not logged | Check `HMEM_AGENT_ID` matches your `Agents/` directory name |
318
530
  | Sync fails | Run `npx hmem-sync connect` to re-authenticate |
319
531
 
@@ -322,9 +534,9 @@ Run `npm root -g` to get the correct `node_modules` path for your machine.
322
534
  ## Updating
323
535
 
324
536
  ```bash
325
- npm update -g hmem-mcp # MCP server
326
- npm update -g hmem-sync # Sync (if installed)
327
- npx hmem update-skills # Refresh skill files
537
+ npm update -g hmem # MCP server + SDK
538
+ npm update -g hmem-sync # Sync (if installed)
539
+ npx hmem update-skills # Refresh skill files
328
540
  ```
329
541
 
330
542
  ---
@@ -0,0 +1,27 @@
1
+ /**
2
+ * cli-checkpoint-agent.ts
3
+ *
4
+ * Provider-agnostic agentic loop for the checkpoint agent.
5
+ * Replaces the `claude -p --model haiku` subprocess spawn.
6
+ *
7
+ * Supports: Anthropic (native), OpenAI-compatible (OpenAI, DeepSeek, Groq, etc.)
8
+ */
9
+ import { HmemStore } from "./hmem-store.js";
10
+ import { HmemConfig } from "./hmem-config.js";
11
+ export type Harness = "claude-code" | "codex" | "opencode" | "pi" | "hermes" | "unknown";
12
+ /**
13
+ * Detect which AI harness invoked us. Honors explicit HMEM_HARNESS override first
14
+ * (plugins/extensions should set this when they spawn `hmem checkpoint`); falls
15
+ * back to env-var signatures the harnesses set themselves.
16
+ */
17
+ export declare function detectHarness(): Harness;
18
+ /**
19
+ * Harness-aware provider routing:
20
+ * - Claude Code → Haiku via `claude -p` subprocess (uses Max OAuth, no API key)
21
+ * - Codex → gpt-5.4-mini via OpenAI API (uses OPENAI_API_KEY)
22
+ * - OpenCode / Pi / Hermes / unknown → user's configured provider (hmem.config.json)
23
+ *
24
+ * The harness routing takes precedence over the configured provider — Claude Code
25
+ * users explicitly want Haiku-via-OAuth (covered by Max), not their DeepSeek key.
26
+ */
27
+ export declare function runCheckpointAgent(prompt: string, store: HmemStore, config: HmemConfig, hmemPath?: string): Promise<void>;