@misterhuydo/cairn-mcp 1.22.0 → 1.24.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/README.md CHANGED
@@ -87,11 +87,40 @@ No manual steps. The index lives in `.cairn/index.db` inside your project — li
87
87
  | `cairn_checkpoint` | Save session state (auto-handled by hooks). At a stopping point, answer `would_be_lost` — the one part that git and the index cannot recover |
88
88
  | `cairn_minify` | Minify a single file on demand (fallback when hooks are not installed) |
89
89
  | `cairn_switch` | Switch active project root mid-session (use for maintenance on a sibling service) |
90
- | `cairn_memo` | Save a preference, decision, or discovery to the project's persistent memory |
90
+ | `cairn_memo` | Save a preference, decision, or discovery to the project's persistent memory. `action: "reindex"` repairs an index that has lost entries (see below) |
91
91
  | `cairn_employ_memory` | Recall stored memories explicitly (call only when asked) |
92
92
 
93
93
  ---
94
94
 
95
+ ## Repairing a truncated memory index
96
+
97
+ `MEMORY.md` is **shared**. Claude Code's own auto-memory writes plain pointer lines
98
+ with no type tag, and cairn writes tagged ones. Before **v1.23.0**, cairn required
99
+ the tag and rebuilt the whole index from the lines it could parse — so every
100
+ Claude-written pointer was deleted the next time a memo was saved. Seen in the
101
+ wild: an index of ~150 entries rewritten down to 3.
102
+
103
+ Only the pointers were lost. The memory files themselves were never touched, so the
104
+ index can be rebuilt from their frontmatter:
105
+
106
+ ```bash
107
+ cd /path/to/project
108
+ cairn repair-memory --dry-run # what would be restored, writes nothing
109
+ cairn repair-memory # restore them
110
+ ```
111
+
112
+ It is **additive**: it only adds pointers for files the index has lost, and never
113
+ rewrites or removes a line that is already there. Entries restored from a
114
+ Claude-written memory keep Claude's format (no type tag is invented for them). The
115
+ previous index is kept as `MEMORY.bak` — deliberately not a `.md`, since every
116
+ `.md` in that directory is treated as a memory. A pointer whose file is missing is
117
+ reported but left alone. Running it twice does nothing the second time.
118
+
119
+ The same repair is available in-session as `cairn_memo` with
120
+ `action: "reindex"` (and `dry_run: true` to preview).
121
+
122
+ ---
123
+
95
124
  ## Multi-service / monorepo support
96
125
 
97
126
  Cairn understands workspace structures where multiple services or packages live under a common parent folder.