Dual-layer ChromaDB + Mem0 Git commit index for Claude Code
Project description
claudememory
Give Claude Code a long-term memory of your Git history.
The problem
Claude Code is great at reading your current codebase — but it has no memory of why things were built the way they are.
Every session starts fresh. Ask it why a module was refactored, which bugs have hit the payment service before, or what architectural decision introduced the current state machine — and it has no answer. That context lives in your Git history, but it's inaccessible to the AI.
claudememory solves this. It indexes your entire Git commit history into a dual-layer semantic store and exposes it to Claude Code via MCP. Claude can now answer:
- "Has the auth module had bugs before?"
- "Why was this abstraction introduced?"
- "What changed in PaymentService over the last year?"
- "What commits touched this file?"
How it works
Two storage layers work together on every indexed commit:
| Layer | Technology | Purpose |
|---|---|---|
| Facts layer | ChromaDB | 1 document per commit — cosine similarity search, metadata filters, zero LLM overhead |
| Context layer | Mem0 | LLM-extracted interpretation — the why behind each change, cross-session learned context |
ChromaDB acts as the ground truth (fast, accurate, deduplicated). Mem0 enriches results with learned context over time. Claude sees both merged together.
Install
pip install claudememory
No external services required — three embedding options supported out of the box:
| Mode | Setup | Cost |
|---|---|---|
| Ollama (default) | ollama pull nomic-embed-text |
Free, fully local |
| sentence-transformers | pip install "claudememory[sentence-transformers]" |
Free, fully local, no Ollama |
| OpenAI | pip install "claudememory[openai]" + OPENAI_API_KEY |
~$0.0001/commit |
Quick start
# 1. Index your repository
claude-memory index --repo-path /path/to/repo --user-id my-repo
# 2. Install Claude Code skills + MCP config
claude-memory install --repo-path /path/to/repo --user-id my-repo
# 3. Restart Claude Code — then use /claude-memory-search, /claude-memory-debug etc.
After setup, Claude Code automatically has access to your commit history. No prompting required — it calls the tools proactively based on what you're working on.
MCP tools exposed to Claude
| Tool | What Claude can ask |
|---|---|
search_git_history(query) |
"Find commits related to discount logic" |
latest_commits(limit) |
"What changed while I was away?" |
commits_touching_file(filename) |
"What's the history of PaymentService?" |
bug_fix_history(component) |
"Has auth had bugs before?" |
architecture_decisions(topic) |
"Why was the state machine introduced?" |
Claude Code skills
| Skill | Trigger |
|---|---|
/claude-memory-search |
Search commit history for a topic |
/claude-memory-index |
Index a new repository |
/claude-memory-status |
Check what's indexed |
/claude-memory-debug |
Debug a regression with full history |
CLI reference
claude-memory index --repo-path . --user-id myapp # bulk index all commits
claude-memory serve # start MCP server (stdio)
claude-memory status --repo-path . # show indexed coverage
claude-memory install --repo-path . --user-id myapp # install Claude Code plugin
claude-memory store HEAD # store single commit (post-commit hook)
Configuration
All settings via environment variables:
| Variable | Default | Description |
|---|---|---|
CLAUDE_MEMORY_REPO_PATH |
. |
Repository to index |
CLAUDE_MEMORY_USER_ID |
claude_memory_system |
Mem0 namespace (use per-repo names) |
CLAUDE_MEMORY_CHROMA_DIR |
~/.cache/claude_memory/chroma_commits |
ChromaDB storage path |
CLAUDE_MEMORY_EMBED_PROVIDER |
ollama |
Embedding backend: ollama, openai, sentence-transformers |
CLAUDE_MEMORY_EMBED_MODEL |
(provider default) | Override embedding model name |
CLAUDE_MEMORY_LLM_MODEL |
(provider default) | Override LLM model name (Mem0 layer) |
OPENAI_API_KEY |
(empty) | Enables OpenAI embeddings + LLM automatically |
MEM0_API_KEY |
(empty) | Use Mem0 cloud instead of local inference |
OLLAMA_URL |
http://localhost:11434 |
Ollama endpoint |
Works great alongside GitNexus
These two tools answer different questions and are better together:
| Question | Tool |
|---|---|
| What does this function call? | GitNexus |
| Why was this function written this way? | claudememory |
| What will break if I change this? | GitNexus |
| Has this area had bugs before? | claudememory |
| What changed recently? | claudememory |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claudememory-0.1.6.tar.gz.
File metadata
- Download URL: claudememory-0.1.6.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ab29287f92306d0df5f03c3aa4f085c0ad98ba1b30cb0224b2e0bf329f1cb72
|
|
| MD5 |
237916640d32afce194757c13b0c3b91
|
|
| BLAKE2b-256 |
97406accfaecb2938cabffbf1a78eda84dc476b1b7917b2017c6b70341c79042
|
File details
Details for the file claudememory-0.1.6-py3-none-any.whl.
File metadata
- Download URL: claudememory-0.1.6-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1910f869500ddd5909a145d14f886d2da23857ff9adbda808b6a62d08dd18e65
|
|
| MD5 |
dc7d0489ba697fd7ebeeb56550f3f2f6
|
|
| BLAKE2b-256 |
6ff0351b697b70b5ada872283947431a4c20eb225ca987085b32dbae6dfe14bc
|