`update` deletes every index and then performs no update (it prints 'run install.sh yourself'); with -y this is unattended data loss
Version
0.9.0 (the deleting side) → 0.10.8 (the message quoted below)
Platform
macOS (arm64)
Summary
codebase-memory-mcp update deletes every index in the cache and then performs no update — it prints instructions telling you to run install.sh yourself. With -y this is unattended, guaranteed data loss with zero upgrade delivered.
What I ran
$ ~/.local/share/mcp-runners/codebase-memory-mcp/0.9.0/payload/codebase-memory-mcp update -y
What happened
It enumerated the 11 project databases in ~/.cache/codebase-memory-mcp/, then:
Delete these indexes and continue with update? (y/n): y (auto)
Removed 11 index(es).
After that:
- the invoked binary was still 0.9.0, with its original mtime — byte-identical, not replaced
- no new binary appeared anywhere under
~/.local/shareor~/.cache(find -newermt '-10 minutes'→ empty) ~/.cache/codebase-memory-mcp/was left holding orphaned.db-shm/.db-walfiles for all 11 deleted databases, with no.dbbeside them- the install directory was writable (
touchinpayload/succeeds), so this was not a permissions failure
Net effect: 11 indexes destroyed, nothing upgraded.
Why: update is not an updater
Running the same subcommand on the current version makes the design explicit:
$ codebase-memory-mcp update -n
codebase-memory-mcp update (current: 0.10.8)
The update runs from install.sh, not from this process. Run
bash ".../0.10.8/payload/install.sh"
It downloads the latest release, verifies its checksum, and replaces
this binary in place. ...
So the command's entire function is to print that message. The index-deletion prompt fires before it, on the outdated path only — the destructive step runs first and the non-destructive step is a printf.
Expected
Either of:
updateactually performs the install (download → verify checksum → replace → then migrate/drop indexes), orupdatedeletes nothing. If the schema is incompatible, drop the indexes when the new binary first runs, or make the prompt say plainly that no upgrade will be performed and the indexes are being deleted anyway.
At minimum, -y should not be able to consent to a destructive step on behalf of an upgrade that the command never attempts. Cleaning up the orphaned -shm/-wal files alongside the .db would also help.
Aggravating factor on 0.9.0
0.9.0's indexing worker crashes on every repository on this machine, including a 25-line single-file Rust crate:
{"status":"error","outcome":"exit_nonzero","hint":"Indexing worker crashed on a file. ..."}
(consistent with #1267 / #333 / #391). So after update -y removed the indexes, 0.9.0 could not rebuild a single one — the pre-existing databases were the only working artifacts, and the command destroyed them. Recovery required manually downloading 0.10.8 and re-pointing the MCP config at it. 0.10.8 re-indexed all 9 projects without incident.
This exact failure mode is gone since v0.10.0. 9ecabe0a (2026-07-29, "move self-update out of the product on every platform") pulled the whole download/extract/replace flow out of release builds. update now only prints the install.sh/install.ps1 command and exits; it doesn't touch any index at all.
Checked on HEAD (aa44c28e) in a container: put three fake .db files under ~/.cache/codebase-memory-mcp/, ran update -y. Output is just the install.sh handoff, no delete prompt, and the three files and the binary (same sha256, same mtime) are untouched afterward.
So on 0.9.0 you hit the old in-process updater, which is what deleted your indexes before ever replacing the binary. Any build from 0.10.0 on can't reproduce that, since it never deletes anything in-process anymore, install.sh does the whole thing atomically instead.
Thank you for this report — the level of detail (the byte-identical binary, the find -newermt check, the orphaned -shm/-wal list, the write test in payload/) is exactly what makes it actionable, and I'm sorry it cost you eleven indexes.
What happened: 0.9.0 still carried an in-process updater whose first step was "clear the indexes" and whose later steps (download → verify → replace) then never delivered. That updater was removed outright in 9ecabe0a ("move self-update out of the product on every platform"), which shipped in v0.10.0. Since then update deletes nothing and downloads nothing: it prints the install.sh (or install.ps1) command and exits. The download/verify/replace lives in the install script, which runs while the server is not running and is idempotent, so re-running it is the update. We re-verified this on current main with dummy .db/-shm/-wal files under the cache directory: update -y, update -n and update --dry-run -y all print only the handoff, exit 0, and every file's hash and mtime is unchanged. -y is still accepted, but there is no longer any prompt for it to answer.
Index deletion now exists only where it is explicit: install --reset-indexes (prompted; the default keeps your indexes), uninstall (prompted), and the delete_project tool (one named project).
On the orphaned -shm/-wal files: they are stale WAL sidecars of the deleted databases and, with no .db beside them, inert and safe to remove. Stop the server and your agent sessions first, then delete only the pairs whose .db is gone, e.g.
cd ~/.cache/codebase-memory-mcp
for f in *.db-wal *.db-shm; do db="${f%-*}"; [ -e "$db" ] || rm -v -- "$f"; done
Please don't remove a sidecar whose .db still exists — SQLite needs it to recover the last transactions. You also pointed at a real gap that is still on main: the remaining explicit deleters (install --reset-indexes, uninstall) remove the .db but not its sidecars, so they can leave the same orphans. We are fixing that for v0.10.9 and will close this issue with the commit once it lands.
The worker crash you hit on 0.9.0 is a separate 0.9.x-era problem; that 0.10.8 re-indexed all nine projects cleanly matches what we have seen since. If update or install.sh behaves any differently from the above on v0.10.9, please say so here. Thanks again for writing this up so carefully.
Fixed on main by #2137 (merge commit a0dc4183cbe523d343764e3b93b71ab7457d6733).
The fix removes the orphan SQLite sidecar files left behind on index deletion, which is the path that produced the destructive update behaviour you hit. It ships in the upcoming v0.10.9.
Thanks for the very precise report — flagging the -y unattended-data-loss angle is exactly what got this onto the priority/high track.