Skip to content

uninstall: one symlinked agent config aborts the whole run — executable and indexes (386 MB) left behind #1954

Description

@Jmeg8r

Version

0.10.8

Platform

macOS (Apple Silicon)

Install channel

GitHub release archive / install.sh / install.ps1

Binary variant

standard

What happened, and what did you expect?

Summary

uninstall aborts entirely when any one agent config path is a file
symlink. A single unwritable Cursor path (~/.cursor/mcp.json, symlinked into
a dotfiles repo) stopped the run before executable and index removal started,
leaving 386 MB on disk after a reported "uninstall".

The refusal to write through a symlink looks deliberate and defensible. The
problem is the blast radius: a Cursor-specific config check gates teardown
steps that have nothing to do with Cursor.

Observed

Found 2 index(es):
  /Users/<me>/.cache/codebase-memory-mcp/hr-moderate.db
  /Users/<me>/.cache/codebase-memory-mcp/_config.db
Delete these indexes? (y/n): y (auto)
Stopping active CBM sessions and operations for uninstall...
error: agent_config agent=Cursor op=mcp_uninstall path=/Users/<me>/.cursor/mcp.json (target: symlink, 43 bytes)
error: one or more agent cleanup operations failed; executable and index removal were not started
error: activation stopped after one or more agent configuration or cleanup operations failed; the published/current executable was kept, and configuration changes that completed may remain. Please restart your coding-agent sessions after resolving the errors above.

~/.cursor/mcp.json is lrwxr-xr-x ... -> ~/.dotfiles/cursor/mcp.json — a
normal dotfiles arrangement, present long before CBM was installed.

Left behind

item size
~/.local/bin/codebase-memory-mcp 282 MB
~/.cache/codebase-memory-mcp/ 104 MB
~/.local/bin/install.sh (updater)
~/.zshrc PATH line

All four had to be removed by hand. Note this install used --skip-config, so
there was no CBM entry in the Cursor file at all — the run aborted over a file
it had never written to and had nothing to remove from.

Expected

Teardown of CBM-owned artifacts (executable, indexes, updater) should not be
gated on agent-config cleanup. Suggested, in rough priority order:

  1. Decouple. Remove the executable and indexes even when some agent config
    cleanup fails, then report the skipped configs and exit non-zero. The user
    can fix a symlinked config later; they cannot easily discover that 386 MB
    survived a successful-looking uninstall.
  2. Downgrade this case to a warning. A path with no CBM entry to remove is
    a no-op, not a failure — especially under --skip-config.
  3. Resolve and validate the link target. If it resolves inside the user's
    home and is a regular file, editing it is equivalent to editing the real
    path. Refusing only links that escape the home directory would keep the
    security property while accepting ordinary dotfiles setups.

Secondary: the report describes actions it did not take

Both --dry-run and the real run print per-client past-tense lines regardless
of whether anything exists:

  removed MCP config entry
  removed PreToolUse + SessionStart + SubagentStart hooks
Codex CLI: removed MCP config entry
  removed instructions
  Continue / cn:
  mcp: removed canonical entry from /Users/<me>/.continue/config.yaml

None of that happened. Verified by mtime — ~/.continue/config.yaml was last
modified 2026-05-19 and ~/.cursor/mcp.json 2026-05-24, both months before the
install; ~/.qoder/ and ~/.codebuddy/ do not exist on this machine. A
find across ~/.claude ~/.codex ~/.gemini ~/.cursor ~/.config for
*codebase-memory* returned zero results both before and after.

--dry-run additionally mixes tenses, printing bare removed ... for some
clients and would remove owned profile <path> for others in the same output,
which reads as "these files exist and will be deleted" when they do not.

Reading either output alone, an operator would reasonably conclude a dozen
configs had been rewritten.

Related

Reproduction

Public repo, macOS 15 (Darwin 25.5.0), arm64, zsh.

Runs in a throwaway HOME so it cannot touch a real Cursor config — the
ln -sf below would otherwise clobber an existing ~/.cursor/mcp.json:

export HOME=$(mktemp -d)   # isolated; nothing below touches your real home
cd "$HOME"

# 1. dotfiles-style symlinked Cursor config (the trigger)
mkdir -p "$HOME/.dotfiles/cursor" "$HOME/.cursor"
echo '{"mcpServers":{}}' > "$HOME/.dotfiles/cursor/mcp.json"
ln -s "$HOME/.dotfiles/cursor/mcp.json" "$HOME/.cursor/mcp.json"

# 2. install without touching agent config
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --skip-config
export PATH="$HOME/.local/bin:$PATH"

# 3. index any public repo so an index exists
git clone --depth 1 https://github.com/chopratejas/headroom.git "$HOME/hr"
codebase-memory-mcp cli index_repository --repo-path "$HOME/hr" --mode moderate --name hr

# 4. uninstall — aborts
codebase-memory-mcp uninstall -y

# 5. artifacts survive the "uninstall"
ls -lh "$HOME/.local/bin/codebase-memory-mcp"
du -sh "$HOME/.cache/codebase-memory-mcp"

Step 5 shows the 282 MB executable and the index cache still present.

Discard the sandbox with rm -rf "$HOME" while it is still the temp dir, then
open a fresh shell to restore your real HOME.

Confirmations

  • I searched existing issues and this is not a duplicate.
  • My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    editor/integrationEditor compatibility and CLI integrationwindowsWindows-specific issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions