Skip to main content

Cross-project memory for AI coding agents

Project description

crossmem

PyPI Python Downloads License

One search across all your Claude Code and Gemini CLI memories — every project, every tool.

crossmem demo

The problem

You use AI coding assistants across multiple projects. Each project's memories are locked in a silo — and each tool has its own silo too. You solved credential masking in your backend API three months ago, but when you need it in a new microservice, your AI assistant starts from scratch.

Here's what's happening under the hood:

~/.claude/projects/
├── backend-api/memory/MEMORY.md    ← Claude remembers here
├── mobile-app/memory/MEMORY.md    ← ...but can't see here
└── data-pipeline/memory/MEMORY.md ← ...or here

~/.gemini/GEMINI.md                ← Gemini's memories (separate silo entirely)

Every project is a silo. Every tool is a silo. Knowledge doesn't compound — it resets.

The fix

$ crossmem ingest
Ingested: 42 memories across 4 projects (Claude Code + Gemini CLI)

$ crossmem search "credential masking"
Found 3 results for "credential masking":

[1] backend-api / Security
    Source: MEMORY.md
    - Credentials masked in experience_memory before persisting (_mask_actions)...

[2] mobile-app / Security
    Source: MEMORY.md
    - Credentials masked via _mask_context_credentials() + _mask_text()...

[3] backend-api / Security
    Source: GEMINI.md
    - Credential masking pattern: _mask_actions for persistence, _mask_text for logs...

Three results. Two projects. Two AI tools. One query. The pattern was already solved.

How crossmem differs

  • vs Mem0 — Mem0 is cloud-based and requires an API key. crossmem is local-only with zero accounts.
  • vs Basic Memory — Basic Memory works within one tool. crossmem aggregates across tools and projects.
  • vs grep — crossmem parses multiple formats, deduplicates, and runs as an MCP server — your AI assistant queries it automatically at session start.

Install

pip install crossmem
# or
uv pip install crossmem

Quick start

pip install crossmem        # 1. Install
crossmem ingest             # 2. Index all your AI memories
crossmem search "retry"     # 3. Search across every project

That's it. Three commands, zero config. crossmem finds Claude Code and Gemini CLI memory files automatically.

To give your AI tools direct access, add the MCP server to your config (see MCP Server below) — then mem_recall() and mem_search() just work inside your coding sessions.

Usage

# Ingest Claude Code + Gemini CLI memories
crossmem ingest

# Search across every project
crossmem search "JWT token rotation"
crossmem search "retry strategy" -p backend-api
crossmem search "docker compose" -n 5

# Delete stale or wrong memories
crossmem forget 42                   # delete memory #42 (with confirmation)
crossmem forget -p old-app           # delete all memories for a project
crossmem forget 42 --confirm         # skip confirmation prompt

# Sync Claude memories → Gemini CLI
crossmem sync                        # sync everything
crossmem sync -p backend-api        # sync one project + shared patterns

# Watch for changes and auto-sync
crossmem sync-watch                  # polls every 30s
crossmem sync-watch --interval 10    # custom interval

# Visualize the knowledge graph
crossmem graph

# See what's in the database
crossmem stats

How it works

  1. Ingest — Finds Claude Code and Gemini CLI memory files automatically, splits into chunks, deduplicates
  2. Index — Stores everything locally in SQLite — no cloud, no API keys, no accounts
  3. Search — Full-text search with stemming. Multi-word queries use AND logic; quoted phrases for exact matches
  4. Learn — AI tools save new discoveries via mem_save during sessions. Knowledge compounds automatically
  5. Sync — One-way sync from Claude → Gemini, preserving each tool's own memories

MCP Server

crossmem runs as an MCP server so AI coding tools can search, recall, and save memories in real-time.

Setup

Add to your tool's MCP config:

Claude Code (~/.mcp.json for global, or .mcp.json in project root):

{
  "mcpServers": {
    "crossmem": {
      "command": "crossmem-server"
    }
  }
}

Gemini CLI (~/.gemini/settings.json):

{
  "mcpServers": {
    "crossmem": {
      "command": "crossmem-server"
    }
  }
}

VS Code / GitHub Copilot (.vscode/mcp.json in project root, or user settings.json):

{
  "servers": {
    "crossmem": {
      "command": "uvx",
      "args": ["--from", "crossmem", "crossmem-server"]
    }
  }
}

Note: For Claude Code and Gemini CLI, if crossmem-server isn't on PATH, use the same uvx command shown in the Copilot config above.

Tools

Tool Description
mem_recall Load project context + cross-project patterns at session start (auto-detects project from cwd)
mem_search Search across all memories (query, project filter, limit)
mem_save Save a discovery during a session — immediately searchable
mem_forget Delete a memory by ID (find IDs via mem_search)
mem_ingest Refresh the index when memory files change (auto-runs on server startup)

Start manually

crossmem serve    # starts MCP server on stdio (same as crossmem-server)

Supported tools

Tool Ingestion
Claude Code ~/.claude/projects/*/memory/*.md
Gemini CLI ~/.gemini/GEMINI.md
VS Code / GitHub Copilot Via MCP server (no direct ingestion — uses the shared index)

Ingestion is pluggable — PRs welcome for new tools.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crossmem-0.3.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crossmem-0.3.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file crossmem-0.3.0.tar.gz.

File metadata

  • Download URL: crossmem-0.3.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for crossmem-0.3.0.tar.gz
Algorithm Hash digest
SHA256 967833d606bbf8d4f0924fc1ea45d328a72a6a065e1a2bfba72a06a5809761c6
MD5 820803c2f27f2dcafd36a4fc7e0570de
BLAKE2b-256 fb6572229fd6deb4ebdac05a2c3d5d2c0a7cb9d91fc9b7265d6607d13426d205

See more details on using hashes here.

File details

Details for the file crossmem-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: crossmem-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for crossmem-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 832124792d0b86a2c8f93e030424a3d658464c64c14787bc07f590b2d1197403
MD5 dcad247476c3991cc177000c173fbeb6
BLAKE2b-256 8f9d9bc4b3edf04f4ec803c77c71575baf021c33ac47ede4b47ce63151c32009

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page