/switch-project
Overrides the auto-detected project scope to read and write memories under a different project ID, or enables global search to access all memories across all users and projects. Use when working across multiple projects, accessing memories from another repo, enabling team-wide
$ npx -y skills add mem0ai/mem0 --skill switch-project --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/switch-project
Context preview
The summary Claude sees to decide when to auto-load this skill.
Overrides the auto-detected project scope to read and write memories under a different project ID, or enables global search to access all memories across all users and projects. Use when working across multiple projects, accessing memories from another repo, enabling team-wide
SKILL.md
switch-project.SKILL.mdname: switch-project
description: Overrides the auto-detected project scope to read and write memories under a different project ID, or enables global search to access all memories across all users and projects. Use when working across multiple projects, accessing memories from another repo, enabling team-wide memory access, or when auto-detection resolves to the wrong project.
Mem0 Switch Project
Override the automatic project_id detection for the current directory, or enable global search mode.
Usage
- `/mem0:switch-project <project-name>` — switch to a specific project scope
- `/mem0:switch-project --global` — enable global search (all memories, all users, all projects)
- `/mem0:switch-project --no-global` — disable global search and return to per-project scoping
Execution
If `--global` flag is provided:
1. Set `global_search: true` in `~/.mem0/settings.json` using the Bash tool:
python3 -c "
import json, os
settings_file = os.path.expanduser('~/.mem0/settings.json')
settings = {}
if os.path.isfile(settings_file):
with open(settings_file) as f:
settings = json.load(f)
settings['global_search'] = True
with open(settings_file, 'w') as f:
json.dump(settings, f, indent=2)
print('Global search enabled')
"2. Print:
Global search enabled.
Searches now return all memories across all users and projects.
Writes still use the current user_id and app_id.
Restart the session for the change to take effect.
If `--no-global` flag is provided:
1. Set `global_search: false` in `~/.mem0/settings.json` using the Bash tool:
python3 -c "
import json, os
settings_file = os.path.expanduser('~/.mem0/settings.json')
settings = {}
if os.path.isfile(settings_file):
with open(settings_file) as f:
settings = json.load(f)
settings['global_search'] = False
with open(settings_file, 'w') as f:
json.dump(settings, f, indent=2)
print('Global search disabled')
"2. Print:
Global search disabled.
Searches now return only memories scoped to the current project.
Restart the session for the change to take effect.
If a project name is provided (no flags):
1. If no project name was given, ask: "What project_id should this directory use?"
2. Write the mapping to `~/.mem0/project_map.json` using the Bash tool:
python3 -c "
import json, os
map_file = os.path.expanduser('~/.mem0/project_map.json')
mapping = {}
if os.path.isfile(map_file):
with open(map_file) as f:
mapping = json.load(f)
mapping[os.getcwd()] = '<PROJECT_NAME>'
os.makedirs(os.path.dirname(map_file), exist_ok=True)
with open(map_file, 'w') as f:
json.dump(mapping, f, indent=2)
print(f'Mapped {os.getcwd()} -> <PROJECT_NAME>')
"(Replace `<PROJECT_NAME>` with the user's chosen project name.)
3. Verify by searching for existing memories:
- Call `search_memories` with `query="project"`, `filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<PROJECT_NAME>"}]}`, `top_k=1`
4. Print:
Switched to project <PROJECT_NAME>.
<N> memories found for this project.
Note: This override persists across sessions for this directory.
Read more
name: switch-project description: Overrides the auto-detected project scope to read and write memories under a different project ID, or enables global search to access all memories across all users and projects. Use when working across multiple projects, accessing memories from another repo, enabling team-wide memory access, or when auto-detection resolves to the wrong project.
Mem0 Switch Project
Override the automatic project_id detection for the current directory, or enable global search mode.
Usage
- `/mem0:switch-project <project-name>` — switch to a specific project scope
- `/mem0:switch-project --global` — enable global search (all memories, all users, all projects)
- `/mem0:switch-project --no-global` — disable global search and return to per-project scoping
Execution
If `--global` flag is provided:
1. Set `global_search: true` in `~/.mem0/settings.json` using the Bash tool:
python3 -c "
import json, os
settings_file = os.path.expanduser('~/.mem0/settings.json')
settings = {}
if os.path.isfile(settings_file):
with open(settings_file) as f:
settings = json.load(f)
settings['global_search'] = True
with open(settings_file, 'w') as f:
json.dump(settings, f, indent=2)
print('Global search enabled')
"2. Print:
Global search enabled. Searches now return all memories across all users and projects. Writes still use the current user_id and app_id. Restart the session for the change to take effect.
If `--no-global` flag is provided:
1. Set `global_search: false` in `~/.mem0/settings.json` using the Bash tool:
python3 -c "
import json, os
settings_file = os.path.expanduser('~/.mem0/settings.json')
settings = {}
if os.path.isfile(settings_file):
with open(settings_file) as f:
settings = json.load(f)
settings['global_search'] = False
with open(settings_file, 'w') as f:
json.dump(settings, f, indent=2)
print('Global search disabled')
"2. Print:
Global search disabled. Searches now return only memories scoped to the current project. Restart the session for the change to take effect.
If a project name is provided (no flags):
1. If no project name was given, ask: "What project_id should this directory use?"
2. Write the mapping to `~/.mem0/project_map.json` using the Bash tool:
python3 -c "
import json, os
map_file = os.path.expanduser('~/.mem0/project_map.json')
mapping = {}
if os.path.isfile(map_file):
with open(map_file) as f:
mapping = json.load(f)
mapping[os.getcwd()] = '<PROJECT_NAME>'
os.makedirs(os.path.dirname(map_file), exist_ok=True)
with open(map_file, 'w') as f:
json.dump(mapping, f, indent=2)
print(f'Mapped {os.getcwd()} -> <PROJECT_NAME>')
"(Replace `<PROJECT_NAME>` with the user's chosen project name.)
3. Verify by searching for existing memories:
- Call `search_memories` with `query="project"`, `filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<PROJECT_NAME>"}]}`, `top_k=1`
4. Print:
Switched to project <PROJECT_NAME>. <N> memories found for this project. Note: This override persists across sessions for this directory.
Mem0 ("mem-zero") enhances AI assistants and agents with an intelligent memory layer, enabling personalized AI interactions.
Repo: mem0ai/mem0
Other skills on mem0.
- /context-loader
Searches and injects relevant memories into context before starting work on a task. Use when beginning a new task, switching context, or when project history, past decisions, or coding conventions need to be loaded.
Open skill - /dream
Consolidates stored memories by merging duplicates, resolving contradictions, and pruning stale entries. Use when memory count is high, search results feel noisy or repetitive, or periodic cleanup is needed to maintain memory quality.
Open skill - /export
Exports all project memories to a portable Markdown file for backup or migration. Use when backing up memories, migrating to another project, sharing memory state with teammates, or archiving before cleanup.
Open skill - /forget
Deletes memories by search query or memory ID with confirmation before removal. Use when removing outdated decisions, incorrect memories, sensitive data, or cleaning up after experiments. Also handles undo of recent additions.
Open skill - /health
Diagnoses mem0 connectivity, API key validity, and memory read/write functionality. Use when memory operations fail, searches return empty, add_memory errors occur, MCP connection drops, or to verify the plugin is working correctly.
Open skill - /import
Imports memories from an exported Markdown file or MEMORY.md into the current project. Use when migrating from another project, restoring from backup, importing Claude Code native MEMORY.md content, or setting up a new project with existing knowledge.
Open skill

