Git for AI memory β version-controlled, searchable context that persists across sessions
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Your AI assistants forget everything when the session ends. memgit fixes that.
Version-controlled, cross-AI context that persists, diffs, rolls back, and syncs like code. Switch from Claude to Cursor to ChatGPT mid-project β your context is already there.
You've probably already tried both. Here's why they hit a ceiling:
| Capability | claude.md | mem-search plugin | memgit |
|---|---|---|---|
| Loads only relevant context | β loads everything | β οΈ loads recent observations | β BM25 search β top-k per query |
| Project-aware across a multi-repo life | β per-file | β | β
memories carry a project; the current workspace ranks first |
| Adopt on an existing codebase | β starts blank | β starts blank | β
memgit onboard β seed the store from the repo in one pass |
| Version history | β | β | β full commit log |
| Diff between sessions | β | β | β
memgit diff |
| Roll back a wrong memory | β manual edit | β | β
memgit rollback |
| Works in Cursor, Windsurf, GPT | β Claude only | β Claude only | β all via MCP / HTTP |
| Team sync | β copy-paste files | β | β
memgit git push |
| Scales to 10k+ sessions | β file grows | β search slows | β
memgit squash |
| Measurable token savings | β | β | β
memgit stats |
| Export / import standard format | β | β | β TOON + git |
Run this on your own store to see the actual numbers (measured where possible; estimates labeled):
Why such a big difference? claude.md loads all context every session. memgit injects a bounded resume digest plus BM25-matched recall β only what is relevant to this session, not everything you've ever recorded. The digest is measured by actually rendering it, and the store total is the real corpus size; nothing here is a simulated benchmark.
memgit's data model maps exactly to git:
| memgit | git |
|---|---|
mnemonic | file |
MindState | tree |
checkpoint | commit |
thread | branch |
memgit commit | git commit |
memgit diff | git diff |
memgit log | git log |
memgit squash --keep-last 100 | git rebase -i --autosquash |
memgit git push | git push |
This is not metaphorical β memgit uses a content-addressed object store (SHA-256 blobs) identical to git's architecture. Every memory has a stable SHA. Identical content has identical SHAs. Old state is always recoverable.
Every memory is a readable .toon file under memories/. Push your entire memory set to GitHub with standard git:
Teammates pull and start with your AI's learned rules from session 1:
You can grep, git blame, and git diff your memories just like code:
Mac / Linux:
Mac (Homebrew):
Windows:
(The Chocolatey package is live on community.chocolatey.org; newly pushed versions can take a few days to clear moderation β pip install memgit always has the latest.)
Any AI tool config (no Python needed β npx auto-installs on first run):
init walks you through it β no paths to hunt down. (Importing later is one command with no arguments: memgit sync auto-finds ~/.claude/projects/*/memory.)
Restart your AI tool β it now searches your memory store at the start of every session.
Memory tools have a cold-start problem: install one halfway through a project and it knows nothing β there's no initial point, and context only trickles in from future sessions. memgit solves this with a one-time seeding pass:
onboard first extracts a repo digest deterministically β git history (recent commit subjects, hot files/directories by churn, authors, branch, tags), detected stack from manifests, and the docs worth reading β using bounded, read-only probes that stay near-instant even on huge repositories. The brief then tells your AI agent exactly what to do with it: read only the listed files (no tree crawling), extract 10β20 durable facts (purpose, architecture, conventions, current state, gotchas), save each as a typed memory, and checkpoint the seed set. Paste it into a session β or don't: if the AI searches memory in a project that has none, the MCP server itself replies with the bootstrap instructions instead of a bare "no results."
Memories are project-scoped, filter-by-default (v0.7.0): each carries the workspace it belongs to, and searches, recall injections, and the resume digest (recent memories, checkpoints, depth hints) are filtered to the current project's family plus explicitly-global memories β another project's content never leaks in. Widen deliberately with memgit search --all-projects / all_projects: true (every hit then carries its project label), or hard-filter one project with --project. A memory with no project is explicitly global (applies everywhere): save one with memgit add --global or project: "". A save whose project cannot be determined is never silently global β it's quarantined under _unknown (visible in list as [?project], flagged by lint, surfaced nowhere) until you relabel it with memgit doctor --relabel.
Ask an AI "can we proceed on the pending tasks?" in a fresh session and it will guess from whatever file happens to be open. memgit resume replaces the guess with the record:
Wire it into Claude Code so memory becomes automatic β no tool call, no judgment required:
| Hook | What it enforces |
|---|---|
SessionStart | every session opens with the resume digest in context β status board, checkpoints, critical rules, memory index |
UserPromptSubmit | each prompt is BM25-matched against the store; relevant memories are injected, ending with a "+N more on ''" depth hint when more exists (silent when nothing clears the relevance bar; never repeats within a session) β --no-recall to skip |
PostToolUse | reading a file whose path matches a memory tag surfaces a one-line hint ("6 memories tagged 'x' relate to this path") β tagmap cache only, capped 3/session, --no-ctx-recall to skip |
Stop (guard) | a session that did real work but saved nothing gets ONE nudge to save durable facts before finishing β --no-guard to skip |
Stop (sync) | markdown memories are checkpointed asynchronously at session end |
Why hooks and not just good tool descriptions? We measured it: across 166 real sessions, hook-injected context was delivered in 100% of them while voluntary memory-tool calls happened in 6%. What a hook enforces happens.
The resume digest is deliberately bounded (~350 tokens measured on a 500-memory store): rules are clipped, the critical list is capped, and full text is one get_memory call away.
After months of use, your checkpoint history grows. Squash compresses it, gc reclaims the disk:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/memgit)<a href="https://allmcps.com/mcp/memgit"><img src="https://allmcps.com/api/badge/memgit?style=directory" alt="Memgit on AllMCPs" /></a>