minnimemory 1.3.6 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,7 +3,78 @@
3
3
  All notable changes to the `minnimemory` package. Dates are publish dates; an entry that has not
4
4
  been published yet says `unreleased` and gets its date on the day it goes out.
5
5
 
6
- ## 1.3.6 - unreleased
6
+ ## 1.4.0 - 2026-10-27
7
+
8
+ - Changed: a first sort of a memory folder that grows what is loaded every turn (the index gets
9
+ longer, nothing is saved) is now verdict `leave`: `apply` refuses it without `--force`
10
+ (`force: true` over MCP) and says how many tokens it would add. A re-apply still sorts.
11
+ - Changed: `apply` on a memory folder cuts an index hook over the 120 character cap (MM006) to
12
+ fit, but only when every word of it is in the linked file's frontmatter `description:`;
13
+ otherwise the line is kept whole. Undo restores the index byte for byte.
14
+ - Changed: `apply` on a memory folder swaps the link targets of two index lines that each
15
+ describe the other's file (MM019); any other MM019 line is still a flag only. MM019 no longer
16
+ flags a line whose own file holds half its words when the better match has its own line.
17
+ - Added: verdict `fix`. When a first sort of a memory folder with no imported file is refused
18
+ because it grows the prefix, `apply` still fixes the index's own lines (the MM006 cuts and
19
+ MM019 swaps above) and moves no file, as long as that shrinks the prefix. `--force`
20
+ (`force: true` over MCP) sorts anyway; a folder applied fix-only stays that way on a re-apply,
21
+ and `undo` restores the index byte for byte.
22
+ - Fixed (live Codex check, T7): `install --host codex` passes a `CODEX_HOME` you set on to the
23
+ server (`codex mcp add --env`, or an `env` line in the printed TOML block). Codex starts an
24
+ MCP server without it, so the server read and wrote `~/.codex` instead.
25
+ - Fixed (T7): the Codex map, MM022 and the apply cap check follow what Codex really does: the
26
+ user `AGENTS.md` does not count toward `project_doc_max_bytes`, and the project file that
27
+ crosses the cap is cut there (the map says `PART: first N bytes`), not dropped whole.
28
+ - Added: Codex as a second host (DESIGN.md 7.2). `install --host codex` registers the server
29
+ with `codex mcp add` (the served command carries `--host codex`), writes the two
30
+ `UserPromptSubmit` hooks to `~/.codex/hooks.json` or `<repo>/.codex/hooks.json`, prints the
31
+ TOML block when `codex` is not on PATH, and `uninstall --host codex` removes exactly that.
32
+ - Added: the Codex load model. `init` maps the `AGENTS.md` chain (user file, root to working
33
+ directory, `AGENTS.override.md` first, `project_doc_fallback_filenames`) with each file's
34
+ bytes and whether it reaches the model under `project_doc_max_bytes`, read from
35
+ `~/.codex/config.toml` and `<repo>/.codex/config.toml`. No report is needed on Codex.
36
+ - Added: MM022 (a file on the chain past Codex's cap never reaches the model; high) and MM023
37
+ (`AGENTS.override.md` shadows `AGENTS.md`; low). Both run only for a Codex host.
38
+ - Changed: a project whose compile target is `AGENTS.md` (or `AGENTS.override.md`) and that has
39
+ no `.claude/` folder now routes to `OnDemandMemory/` beside the file, so one folder serves
40
+ Codex, Cursor and Claude Code. A root compiled before keeps the folder its manifest names.
41
+ - Changed: `apply` on Codex refuses a plan whose compiled host would still be over the cap and
42
+ says what to cut; the printed apply command carries `--host codex`.
43
+ - Changed: `init`, `doctor`, `apply`, `undo`, `hook`, `drift` and `mcp` take `--host claude|codex`;
44
+ the discovery record and the hook's session stamps live under the host's config dir
45
+ (`CLAUDE_CONFIG_DIR`/`~/.claude`, `CODEX_HOME`/`~/.codex`). A Codex user's `AGENTS.md` has no
46
+ `@` imports: lines that look like one are text there and are not followed.
47
+ - Not changed: the MCP tool schemas (the host comes from the server's `--host`, not a per-call
48
+ argument; measured 2026-10-26: one optional enum on four schemas cost 185 tokens every session).
49
+ The frozen interface text is untouched.
50
+
51
+ ## 1.3.7 - 2026-10-22
52
+
53
+ - Fix (#23): the prompt hook printed nothing when the best memory section was over its 400-token
54
+ cap. It now prints one pointer line, the file's full path and the section's heading, so the
55
+ agent learns the file exists when it needs it.
56
+ - Fix (#24): on a memory folder that was never applied, the hook placed sections of files Claude
57
+ Code already loads (a file your `CLAUDE.md` imports). The files `init` recorded as loaded, and
58
+ their `@` imports, now count as always-on, as they already did on a compiled folder.
59
+ - Fix (#29): `doctor`'s MM019 flagged correct index lines on big folders, because a large file
60
+ held all of their common words. Words now match at the start of a word only, weigh by how few
61
+ files hold them, and a file over three times the linked file's size counts only its headings.
62
+ A real 99-file memory folder went from 3 findings to 0; a synthetic test folder with planted
63
+ wrong descriptions went from 3 to 4, the fourth being a planted one the old rule missed. The finding is low when the linked
64
+ file still holds half the words.
65
+ - Changed (#30): with a `--budget` you give to `init` or `doctor`, being over it is now the plan's
66
+ headline ("always-loaded N tokens, M over the B you asked for; the plan below brings it to A")
67
+ instead of a high MM001 finding, so it no longer counts in the findings or the exit code. A
68
+ policy's budget and a compiled workspace's own budget still report MM001.
69
+ - Changed (#22): sections that read as hard rules (HARD STOP, never, always or must in the
70
+ heading or first line) and sections marked `<!-- minnimemory:keep -->` are placed in the
71
+ always-loaded text before size decides. One that still does not fit is named in the plan as
72
+ "a rule". What `apply` writes changes for files with such sections.
73
+ - Fix (#28): `init` warns when the folder it looks at is another project's Claude Code memory
74
+ folder, and drops saved records whose project folder no longer exists.
75
+ - Tests only, no runtime change: the Plugin Sandbox E2E Session Cost Test (`tests/integration/e2e/plugin_sandbox_e2e.mjs`, `live_e2e.mjs --install plugin`, selftest fault `plugin-no-server`).
76
+
77
+ ## 1.3.6 - 2026-10-19
7
78
 
8
79
  - Changed: `@modelcontextprotocol/sdk` 1.30.0 -> 1.32.1 (the directory policy asks local servers to keep dependencies current). No behavior change; the full suite, the MCP client probe and the plugin e2e pass on the new SDK.
9
80
  - Plugin: the generated README now defines what "memory" means (your files on disk, never chat history), names the surfaces (Claude Code and Cowork; ignored in claude.ai chat), discloses the bundle's unused `install`/`uninstall` commands and the `--profile full` tools, and gains "Try it on a sample first" and "Security reports" sections; `examples/CLAUDE.md` ships in the plugin tree; `plugin.json` carries `privacyPolicyUrl`, `termsOfServiceUrl` and `author.email`. The stale "measured offline, not yet in a live session" line is gone (gate (c) was live).
package/README.md CHANGED
@@ -148,8 +148,52 @@ the package on every prompt and measured 1.3 to 1.7 s. `--no-hook` skips it at i
148
148
  `install --remove` takes out both the MCP registration and the hook entry it added, leaving
149
149
  every other key and every other hook in your Claude Code settings untouched.
150
150
 
151
- **Other MCP hosts** (Cursor, Windsurf, Claude Desktop, SDK clients) are not supported in 1.0.
152
- Claude Code is the only host exercised end to end and the only one this README documents.
151
+ ## Install for Codex
152
+
153
+ Codex loads one chain of `AGENTS.md` files every turn: `$CODEX_HOME/AGENTS.md`, then one file
154
+ per folder from the repo root down to your working directory. The project files share
155
+ `project_doc_max_bytes` (32 KiB by default): the file that crosses it is cut there and nothing
156
+ after it is added. Nothing loads on demand, so a long `AGENTS.md` is paid in full on every turn
157
+ and whatever sits past the cap never reaches the model. The same four verbs trim it the same way.
158
+
159
+ ```
160
+ npx -y minnimemory install --host codex
161
+ ```
162
+
163
+ This runs `codex mcp add minnimemory -- npx -y minnimemory mcp --host codex` (printed, and
164
+ idempotent) and adds the two `UserPromptSubmit` hooks to `~/.codex/hooks.json` (`--scope
165
+ project` writes `<repo>/.codex/hooks.json`; Codex has no local scope). Without the `codex`
166
+ binary it prints the `[mcp_servers.minnimemory]` block to paste into `~/.codex/config.toml`
167
+ and exits 2. Then open Codex, run `/hooks` once to trust the two minnimemory hooks (Codex skips
168
+ an untrusted hook), and ask it to run `init`. In a terminal: `npx -y minnimemory init . --host
169
+ codex`. Codex's load set is fully determined by the files and `config.toml`, so `--from-log` and
170
+ `--loaded` are not needed; the host is detected when `CODEX_HOME` is set or your Codex config
171
+ registers minnimemory, and `--host codex` pins it. If you set `CODEX_HOME`, install passes it
172
+ on to the server (`--env CODEX_HOME=...`), because Codex starts MCP servers without it.
173
+
174
+ In `codex exec` (no one to approve a tool call), Codex refuses MCP calls that need approval.
175
+ The four verbs only read, so you can let them run without asking:
176
+
177
+ ```toml
178
+ [mcp_servers.minnimemory]
179
+ default_tools_approval_mode = "approve"
180
+ ```
181
+
182
+ Codex does not show MCP prompts, so the `/mcp__minnimemory__<verb>` slash commands are Claude
183
+ Code only; in Codex, ask for the verb by name.
184
+
185
+ What is different on Codex: the map shows the chain (layer, file, bytes, loaded) and the cap in
186
+ force (a file cut by the cap shows `PART: first N bytes`); `doctor` adds MM022 (a file past the cap) and MM023 (`AGENTS.override.md` shadowing an
187
+ `AGENTS.md`); `apply` compiles the `AGENTS.md` Codex reads (the override file when present),
188
+ puts routed pieces in `OnDemandMemory/` beside it when the repo has no `.claude/` folder, and
189
+ refuses a plan whose compiled file would still be over the cap. The discovery record lives
190
+ under `$CODEX_HOME/minnimemory/`. Nested `AGENTS.md` files below the root are listed with their
191
+ size and not compiled. Codex's own `memories` feature is Codex-managed and never touched.
192
+ Measured on Claude Code; Codex measurement in progress (section 8 of the design).
193
+
194
+ **Other MCP hosts** (Cursor, Windsurf, Claude Desktop, SDK clients): `install --host cursor`
195
+ and `--host windsurf` print the `mcpServers` entry to paste, but the hook and the load model are
196
+ not built for them, and nothing there is exercised end to end.
153
197
 
154
198
  ## Use it
155
199
 
@@ -349,6 +393,10 @@ test, architecture) stay, by content rather than by heading alone, and its recor
349
393
  and one-task runbooks move; a section over the room keeps its head and routes the rest as one
350
394
  "(continued)" piece. The plan prints the budget it used and names every section
351
395
  kept out to fit, so change `--budget` with the numbers in front of you.
396
+ Sections that read as hard rules (a heading or first line with HARD STOP, never, always or must)
397
+ are placed first, before size decides. To pin any other section, put
398
+ `<!-- minnimemory:keep -->` on the line under its heading. A pinned section that still does not
399
+ fit is named in the plan as "a rule".
352
400
  `.minnimemory/` (backups, manifest) is bookkeeping only, never something Claude Code auto-loads.
353
401
 
354
402
  | flag | effect |
@@ -467,7 +515,7 @@ add` line above, turns on the memory hook and the drift notice hook, and prints
467
515
  | `--force` | remove an existing registration first, then re-add |
468
516
  | `--no-hook` | skip the three hooks (memory, drift notice, load log; on by default) |
469
517
  | `--remove` | remove the MCP registration and the hooks `install` added; the same as `minnimemory uninstall` |
470
- | `--host <name>` | `cursor`, `windsurf` or `json`: print the `mcpServers` snippet to paste (and the config file for Cursor and Windsurf) instead of registering with Claude Code; no hook |
518
+ | `--host <name>` | `codex`: register with Codex (`codex mcp add`) and write the two hooks to `~/.codex/hooks.json` or `<repo>/.codex/hooks.json`, see Install for Codex. `cursor`, `windsurf` or `json`: print the `mcpServers` snippet to paste (and the config file for Cursor and Windsurf) instead of registering with Claude Code; no hook |
471
519
 
472
520
  Idempotent: an existing registration is reported, with the command to change it, not duplicated.
473
521
  Without the `claude` CLI on `PATH` it prints the manual line and a JSON snippet instead, exit 2;
@@ -606,8 +654,10 @@ The opposite. Splitting volatile content out of the always-loaded prefix is prec
606
654
  the cache valid across sessions.
607
655
 
608
656
  **Does it work with Cursor or Codex?**
609
- Not in 1.0. `doctor` reads `AGENTS.md` and `.cursorrules` as files, but Claude Code is the only
610
- supported host; nothing else has been exercised end to end.
657
+ Codex: yes, since 1.4.0 (see Install for Codex): the same four verbs on the `AGENTS.md` chain
658
+ Codex loads, with its byte cap as a second ceiling. Cursor: the MCP server runs there
659
+ (`install --host cursor` prints the entry) but the hook and the load model are not built, and
660
+ nothing there is exercised end to end.
611
661
 
612
662
  ## License
613
663
 
package/package.json CHANGED
@@ -1,12 +1,17 @@
1
1
  {
2
2
  "name": "minnimemory",
3
- "version": "1.3.6",
3
+ "version": "1.4.0",
4
4
  "description": "MinniMemoryMCP: an MCP server that gives an AI coding agent curated memory. Tools audit the agent's memory file, compile it into a small AlwaysOnMemory body plus OnDemandMemory files, serve it back on demand and keep it maintained. Deterministic, lossless, offline. Built by MinniAI.",
5
5
  "type": "module",
6
6
  "mcpName": "io.github.MinniAI-com/minnimemory",
7
7
  "license": "SEE LICENSE IN LICENSE",
8
8
  "author": "MinniAI",
9
9
  "homepage": "https://minniai.com",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/MinniAI-com/minnimemory-plugin.git"
13
+ },
14
+ "bugs": "https://github.com/MinniAI-com/minnimemory-plugin/issues",
10
15
  "publishConfig": {
11
16
  "access": "public"
12
17
  },
@@ -37,14 +42,23 @@
37
42
  "test:watch": "vitest"
38
43
  },
39
44
  "keywords": [
40
- "llm",
41
- "agent",
42
- "context",
43
- "tokens",
45
+ "mcp",
46
+ "mcp-server",
47
+ "claude-code",
48
+ "claude-code-plugin",
49
+ "cursor",
50
+ "agent-memory",
44
51
  "memory",
52
+ "context-window",
53
+ "token-usage",
54
+ "tokens",
55
+ "llm-cost",
56
+ "prompt-caching",
57
+ "ai-coding-agent",
58
+ "agent",
59
+ "llm",
45
60
  "claude",
46
- "mcp",
47
- "prompt-caching"
61
+ "context"
48
62
  ],
49
63
  "devDependencies": {
50
64
  "@types/node": "^22.10.2",