minnimemory 1.0.0-beta.2 → 1.1.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 (68) hide show
  1. package/CHANGELOG.md +428 -0
  2. package/LICENSE +45 -39
  3. package/README.md +391 -771
  4. package/examples/CLAUDE.md +76 -75
  5. package/examples/README.md +4 -0
  6. package/package.json +14 -8
  7. package/pkg/chunks/chunk-FYGMGFCY.js +142 -0
  8. package/pkg/chunks/chunk-UJQBI7J7.js +40 -0
  9. package/pkg/chunks/mcpServer-6F6JX4WA.js +2 -0
  10. package/pkg/cli.js +320 -0
  11. package/pkg/index.d.ts +27 -0
  12. package/pkg/index.js +2 -0
  13. package/dist/bench.d.ts +0 -31
  14. package/dist/bench.js +0 -111
  15. package/dist/benchReport.d.ts +0 -4
  16. package/dist/benchReport.js +0 -120
  17. package/dist/bounds.d.ts +0 -16
  18. package/dist/bounds.js +0 -25
  19. package/dist/cli.d.ts +0 -6
  20. package/dist/cli.js +0 -616
  21. package/dist/compile.d.ts +0 -90
  22. package/dist/compile.js +0 -389
  23. package/dist/discover.d.ts +0 -22
  24. package/dist/discover.js +0 -399
  25. package/dist/doctor.d.ts +0 -4
  26. package/dist/doctor.js +0 -60
  27. package/dist/episodic.d.ts +0 -18
  28. package/dist/episodic.js +0 -104
  29. package/dist/hook.d.ts +0 -13
  30. package/dist/hook.js +0 -69
  31. package/dist/index.d.ts +0 -13
  32. package/dist/index.js +0 -13
  33. package/dist/init.d.ts +0 -117
  34. package/dist/init.js +0 -493
  35. package/dist/install.d.ts +0 -40
  36. package/dist/install.js +0 -101
  37. package/dist/instructions.d.ts +0 -16
  38. package/dist/instructions.js +0 -180
  39. package/dist/mcp.d.ts +0 -109
  40. package/dist/mcp.js +0 -252
  41. package/dist/mcpServer.d.ts +0 -17
  42. package/dist/mcpServer.js +0 -703
  43. package/dist/paths.d.ts +0 -4
  44. package/dist/paths.js +0 -26
  45. package/dist/recall.d.ts +0 -42
  46. package/dist/recall.js +0 -163
  47. package/dist/recallDir.d.ts +0 -17
  48. package/dist/recallDir.js +0 -138
  49. package/dist/reorganize.d.ts +0 -31
  50. package/dist/reorganize.js +0 -150
  51. package/dist/report.d.ts +0 -9
  52. package/dist/report.js +0 -185
  53. package/dist/router.d.ts +0 -56
  54. package/dist/router.js +0 -227
  55. package/dist/rules.d.ts +0 -15
  56. package/dist/rules.js +0 -515
  57. package/dist/scan.d.ts +0 -75
  58. package/dist/scan.js +0 -135
  59. package/dist/text.d.ts +0 -48
  60. package/dist/text.js +0 -278
  61. package/dist/tokenizer.d.ts +0 -3
  62. package/dist/tokenizer.js +0 -39
  63. package/dist/types.d.ts +0 -80
  64. package/dist/types.js +0 -13
  65. package/dist/version.d.ts +0 -1
  66. package/dist/version.js +0 -1
  67. package/dist/writeProtocol.d.ts +0 -5
  68. package/dist/writeProtocol.js +0 -31
package/CHANGELOG.md ADDED
@@ -0,0 +1,428 @@
1
+ # Changelog
2
+
3
+ All notable changes to the `minnimemory` package. Dates are publish dates; an entry that has not
4
+ been published yet says `unreleased` and gets its date on the day it goes out.
5
+
6
+ ## 1.1.0 - 2026-10-06
7
+
8
+ - Kept: the memory-folder list header still says "Read one file, not its siblings." Dropping it
9
+ made the agent search the routed file instead of opening it, and a measured working session
10
+ saved 15% instead of 27%.
11
+ - Fixed: an `@import` written with a Windows drive-letter path (`@C:/...` or `@C:\...`) is
12
+ found like any other import, so the map, the always-loaded total and the audit count the file
13
+ Claude Code loads. A folder apply rewrites such a line into `AlwaysOnMemory/` with the slashes
14
+ it was written with, and undo restores it.
15
+ - Fixed: `init` and `doctor` on a pointer `CLAUDE.md` (`@AGENTS.md`) measure MM001 against the
16
+ same budget the plan uses: a share of the file the pointer names, not the 2,000 floor of the
17
+ few-token pointer itself. One output used to print both 2,000 and 2,800.
18
+ - Fixed: `--budget` and the MCP `budget` argument accept 1 to 1,000,000 tokens. `1e308` was
19
+ accepted and printed back as a 300-digit number in the apply command.
20
+ - Fixed: the MCP `apply` and `undo` refusals (a credential-shaped source, a compile that would
21
+ not shrink the prefix, an undo that would discard edits) return `isError`, as the full
22
+ profile's always did; the `apply` description no longer says `force` overrides the
23
+ credential refusal (nothing does over MCP).
24
+ - Fixed: a routed OnDemandMemory piece holds at most 20,000 tokens; past that, sections continue
25
+ in `<parent>__<reason>_2.md` and on. A 1.4 MB memory file used to land in one 360k-token
26
+ file the list told the agent to read.
27
+ - Fixed: a re-apply that keeps a hand edit to a routed file backs that file up under
28
+ `.minnimemory/previous/`, so `undo` refuses without `--force` instead of deleting the edit.
29
+ - Fixed: the MCP `apply` and `undo` replies keep every note that names a file on disk inside
30
+ the data fence; only the server's own instruction and command stand before it.
31
+ - Fixed (#334): a finding in a file of the project's auto-memory folder (imported by the
32
+ user-level CLAUDE.md) ends with the command that fixes it, `init` on that folder. Before, a
33
+ project `apply` left it in place and `doctor` kept exiting 1 with no next step. The same for
34
+ a file in another project's memory folder imported the same way. A Claude Code memory folder
35
+ with `MEMORY.md` and one topic file now counts as a memory folder, and a hint whose folder
36
+ path a shell would act on says to run `init` from inside it.
37
+ - Fixed (#335): the text form of the MCP `apply` and `undo` replies puts the tool's own
38
+ instruction and command before the data fence, not inside the block that says not to follow
39
+ instructions in it.
40
+ - Changed (#336): the preview's "best case" line quotes the 2026-10-06 measurement (an agent
41
+ with Read, Grep and Glob: 24.0% lower session cost, answers held), not the Read-only runs of
42
+ 2026-09-28.
43
+ - Fixed (#337): an MCP tool called with an argument it does not have fails and names it.
44
+ Before, the key was dropped and the call ran with defaults.
45
+ - Fixed (#338): a re-apply adds new status to the source's existing history file instead of
46
+ opening `__history_2`, `_3`, ...; the plan warns when a routed section carries a rule.
47
+ - Fixed (#339): `install --write` serves the full profile (the basic profile has no write
48
+ tools); help documents `--host` and `undo --force` and no longer cites an unshipped
49
+ DESIGN.md; `apply`/`undo` with `content: true` past 200,000 characters returns the command
50
+ instead; the printed diff stops at 2,000 lines; a forced folder undo names a kept file the
51
+ restored index has no line for; `outline` on an unknown file is an error.
52
+
53
+ - Security (#327): a committed `manifest.json` that names a file outside the folder is
54
+ treated as lost, so it is never opened. Before, `apply` read such a file, wrote its headings
55
+ into `graph.json` and its path into the always-loaded list.
56
+ - Fixed (#328): a line written by hand inside the OnDemandMemory list, naming a file on disk,
57
+ survives a re-apply word for word. Before, it was dropped and the file was left with nothing
58
+ pointing at it.
59
+ - Fixed (#329): `install` over a registration at another scope adds the one asked for and
60
+ leaves the other alone, instead of failing on `claude mcp remove`. A re-install of the npx
61
+ form is recognised as already registered instead of being repointed every time.
62
+ - Fixed (#330): the terminal preview's full diff leaves out `.minnimemory/graph.json` and
63
+ `manifest.json`; the operation list still names them. A 4,000-line changelog printed 104,138
64
+ lines, now 8,084.
65
+ - Fixed (#331): `install` replaces Claude Code's `settings.json` whole or not at all.
66
+ - Fixed (#332): a merged OnDemandMemory file is described as "first through last" once,
67
+ `--budget` takes whole numbers only, `engines` is `node >=18.3` (the CLI uses
68
+ `util.parseArgs`), and the lockfile no longer pins dependency versions with advisories.
69
+
70
+ - Fixed (#298): `doctor --budget 2000` is used as given, not replaced by the compiled or
71
+ default budget. Before, an explicit 2,000 read as "no budget given", so MM001 measured
72
+ against another number than the summary line printed, and `doctor --budget 2000 --ci`
73
+ passed a file it called over budget. With no `--budget`, MM001 still reads the compiled
74
+ budget, and the summary line now prints the budget MM001 used.
75
+ - Fixed (#303): the memory map no longer calls a `CLAUDE.md` that only mentions `AGENTS.md` a
76
+ pointer while listing `AGENTS.md` as not loaded. The setup block says the host names the file
77
+ but does not import it, and the not-loaded line says to make `CLAUDE.md` hold `@AGENTS.md`.
78
+ - Fixed (#304): apply after a host rename names the renamed backup
79
+ (`CLAUDE.md.bak -> AGENTS.md.bak`) and says the host was renamed, over MCP too.
80
+ - Docs (#299): the 40 percent saving holds only above the 2,000-token floor, about 3,300
81
+ tokens of host file.
82
+ - Added: the memory map that opens `init` starts with a `setup` block: the host file, the file
83
+ it points at when it is only a pointer, the one file `apply` rewrites, and whether it is
84
+ compiled. When the project holds an `AGENTS.md` that Claude Code does not load, the map ends
85
+ with a `not loaded by Claude Code` group naming each one and the reason. `init --json` and
86
+ the MCP reply carry both as `setup` and `notLoaded`.
87
+ - Fixed: a compiled host file renamed afterwards (`CLAUDE.md` to `AGENTS.md`, with or without
88
+ a pointer left behind) is the same host. Before, `doctor` reported the old name as missing or
89
+ edited and said to re-apply, `apply` answered "nothing to apply", and the two never agreed.
90
+ Now `doctor` reports the rename once, one `apply` carries the manifest and the backups over
91
+ to the new name, and `undo` restores the original into the file that holds the memory now.
92
+ - Fixed (#297): a pointer `CLAUDE.md` rewritten by hand, so that it no longer reaches the
93
+ compiled file, is reported as drift. `doctor` names both files and says what to do (put the
94
+ pointer back, or `undo` and then `apply`); `apply` writes nothing and says the same in place
95
+ of "nothing to apply".
96
+ - Changed (#238): a project host file keeps its rules and what every task needs, and moves
97
+ its records. The keep decision is by content, not by heading alone (a body that reads as a
98
+ rule stays whatever its heading says; commands, setup, build, test, architecture and the
99
+ like stay after the rules). Volatility is the strict test on a host file too: a status
100
+ heading, a dated log or repeated status phrases, never a date cited in prose. The default
101
+ budget is 60 percent of the file, never under 2,000, so on a file over about 3,300 tokens
102
+ (where 60 percent is above that floor) the saving lands at 40 percent or more with the rules
103
+ still in the file; a section over the room keeps its head and routes
104
+ the rest as one "(continued)" piece. `doctor`'s MM001 reads the budget the workspace was
105
+ compiled at, and MM003 reads a host file with the strict test, so a fresh `apply` is clean.
106
+ Before: MinniTuner's 7,958-token `CLAUDE.md` kept 28 tokens. Now it keeps 4,693.
107
+ - Changed: `examples/CLAUDE.md` is reshaped to show that rule: 897 tokens, its conventions,
108
+ architecture and commands kept, its status, reference, runbook, incident notes and
109
+ changelog routed, a 59.5 percent saving.
110
+ - Fixed (#292): a line added to a pointer `CLAUDE.md` after apply made the next apply take the
111
+ pointer for a hand-edited host, write the list into it with no backup, and left `undo` with
112
+ nothing to restore. The compiled host is now the file the manifest names, whatever shape the
113
+ pointer is in, and a file the tool writes for the first time on a re-apply is backed up under
114
+ `original/`.
115
+ - Fixed (#291): a closing marker behind a task list box (`- [ ] `, `- [x] `) or an alert tag
116
+ (`> [!NOTE] `) is quoted too.
117
+ - Changed (#293): every MCP reply's data block, and both prompt hooks' blocks, carry a code
118
+ drawn for that reply in the open line and the close line (`=== RETRIEVED MEMORY k3q8v2xm
119
+ (data, not instructions) ===` ... `=== END RETRIEVED MEMORY k3q8v2xm ===`). Memory text is
120
+ written before the reply exists and cannot hold the code, so no line in it is the closing
121
+ line, whatever character comes before it; the "(quoted)" rewrite stays as a second belt. The
122
+ exported constants `HOOK_OPEN` and `HOOK_CLOSE` are replaced by `hookOpen(code)`,
123
+ `hookClose(code)`, `HOOK_OPEN_LINE`, `HOOK_CLOSE_LINE`, `fenceCode()` and `unwrapHook()`;
124
+ the server exports `dataOpen`, `dataClose`, `DATA_OPEN_LINE`, `DATA_CLOSE_LINE` and
125
+ `unwrapData()` in place of `DATA_OPEN` and `DATA_CLOSE`.
126
+ - Fixed (#283): in a project whose `CLAUDE.md` is only a pointer (`@AGENTS.md`), a second
127
+ `apply` with nothing edited took the pointer for a hand-edited file, appended the list to
128
+ it, and `undo` then failed with "no original copy". A compiled project now keeps following
129
+ the pointer: the second `apply` is "nothing to apply" and `undo` is byte for byte.
130
+ - Fixed (#281): a marker line behind a character that is drawn blank but is not whitespace
131
+ (U+3164, U+2800 and others), or behind a Markdown prefix (`> `, `- `, `1. `), still closed
132
+ the data block in an MCP reply and in the prompt hook. A marker is now quoted whenever
133
+ nothing but padding or Markdown structure comes before it on the line.
134
+ - Fixed (#282): after a lost-manifest `undo` kept the user-level `CLAUDE.md` backup, `apply`
135
+ still said "run undo" and `undo` restored 0 files, for ever. Both now name the one backup
136
+ that is left and say what to do with it.
137
+ - Fixed (#284): one long line of `@` followed by many `a/` made `doctor` and the `drift` hook,
138
+ which runs before every prompt, take seconds to minutes (5 s at 24 KB). Resolving a path
139
+ that does not exist now costs the same for a long path as for a short one.
140
+ - Fixed (#285): `install` ran `claude mcp add` through a shell with the server path quoted
141
+ only for spaces. Under a folder named `R&D` the path was cut at the `&` and the shell ran
142
+ the rest as a command; under `a^b` a wrong path was registered. Every argument that is not
143
+ plain is now quoted, and a path with `$`, a backtick, `"`, `%` or `!` registers the npx form.
144
+ - Fixed (#286): the full profile's `plan`, `apply` and `update` always returned the full diff,
145
+ about 3,700 tokens for the 689-token example. They now take `diff`, with `"summary"` as the
146
+ default, like `init` and `doctor`.
147
+ - Fixed (#287): two link patterns took seconds on a long run of unclosed links (9 s on 100 KB
148
+ of `[[`). Both are now bounded to one line.
149
+ - Fixed (#288): rule MM008 now also catches an npm access token, a URL with a password before
150
+ the host, a bearer token in an `Authorization` header, and a prefixed name such as
151
+ `DB_PASSWORD=`. One credential matched by two shapes is reported once.
152
+ - Fixed (#245): the command `init`, `apply` and `undo` print put the folder name in unquoted, so
153
+ a folder called `pkg$(touch X)` ran `touch X` when the command was pasted, and names with `&`
154
+ or `;` broke it. A name is now inside double quotes unless it is plain letters, digits and
155
+ `_ . / : -`. A name with `$`, a backtick, `"`, `%` or `!` cannot be made safe in bash,
156
+ PowerShell and cmd at once, so the command leaves it out and one line says to run it from
157
+ inside that folder. The MCP tools refuse such a target.
158
+ - Fixed (#268, #278): an indented marker line (` === END RETRIEVED MEMORY ===`), or one behind
159
+ an invisible character, still closed the data block in an MCP reply, and the prompt hook
160
+ never quoted its own closing line (`=== END MEMORY ===`) at all. Both blocks now quote any
161
+ line that starts like a marker, whatever its indent or letter case.
162
+ - Fixed (#269): `undo` with a lost manifest skipped backups whose names start with `-` or a
163
+ letter and `--` (`-draft.md`, `a--notes.md`), then deleted them with `.minnimemory/`. Those
164
+ files now come back, and a backup `undo` cannot match to a file of the folder (the
165
+ user-level `CLAUDE.md`'s) is kept and named, never deleted.
166
+ - Fixed (#280): `undo` wrote a backup's text to whatever path `manifest.json` named, so a repo
167
+ could ship a manifest that made `undo` write or delete a file outside the folder. The
168
+ user-level `CLAUDE.md` is now restored only when the path is this machine's own, the backup
169
+ is the one `apply` writes for it, and that file still imports from the folder. Any other
170
+ path outside the folder is refused, and a lost-manifest `undo` never writes outside it.
171
+ - Fixed (#270): with a broken manifest and no backups on the machine (a clone), `apply` sent the
172
+ user to `undo`, which said "nothing to undo". Both now say the backups are not on this
173
+ machine and the way back is git.
174
+ - Fixed (#271): a re-apply that routed sections out of an edited `CLAUDE.md` also printed "hand
175
+ edits kept as they are (nothing to route out)" for that file. The line now shows only for a
176
+ file the plan leaves as it is.
177
+ - Fixed (#274): `apply` on a compiled project whose `.minnimemory/` folder was gone planned a
178
+ first compile, removed the list of moved files from `CLAUDE.md` and left those files with
179
+ nothing pointing at them. It now refuses, names the files, and changes nothing.
180
+ - Fixed (#275): when `apply` could not write a file (read-only, locked by another program, full
181
+ disk) it stopped half way with a stack trace and left backups and moved files behind with no
182
+ manifest. It now puts back everything that run wrote and prints one clear error.
183
+ - Fixed (#276): a memory file with only blank lines got the verdict "compile" and four
184
+ bookkeeping files to save 2 tokens, and an empty file printed "break-even -1 tokens". A first
185
+ compile that moves nothing is now "leave", and the break-even is never under zero.
186
+ - Fixed (#277): `--help` now lists the `loaded` command that `install` adds as a hook.
187
+ - Fixed (#246): with `.minnimemory/manifest.json` missing or unreadable (a git conflict is
188
+ enough), `apply` planned a first compile, backed up the trimmed file over the real original
189
+ and dropped the list. It now refuses and changes nothing; `apply` never writes over a backup
190
+ under `original/`; `doctor` names the state once instead of advising a re-apply; and `undo`
191
+ (with `--force`, since it cannot see edits) restores every backup from `original/`.
192
+ - Fixed (#247): `undo` listed `.claude/` (and `.claude/OnDemandMemory/`) for deletion even when
193
+ it held the project's settings or a hand-written file, and told a host that cannot run
194
+ commands to delete every listed path. A folder is now listed only when everything in it
195
+ leaves with the undo.
196
+ - Fixed (#248): memory text holding the data block's own closing line ended the block early in
197
+ every read tool's reply. Such a line is now shown with "(quoted)" and a note; the JSON form
198
+ is unchanged.
199
+ - Fixed (#249, full profile): `update` wrote a first compile that `apply` had refused; it now
200
+ re-applies only. The server instructions name exactly the tools loaded; `plan` lost its dead
201
+ `update` option; `doctor` refuses an unknown rule id; `apply`'s description matches what it does.
202
+ - Fixed (#250): one routed file deleted by hand made `recall` fail for every question. It is
203
+ now skipped and named, `modules` marks it missing, and the advice says to re-apply, not
204
+ "rerun init".
205
+ - Changed (#251): `undo`, MM011 and the README now say plainly that undo works only on the
206
+ machine that ran `apply` (the backups are gitignored); on a clone the way back is git history.
207
+ - Fixed (#252): a re-apply's plan said "saves -2 tokens" and "costs 7,924 more than today". It
208
+ now says "verdict: re-apply" with the before and after size, and no break-even.
209
+ - Fixed (#253): a re-apply after a hand edit backed the host file up twice.
210
+ - Fixed (#254): a very small file gained a made-up "<title> overview" heading, a "kept out"
211
+ line for a section that stayed, and a negative break-even. None of the three appear now.
212
+ - Fixed (#255): MCP replies named terminal flags and commands (`--budget`, `--force`,
213
+ `--allow-secrets`, `node ... apply`); they now name the tool's options and `apply()`. The
214
+ terminal output is unchanged. The auto-memory install hint is built in `commands.ts`.
215
+ - Added (#256): `init` with `format: "json"` (MCP) and `init --json` (terminal) carry the
216
+ memory map under `map`.
217
+ - Fixed (#257): `content: true`'s text form used a three-backtick fence for every file, so a
218
+ file with its own code block broke the split. Each fence is now longer than any run inside.
219
+ - Changed: the preview no longer uses one label for two totals. `doctor`'s check says
220
+ `all always-loaded files`; the plan says `always-loaded, files this plan rewrites`. Scripts
221
+ that read the old `always-loaded prefix:` line need the new text.
222
+ - Changed: a compile plan now says its saving is a best case (kept only on turns that open none
223
+ of the moved files) and cites the measured sessions.
224
+ - Added: a plan warning when a file keeps under a tenth of its tokens, so rules going out with
225
+ the rest are visible. Routing itself is unchanged.
226
+ - Fixed: the `minnimemory` command printed nothing on Linux and macOS when run through npm's
227
+ symlink (`npx -y minnimemory --version`). It now compares real paths. `install` registers the
228
+ real file, not the symlink. 1.0.0 has this bug, so it needs a new release.
229
+ - Fixed: MM002 no longer calls a table of paths and commands a directory listing.
230
+ - Fixed: `apply` drops list keywords from the end so the lines it writes stay under the MM006
231
+ cap (120 characters, one keyword at least). Lines already under the cap are unchanged.
232
+ - Fixed: diff headers no longer show `a//home/...` for an absolute path.
233
+ - Added (tests only, no change to the package): the compatibility test. Each release saves its
234
+ compiled sample repo as a fixture (`scripts/save-compat-fixture.mjs`, run on the bundled
235
+ build), and `tests/compat.test.ts` checks this build still reads every fixture inside the
236
+ support window of 6 months or 3 minor versions: `doctor` has no high finding, and every
237
+ routed piece is still listed and found. A release that breaks one must be a major. The
238
+ Minni orchestrator's launcher relies on it (Suite/MinniHQ/docs/DESIGN.md 0.9). The
239
+ fixture for 1.0.0 is saved.
240
+
241
+ ## 1.0.0 - 2026-09-27
242
+
243
+ The first stable release. Prepared 2026-09-22, published 2026-09-27 as `latest`; `1.0.0-beta.2`
244
+ (2026-09-18) stays on the `beta` tag.
245
+
246
+ - Changed (2026-09-27): `init` opens with the map of every file Claude Code loads for the
247
+ project, from Claude Code's documented rules: managed policy, user `CLAUDE.md` and
248
+ `~/.claude/rules/`, `CLAUDE.md` / `.claude/CLAUDE.md` / `CLAUDE.local.md` here and in every
249
+ folder above, `AGENTS.md` when no `CLAUDE.md` exists, recursive and `paths:`-scoped rules,
250
+ subfolder files, imports and auto memory, each with when it loads, whose it is and its tokens.
251
+ `--map` prints only the map.
252
+ - Added: `install` registers an `InstructionsLoaded` hook (`minnimemory loaded`) that records what
253
+ Claude Code actually loads per project, machine-local; `init` checks its map against it and
254
+ `doctor` reports a file Claude loaded that the map missed (MM016). `install --remove` removes it.
255
+ - Fixed: the always-loaded total now counts user rules, the managed policy file, parent folders'
256
+ CLAUDE files and nested rules, and no longer counts `paths:`-scoped rules; a host at
257
+ `.claude/CLAUDE.md` is found and compiled with its manifest at the project root.
258
+
259
+ - Fixed (2026-09-27, macOS dev run): the auto-memory folder and the load log are found the way
260
+ Claude Code keys them. A project reached through a symlink (macOS `/tmp` and `/var` point into
261
+ `/private`, or a `~/dev` linked to another drive) is keyed by its real path, with the path as
262
+ typed as a fallback; a git worktree, and any folder inside it, shares the main checkout's
263
+ folder, as the Claude Code memory docs say. Before, both missed that memory. doctor's note on a
264
+ repo's own `autoMemoryDirectory` now says Claude Code does use it in a trusted folder and that
265
+ minnimemory still does not follow it (the 2026-09-26 security decision stands).
266
+ - Fixed (2026-09-27, end-to-end dev run): an `@path` import line in a section apply routes out
267
+ now stays in the always-loaded file, under `## Imports`. Claude Code follows imports only from
268
+ files it loads at session start, so a routed import had silently stopped its file loading.
269
+
270
+ - Fixed (2026-09-27, hands-on audit of the map): `AGENTS.md` is read when the only CLAUDE file
271
+ above is the user's own `~/.claude/CLAUDE.md` or an excluded one (the map was empty for an
272
+ AGENTS.md repo under the home folder). Printed commands use forward slashes, so Git Bash no
273
+ longer strips a Windows target path. The map says when its subfolder scan stopped at its cap;
274
+ `doctor` and the drift hook skip that scan, and MM016 builds the map only once a load log
275
+ exists (doctor on a 6,000-folder tree: 4.3 s to 0.2 s). `loaded` resolves a relative path
276
+ against the session's folder, and the map ignores logged files that no longer exist.
277
+
278
+ - Fixed (2026-09-27, messy-developer live proof): a hand edit apply has nothing to route out of (a
279
+ sorted rule file, or `MEMORY.md` outside its list) is kept byte for byte and taken as the new
280
+ baseline, so the MM010 drift it raised clears; before, `apply` said "nothing to apply" and the
281
+ drift never cleared. The accepted file is backed up under `previous/`, so `undo` still names it.
282
+ `undo` with `force: true` over MCP returns a command that carries `--force`.
283
+ - Fixed (2026-09-27, pre-publish audit): a project host file's budget is now that file's alone.
284
+ The user-level `~/.claude/CLAUDE.md`, its imports, the auto-memory index and `.claude/rules`
285
+ stay in MM001 (the audit line) but no longer enter the plan's before/after, share or manifest, so a machine with a
286
+ large user-level memory no longer compiles every project `CLAUDE.md` down to its title line,
287
+ and the MCP server's plan (made without the user-level host unless launched with
288
+ `--include-auto-memory`) hashes the same as the CLI's, so the printed `apply --plan` runs.
289
+ - Fixed: `install` quotes the arguments it hands the shell on Windows, so a cli path with a
290
+ space (`C:\Users\First Last\...`) registers as one argument and the server starts.
291
+ - Fixed: a source that is not valid UTF-8 is refused instead of rewritten (and backed up) with
292
+ replacement characters; a CRLF source is rewritten with CRLF.
293
+ - Fixed: `undo` refuses without `--force` when a compiled file was edited since the last apply
294
+ or the workspace was re-applied since the first, naming what it would discard.
295
+ - Fixed: MM008 also recognises `sk-proj-` OpenAI keys, AWS secret access keys and plain
296
+ `password:`/`api_key=` assignments that look like a real value.
297
+ - Fixed: `.minnimemory/.gitignore` (replacing `original/.gitignore`) keeps `original/`,
298
+ `previous/` and the drift stamp out of git; a re-apply of an older workspace adds it.
299
+ - Fixed: the memory-folder plan no longer says "nothing here is volatile" beside a routed
300
+ history piece, or offers a budget that saves a negative number; the CLI's dry-run line prints
301
+ the apply command on its own line; `install` warns when it registers a copy in the npx cache;
302
+ a `--budget -5` error says how to write it.
303
+
304
+ - Changed (2026-09-27, workflow audit): over MCP, `apply` and `undo` return the command to run
305
+ (`npx -y minnimemory apply --plan <hash> [target]`, `npx -y minnimemory undo [target]`) and
306
+ the operation list with paths and line deltas, never file content, unless called with
307
+ `content: true` (for a host that cannot run commands). An `apply` on the example file went
308
+ from about 3,500 tokens to about 240; on an 85-file memory folder from about 13,400 to about
309
+ 300 (moves are grouped by destination). The command names the target whenever it is not the server root (absolute for the
310
+ auto-memory folder) and always uses the `npx` form, so it runs as printed; the CLI's `init`
311
+ and `doctor` print the same real command (`init` used to print a literal `<hash>`).
312
+ - New (2026-09-27): verdict `sort`. A memory-folder plan that recompiles no always-loaded file
313
+ and only moves loose topic files says so, with what the sort costs or saves per turn, instead
314
+ of "compile ... saves -173 tokens".
315
+ - Changed (2026-09-27, MCP live proof): the operations block prints paths relative to the root
316
+ the header names, groups backups and moves per destination folder, and `doctor`/`init` over
317
+ MCP show four findings per rule (`format: "json"` keeps every one). On a real 78-file memory
318
+ folder a summary `doctor` went from about 11,000 tokens to about 3,500 and `apply` from about
319
+ 3,300 to about 900. The CLI prints the same shorter block.
320
+ - Fixed (2026-09-27, MCP live proof): `apply` is a fixed point. The command `apply` returns
321
+ (and the CLI's next-step line) carries the budget the plan was made with, `--force` on a leave
322
+ verdict and the CLI's own `--profile`/`--episodic-json`, so the hash is recomputed from the
323
+ same plan (a real agent got "the plan on disk no longer matches" for a plan made at `--budget
324
+ 12000`). The plan's `after` now counts the user-level CLAUDE.md import lines growing by
325
+ `AlwaysOnMemory/`. The manifest records the budget it was applied with, and a re-apply with no
326
+ `--budget` or the same one leaves every undrifted compiled source alone instead of re-sharing
327
+ the pool over the trimmed sizes and trimming again; a different `--budget` recompiles.
328
+ - Fixed (2026-09-27, MCP live proof): `install` writes the user-scope drift hook into the
329
+ Claude Code config dir's `settings.json` (`CLAUDE_CONFIG_DIR` when set), not always `~/.claude`;
330
+ under a relocated config dir it wrote the hook into the wrong file. The commands the tool
331
+ prints call the installed copy directly (`node "<path>/cli.js" apply ...`) when the CLI knows
332
+ where it runs from, so the plan hash is recomputed by the build that made it; `npx -y
333
+ minnimemory` is the fallback.
334
+ - Fixed (2026-09-27, live proof): a memory saved into a topic file the sort only moved is no
335
+ longer reported as drift by `doctor` or the drift hook; MM010 checks the files the tool
336
+ rewrote and the routed pieces, as DESIGN.md 6.11 decision 3 always said. The sorted index's
337
+ header now names the folder its paths are relative to (in full for the machine-local Claude
338
+ Code memory folder), after the live proof's agent resolved `OnDemandMemory/pc_setup.md`
339
+ against the project directory first and wasted two reads.
340
+ - Fixed (2026-09-27): the drift hook now also checks the project's Claude Code auto-memory
341
+ folder, whose `.minnimemory/` lives outside the project; it never fired there before. The
342
+ hook costs about 0.15 s per prompt (was 0.35 s): the CLI loads the MCP SDK only for the
343
+ `mcp` command.
344
+ - Changed (2026-09-27): `install` registers the MCP server as a direct call to the installed
345
+ copy (`node "<path>/cli.js" mcp`), the same form as the drift hook, so Claude Code does not
346
+ re-resolve the package through `npx` on every launch; a registration that runs a different
347
+ command is repointed on the next `install` without `--force`. `npx -y minnimemory mcp` stays
348
+ the form for other hosts' JSON snippets and when `install` cannot tell where it runs from.
349
+ - Fixed (2026-09-27): `apply` renders its report before writing, so every write shows its real
350
+ line delta (was `+0 -0`) and an empty `diff:` header no longer appears; it ends with what it
351
+ wrote and the undo command. `doctor`'s drift lines and the MCP error for an unflagged
352
+ `auto-memory` target name the exact command to run next.
353
+ - First stable release. Same four verbs as the betas: `doctor`, `init`, `apply`, `undo`, in the
354
+ terminal and over MCP (`--profile basic`, the default); the seven-tool `--profile full` is unchanged.
355
+ - New: `init` and `doctor` are one preview. Both print the audit, then a unified diff of every
356
+ file `apply` would write, then the next step ("run apply", or "nothing to apply"). `doctor`
357
+ keeps its CI exit code. `init` is the first-time name, `doctor` the returning one.
358
+ - New: memory folders compile. `apply`/`undo` on an index plus topic files, or on a
359
+ project's Claude Code auto-memory folder, used to answer "nothing to compile"; now every
360
+ always-loaded topic file the index (or the user-level host) imports sorts into
361
+ `AlwaysOnMemory/`, trimmed in place; every other topic file sorts into `OnDemandMemory/`,
362
+ untouched; routed pieces join it there, one piece per parent per reason
363
+ (`<parent>__history.md`, `<parent>__detail.md`), not one per section. A project root goes
364
+ through the same engine: the host file is trimmed in place, routed pieces land in
365
+ `.claude/OnDemandMemory/`. `undo` puts every file back byte for byte, including a workspace
366
+ compiled by the pre-reorganization layout (manifest v4/v5), which `doctor` now names as such
367
+ and `apply`/`init` refuse ("run undo, then apply") rather than compile over it. DESIGN.md 6.10.
368
+ - New: `apply` returns operations (copy, move, write, delete) instead of full file content for a
369
+ backup or a sorted move, and carries a `plan` hash plus the exact `npx -y minnimemory apply --plan
370
+ <hash> [target]` command; the CLI's `apply` gains `--plan <hash>` and refuses when the plan on disk no
371
+ longer matches. Drift (MM010) tracks only what the tool wrote: a file saved into
372
+ `AlwaysOnMemory/`/`OnDemandMemory/` by hand is not drift. DESIGN.md 6.11.
373
+ - New: `doctor`/`init` take `diff: "summary"` (default over MCP) or `"full"`: the plan table plus
374
+ one line per file (action, path, lines added/removed), with the import rewrite and every move/
375
+ delete still shown in full. The CLI keeps the full diff by default. DESIGN.md 6.10.
376
+ - New (revised 2026-09-27): on a memory folder the import is the placement decision. Every
377
+ stable section of an imported file is a candidate to stay, whatever its heading says;
378
+ "volatile" means a status heading, a changelog-shaped body or repeated status phrases, never
379
+ a date cited in a rule's rationale (`doctor`'s MM003 reads imported files the same way). With
380
+ no `--budget` every stable section stays and only volatile sections move; when nothing is
381
+ volatile the plan says so and names what a lower budget would save, from a real second plan.
382
+ A lower `--budget` is shared fairly (a file that fits an equal share stays whole, the largest
383
+ files split the rest) and a heading-less file over its share keeps its leading paragraphs and
384
+ routes the rest as `<name>__detail.md`. A single host file keeps the flat 2,000 default. The
385
+ first cut (a proportional share of half the sources, hint-matched headings, the lenient
386
+ volatility scorer) hollowed the maintainer's own rule files to frontmatter shells. DESIGN.md
387
+ 6.10, decision 8.
388
+ - New: the always-loaded count includes `.claude/rules/*.md` and `CLAUDE.local.md`, which Claude
389
+ Code also auto-loads beside the host file, alongside the user-level `~/.claude/CLAUDE.md` and
390
+ its imports (behind `--include-auto-memory` over MCP; always in the terminal).
391
+ - Changed: when a project has no memory file but its auto-memory folder exists and was not
392
+ included, the error names the folder and the flag instead of listing places it did not look.
393
+ - Changed: over MCP, `apply` and `undo` accept the `auto-memory` target behind
394
+ `--include-auto-memory`, like `doctor` and `init`; paths outside the server root come back
395
+ absolute, with the folder named.
396
+ - Changed: `undo` gains `--force` (`force: true` over MCP) for a memory folder whose routed
397
+ files were edited since the last apply.
398
+ - Changed (2026-09-27): `install` writes the drift hook as a direct call to the installed CLI (`node "<path>/cli.js" drift`) instead of `npx -y minnimemory drift`: about 0.3 s per prompt instead of 1.3 to 1.7 s. An existing npx entry is updated in place; re-run `install` after an upgrade. `init()`'s MCP description is one line (basic tools/list 986 -> 940 tokens). The plan's verdict line states the per-turn arithmetic: the saving on a turn with no routed file open and the extra cost on a turn with every routed file open.
399
+ - Fixed (2026-09-27): `doctor`, `apply` and `undo` given the host file's path on a compiled workspace now read that workspace (they used to see a bare file, plan to strip its fenced list, and find nothing to undo). apply's write guard for a memory folder allows exactly the user-level host file outside the folder, not its whole directory. The MEMORY.md-as-host message points at `doctor`/`apply` on the folder. Dead write-protocol module and five unreachable exports removed. README, GUIDE and the site transcript regenerated from a real 1.0.0 run.
400
+ - New: `minnimemory drift`, a Claude Code `UserPromptSubmit` hook that prints one short notice when
401
+ a memory file changed since the last `apply`, once per change, nothing when clean.
402
+ `minnimemory install` turns it on by default now; `--no-hook` opts out.
403
+ - New: `minnimemory install --remove` removes the MCP registration and the drift hook `install`
404
+ added, leaving every other key and every other hook in Claude Code's settings untouched; every
405
+ successful `install` path prints the next step in one line.
406
+ - New: the `apply` refusal on a source too small to benefit (verdict "leave"), in the CLI and
407
+ over MCP, shows the always-loaded token count before and after, and the break-even figure.
408
+ - Removed: the compiler no longer adds section anchors to the OnDemandMemory list. They raised the
409
+ always-loaded prefix on every turn against a saving that was only ever projected, and no freshly
410
+ compiled workspace could produce one. Compiled output is otherwise unchanged. `doctor`'s MM014
411
+ stays, so a workspace compiled by an earlier version still gets told what its anchor lines cost.
412
+ - The package ships as a minified bundle (`pkg/`) with one public declaration file. Behaviour is
413
+ unchanged.
414
+ - The generated instruction block carries a one-line MinniAI copyright notice, and the LICENSE
415
+ gains a clause on the generated instructions. The LICENSE no longer calls itself a beta license.
416
+ - Claude Code is the only supported host; the README no longer documents other hosts.
417
+ - README rewritten terminal-first: install, first doctor, apply, undo, then use, commands,
418
+ security and license.
419
+
420
+ ## 1.0.0-beta.2 - 2026-09-18
421
+
422
+ - `minnimemory install` registers the server with Claude Code in one command; running the bare
423
+ package with no TTY starts the server, so MCP hosts can launch it directly.
424
+ - Shipped comments and strings scrubbed of internal paths; a leak check runs before every publish.
425
+
426
+ ## 1.0.0-beta.1 - 2026-09-17
427
+
428
+ - First public release on npm.
package/LICENSE CHANGED
@@ -1,39 +1,45 @@
1
- MinniMemoryMCP License (Beta)
2
-
3
- Copyright (c) 2026 MinniAI. All rights reserved.
4
-
5
- 1. Grant. MinniAI gives you a free, non-exclusive, non-transferable, revocable
6
- license to install and run this software package (the "Software"),
7
- unmodified, for your own use. Use inside your own company or for your own
8
- commercial projects is allowed.
9
-
10
- 2. Restrictions. You may not:
11
- (a) copy, redistribute, sublicense, sell, rent or host the Software for
12
- others;
13
- (b) modify, translate or create derivative works of the Software;
14
- (c) reverse engineer, decompile or disassemble the Software, except where
15
- applicable law forbids this restriction;
16
- (d) remove or alter any copyright or license notice in the Software.
17
-
18
- 3. Your files. The files the Software reads or writes on your machine (memory
19
- files such as CLAUDE.md, the .minnimemory folder, backups) are yours.
20
- MinniAI claims no rights in them. The Software makes no network calls and
21
- sends nothing off your machine.
22
-
23
- 4. Beta software. This is a pre-release version. Features, output and
24
- behaviour may change between versions without notice.
25
-
26
- 5. No warranty. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
27
- KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
29
- Back up your files before using write features such as --allow-write.
30
-
31
- 6. Limitation of liability. IN NO EVENT SHALL MINNIAI BE LIABLE FOR ANY
32
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
33
- OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
34
- THE USE OF OR OTHER DEALINGS IN THE SOFTWARE.
35
-
36
- 7. Termination. This license ends automatically if you break any of its
37
- terms. When it ends, stop using the Software and delete your copies.
38
-
39
- 8. Contact. https://minniai.com
1
+ MinniMemoryMCP License
2
+
3
+ Copyright (c) 2026 MinniAI. All rights reserved.
4
+
5
+ 1. Grant. MinniAI gives you a free, non-exclusive, non-transferable, revocable
6
+ license to install and run this software package (the "Software"),
7
+ unmodified, for your own use. Use inside your own company or for your own
8
+ commercial projects is allowed.
9
+
10
+ 2. Restrictions. You may not:
11
+ (a) copy, redistribute, sublicense, sell, rent or host the Software for
12
+ others;
13
+ (b) modify, translate or create derivative works of the Software;
14
+ (c) reverse engineer, decompile or disassemble the Software, except where
15
+ applicable law forbids this restriction;
16
+ (d) remove or alter any copyright or license notice in the Software.
17
+
18
+ 3. Your files. The files the Software reads or writes on your machine (memory
19
+ files such as CLAUDE.md, the .minnimemory folder, backups) are yours.
20
+ MinniAI claims no rights in them. The Software makes no network calls and
21
+ sends nothing off your machine.
22
+
23
+ 4. Generated instructions. The instruction text, rule text and structure
24
+ that the Software writes into your memory files (the "Generated
25
+ Instructions") are MinniAI's copyrighted work. You may keep and use them
26
+ in memory files on machines you control, for your own or your company's
27
+ AI agents. You may not extract, republish, redistribute or sell the
28
+ Generated Instructions, include them in another product or service, or
29
+ use them, in whole or in part, as training or evaluation data for a
30
+ machine learning model.
31
+
32
+ 5. No warranty. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
33
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
35
+ Back up your files before using write features such as --allow-write.
36
+
37
+ 6. Limitation of liability. IN NO EVENT SHALL MINNIAI BE LIABLE FOR ANY
38
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
39
+ OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
40
+ THE USE OF OR OTHER DEALINGS IN THE SOFTWARE.
41
+
42
+ 7. Termination. This license ends automatically if you break any of its
43
+ terms. When it ends, stop using the Software and delete your copies.
44
+
45
+ 8. Contact. https://minniai.com