New to Claude Skills? Learn how to install them →

Mmem0ai on GitHub

Mem0 Switch Project

Free

Easily manage project scopes and global memory access.

by mem0ai63k stars on mem0ai/mem0
2 views
Updated Aug 7, 2026
Get this skill

Free · Opens the source repo

What Mem0 Switch Project does

Mem0 Switch Project is a Bash-based tool designed for users of the Mem0 memory management system. It allows you to override the automatic detection of project IDs, enabling you to specify a particular project scope or to enable global search capabilities. This is particularly useful when working across multiple projects or when the auto-detection feature does not resolve to the correct project. By using this skill, developers and designers can streamline their workflow, ensuring that they are accessing the right memories associated with their current project context.

The skill provides three primary functionalities: switching to a specific project, enabling global search across all memories, and disabling global search to revert to per-project scoping. Users can easily execute commands to set their desired project context or search parameters. The commands are straightforward and involve modifying the user's settings file to reflect the changes in project scope or search capabilities.

This tool is particularly beneficial for teams that need to collaborate on shared memories or for individuals who frequently switch between different projects. By allowing global access to memories, team members can share insights and data without the need to manually switch contexts. Conversely, the ability to restrict searches to a specific project ensures that users can focus on the relevant information without distractions from other projects.

Overall, Mem0 Switch Project enhances productivity by providing a clear mechanism for managing memory access in a multi-project environment, making it an essential tool for developers and designers who rely on the Mem0 system for their memory management needs.

When to use it

Use this skill when you need to switch project contexts or enable global memory access across multiple projects.

When not to use it

This skill is not suitable for users who work exclusively within a single project or do not require access to shared memories.

What you can build with it

Switching Between Projects

When working on multiple projects, use this skill to quickly switch the memory context to the relevant project, ensuring you access the right data.

Enabling Team-Wide Memory Access

For collaborative projects, enable global search to allow all team members to access shared memories without needing to switch contexts.

Correcting Auto-Detection Issues

If the automatic project detection resolves incorrectly, use this skill to manually set the correct project ID for your current directory.

How to install Mem0 Switch Project

View source

1. Install with the skills CLI

npx skills add mem0ai/mem0/switch-project --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mem0ai

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.
    

Frequently asked questions about Mem0 Switch Project

Similar skills