Skip to main content

Cross-project memory for AI coding agents

Project description

crossmem

Your AI assistant remembers everything you've ever solved — across every project and every tool.

The problem

You're working on project B. You need credential masking. You know you solved this in project A three months ago — but your AI assistant has no idea. It starts from scratch, suggests a different approach, and you waste an hour getting back to where you already were.

Here's what's happening under the hood:

~/.claude/projects/
├── project-A/memory/MEMORY.md    ← Claude remembers here
├── project-B/memory/MEMORY.md    ← ...but can't see here
└── project-C/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: 298 memories across 10 projects (Claude Code + Gemini CLI)

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

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

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

[3] project-A / 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 — twice.

Unlike Mem0 (cloud-based, API-key required) or Basic Memory (single-tool), crossmem is local-only, zero-config, and aggregates across both tools and projects.

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

# 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 — Reads Claude Code (~/.claude/projects/*/memory/*.md) and Gemini CLI (~/.gemini/GEMINI.md), splits into granular chunks, deduplicates by content hash
  2. Index — Stores in SQLite with FTS5 full-text search (porter stemming + unicode61 tokenizer)
  3. Search — Multi-word queries use AND logic by default. Quoted phrases for exact matches
  4. Learn — AI tools save new discoveries via mem_save during sessions. Knowledge compounds automatically
  5. Sync — Translates Claude's structured markdown into Gemini's flat bullet format, 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"
    }
  }
}

Note: If crossmem-server isn't on PATH, use: "command": "uvx", "args": ["--from", "crossmem", "crossmem-server"]

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_ingest Refresh the index when memory files change

Start manually

crossmem serve    # starts MCP server on stdio

Supported tools

Tool Ingestion
Claude Code ~/.claude/projects/*/memory/*.md
Gemini CLI ~/.gemini/GEMINI.md

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.1.0.tar.gz (16.3 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.1.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crossmem-0.1.0.tar.gz
  • Upload date:
  • Size: 16.3 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.1.0.tar.gz
Algorithm Hash digest
SHA256 504ad7d3cab9a8a2819f60e4e41624ff6710c72526d92504fc47d626315c6a57
MD5 e1c22ee634555ee83307f7ca5bba9b18
BLAKE2b-256 222e5f798907deb7fe6c22aa87f866381cee8787e775cb332ba916d23fbb8e11

See more details on using hashes here.

File details

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

File metadata

  • Download URL: crossmem-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.9 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 217a0ff6033254462b81d7391d8de3d3c0a9cedb5d27db38345273950068cb47
MD5 1d9d3122df8bee47b7af43b8e7cf8202
BLAKE2b-256 378b83a5b4ed1b061b3bafd1b4f0dbdd1d535c6c3907799e5c8a460f1147ca22

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