switch-project

A scope switch for Mem0 memories. It lets you use a different project ID or search across all users and projects instead of the automatically selected project.

In plain words
What is it for?
Use it when working across repositories, reading another project's memories, enabling team-wide searches, or returning to normal per-project search.
Why use it?
It prevents work in the wrong repository or project from being mixed with the memories you meant to access.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mem0ai/mem0/switch-project
Any agent
npx skills add mem0ai/mem0 --skill switch-project
Clone the repo
git clone --depth 1 https://github.com/mem0ai/mem0

Made for: Claude Code, Codex.

Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 814 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00065 $0.00814
Opus 5 $0.00032 $0.00407
Sonnet 5 $0.00013 $0.00163
Haiku 4.5 $0.00006 $0.00081

Measured 3d ago against content hash 72b629dd486e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

switch-project scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

integrations/mem0-plugin/skills/switch-project/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 104 lines · 65 tokens per session scan A 72b629dd486e

Subscribe to this mod's changes

switch-project is a skill published in the GitHub repository mem0ai/mem0 (64,535 stars, last pushed yesterday), licensed Apache-2.0. It adds 65 tokens to every session and 814 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.