You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cursor plugin: project_id resolves to the plugin cache folder hash (all workspaces share one app_id) #7614
Where: mem0 Cursor plugin (cursor-public/mem0), hooks in hooks/cursor-hooks.json.
What happens: In Cursor, hook commands run with the plugin cache folder as working directory, and the hook input JSON has no cwd field (Cursor sends workspace_roots). As a result:
_project.sh resolves the project from $PWD, i.e. the plugin cache folder, so project_id becomes its name (e.g. 965140eb190bf390979d41bb6ffff12c0b02e70b);
scripts that read .cwd // "." from the input (on_file_read*.sh, on_session_start.sh) get ..
Every Cursor workspace therefore reads and writes memories under the same app_id, and ~/.mem0/project_map.json ends up with a "." key mapped to that hash. ~/.mem0/hooks.log shows e.g. Auto-import started: cwd=. git_root=(none) project=965140eb….
Expected:project_id is the opened workspace (git remote slug or project_map entry), as in Claude Code.
Suggested fix: in the Cursor wrappers, resolve the workspace as .cwd // .workspace_roots[0] from the hook input, cd into it and set .cwd before calling the shared scripts. A local wrapper doing exactly this fixes it for me:
Related (minor): the preToolUse Read hook searches memories with the file path as the query; with few memories it injects the same unrelated results on every file read (scores 0.5–0.6 above the 0.3 threshold). An option to disable it in ~/.mem0/settings.json would help.
Environment: macOS (arm64), Cursor with the mem0 plugin from the Cursor marketplace (cache folder 965140e…).
I'd like to work on this — resolving the project from workspace_roots in the hook input instead of $PWD (plugin cache folder) in the Cursor hooks. I'll dig in and open a PR.
Activity
manish-9245 commentedon Oct 13, 2026
I'd like to work on this — resolving the project from
workspace_rootsin the hook input instead of$PWD(plugin cache folder) in the Cursor hooks. I'll dig in and open a PR.marcvertalier-stack commentedon Oct 15, 2026