Skip to main content

git-memory

Dual-layer semantic index over Git commit history for Claude Code.

Layer Purpose
ChromaDB 1 document/commit, cosine similarity, metadata filters — fast, authoritative facts
Mem0 LLM-extracted context, cross-session learned interpretation — the why layer

Install

pip install git-memory

No external services required — works out of the box with three embedding options:

Mode Setup Cost
Ollama (default) ollama pull nomic-embed-text Free, fully local
sentence-transformers pip install "git-memory[sentence-transformers]" Free, fully local, no Ollama
OpenAI pip install "git-memory[openai]" + OPENAI_API_KEY ~$0.0001/commit

Quick start

# 1. Index your repository
git-memory index --repo-path /path/to/repo --user-id my-repo

# 2. Install Claude Code skills + MCP config
git-memory install --repo-path /path/to/repo --user-id my-repo

# 3. Restart Claude Code — then use /git-memory-search, /git-memory-debug etc.

MCP tools

Tool Description
search_git_history(query) Semantic search over commit history
latest_commits(limit) N most-recent indexed commits
commits_touching_file(filename) All commits that modified a file
bug_fix_history(component) Bug/security fixes for a component
architecture_decisions(topic) Refactors, migrations, design decisions

CLI

git-memory index    --repo-path . --user-id myapp   # bulk index
git-memory serve                                     # start MCP server (stdio)
git-memory status   --repo-path .                    # show coverage
git-memory install  --repo-path . --user-id myapp   # install plugin
git-memory store    HEAD                             # store single commit (hook)

Configuration

All settings via environment variables:

Variable Default Description
GIT_MEMORY_REPO_PATH . Repository to index
GIT_MEMORY_USER_ID git_memory_system Mem0 namespace (use per-repo names)
GIT_MEMORY_CHROMA_DIR ~/.cache/git_memory/chroma_commits ChromaDB storage path
GIT_MEMORY_EMBED_PROVIDER ollama Embedding backend: ollama, openai, sentence-transformers
GIT_MEMORY_EMBED_MODEL (provider default) Override embedding model name
GIT_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

  • GitNexus answers what calls what (structural, live code)
  • git-memory answers why it was written that way (historical, commit-level)

Metadata

Release files for git-memory 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-memory 0.1.1
File Size Uploaded
git_memory-0.1.1.tar.gz 17.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git-memory 0.1.1
File Interpreter ABI Platform
git_memory-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 36.0 kB

Release files / git_memory-0.1.1.tar.gz

Download URL git_memory-0.1.1.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
18cdf685a83beef7f57e3179db2c8ea09e0cb5785f2e4f3310abc173a463d6c9
BLAKE2b-256 checksum
How to use checksums
9478b6b3645029268e3a0b6e4ceb5c42d09e9cbdf63e3b032668a3bece863f20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / git_memory-0.1.1-py3-none-any.whl

Download URL git_memory-0.1.1-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c08535054802948520e42c8165ea4ed3b4ac9784673ff38d0bf43a6ab2f68176
BLAKE2b-256 checksum
How to use checksums
bd8055677e2138760de7d9e16456763e444a1b12912eecd13361f79cb8809dd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page