The Future of Git.
Version-control your AI assistant's context. Diff sessions. Roll back mistakes. Sync to your team.
Works with the AI tools you already use
The Problem
Your AI starts from zero. Every. Single. Session.
You teach it everything
Your AI learns your architecture, your team's conventions, the bugs you've already solved. It gets smart. The session is productive.
Session ends.
Context gone. The AI assistant's memory evaporates. Everything it learned about your codebase — gone.
You explain it again.
Re-architect in chat. Re-establish your conventions. Redo the same debugging explanations. Every. Single. Session.
“It's 2005 — the year before git — for AI context management. Nobody has built the version control layer yet.”
How it works
Every session. Versioned.
Every memory change is tracked. Roll back, diff, search — exactly like you do with code.
$ memgit log◉ c3a891f "Added React hooks rules + fixed routing memory" 2h ago│ memories: +3 added, 1 modified│◉ b7f3e2a "Removed stale API endpoint, updated auth context" yesterday│ memories: 1 removed, 2 modified│◉ a1d9f3c "Fixed prefer-callbacks rule — was causing errors" 2 days ago│ memories: 1 modified│◉ 9d1c4e8 "Initial import from claude-code (108 memories)" Jul 1memories: 108 added
Token Savings
95% fewer tokens. Same context quality.
claude.md loads everything on every session. memgit uses BM25 relevance scoring to load only the 8 memories most relevant to your current task.
* Numbers from memgit stats on a real 108-memory store
Multi-IDE Support
One memory store. Works everywhere.
Write a memory in Claude Code. Your Cursor session has it in 2 seconds. Your Gemini session too.
Four hooks (resume, per-prompt recall, capture guard, sync) + 6 native MCP tools: resume, search, save, get, list, log.
memgit injects relevant context into .cursorrules before each session.
TreeView sidebar, memory diff viewer, vscode.lm tool registration.
Same injection pattern as Cursor. Auto-detects Windsurf config path.
Section-marker injection + native tool definitions for Gemini 2.5 Pro.
AIAssistantContextProvider + Tool Window (Active / History / Threads).
Injects relevant context into .openai/instructions.md before each run.
OpenAPI 3.1 HTTP server. Any LLM with tool-use can call memgit's REST API.
The Future of Git
Git was invented because code needed history.
memgit was invented because AI context does too.
In 1991, Linus Torvalds was frustrated. Code was shared as patches emailed between developers. No way to see who changed what, no way to roll back a mistake, no way to merge two people's work. So he built git — every change became a permanent, addressable object.
That same frustration exists today — but for AI context.
Your AI assistant accumulates knowledge: your architecture decisions, your team's coding conventions, the bugs you've already solved. But when the session ends, it's gone. The next session starts blank. Your colleague's Cursor has no idea what your Claude figured out last week. When a “helpful” instruction turns out to be wrong, you can't roll it back.
We're in 2005. The year before git. For AI context management.
memgit is the missing layer. Every piece of AI context becomes a versioned object with a hash. Every session creates a checkpoint. memgit diff HEAD~1 HEAD shows what your AI learned today. memgit push syncs your entire context to your team.
The teams that figure this out first will have an AI advantage that compounds with every session. Their AI knows what yours doesn't. That gap widens every week.
In ten years, every engineering team will have a shared AI memory repository — versioned, audited, and as foundational as their code repository. memgit is the tool that makes that possible today.
Security & Privacy
Built to be trusted.
Your AI context contains your architecture decisions, your team's conventions, your business logic. We take that seriously.
Local-first. Always.
Your memories live in .memgit/ on your own machine. By default, zero bytes leave your computer. The free tier is completely offline — no account, no server, no network calls.
Verified: no outbound connections in free tier100% open source
Every line of the CLI, TOON parser, MCP server, and VS Code extension is MIT licensed and on GitHub. Read the code, audit it, fork it. Nothing is hidden behind a build step.
github.com/code4161/memgitHuman-readable format
TOON is plain text. Open .memgit/objects/ in any editor. grep it, diff it with standard tools, commit it to your own git repo. No binary blobs, no proprietary encoding.
$ cat .memgit/objects/ab/c123 → readableZero telemetry
The CLI sends no analytics, crash reports, or usage metrics. There is no call-home mechanism. You can run memgit on an air-gapped machine and it works identically.
Confirmed: grep -r 'telemetry' — returns nothingNo vendor lock-in
Export your entire memory store to markdown anytime with memgit export. Your context was yours before memgit, and it stays yours. Cancel Sync and your local data is untouched.
$ memgit export --format=markdown → your data backVerified integrity
Every memory object is SHA-256 content-addressed. memgit fsck verifies the entire store locally. The same cryptographic model git uses — no silent corruption possible.
$ memgit fsck → OK (108 objects verified)About cloud sync (coming Phase 4)
When Sync launches, your memory objects will be transmitted over TLS 1.3 and stored encrypted at rest using AES-256. You authenticate with OAuth (GitHub) — we never see your password. You control your data: delete your account and all objects are purged within 24 hours. The sync tier will publish a full security doc before launch.
Found a security issue? Report it privately on GitHub →
Pricing
Free CLI. Optional cloud.
The CLI and local engine are MIT open source — forever. memgit cloud is the paid sync layer, exactly like GitHub to git.
MIT open source
The full local memgit. No account required.
- ✓Full CLI: init, add, commit, log, diff, rollback
- ✓TOON format + migration from markdown
- ✓Claude Code MCP integration
- ✓VS Code extension + IDE adapters (Cursor, Windsurf, Gemini CLI)
- ✓Unlimited local memories + checkpoints
- ✓BM25 relevance scoring
or $80/year · India: ₹399/mo · ₹3,999/yr
E2E-encrypted sync across your machines and team.
- ✓Everything in Free
- ✓End-to-end encrypted sync — the server can't read your data
- ✓Multi-device: push/pull memories anywhere
- ✓Team threads with per-member sealed keys
- ✓One-time payments per period — no auto-debit, no subscription
- ✓Trial ends? Your data stays readable + exportable
Prices shown at checkout in INR or USD. Payments are one-time purchases for a fixed period (no auto-renewal), processed securely by Cashfree Payments. See the Terms and Refund Policy.
For AI Agents
Copy for LLM.
One paste and your agent installs memgit end-to-end — picks the right install path for the OS, wires up MCP, and adopts memgit as its version-controlled memory. Every command in the prompt is real.
Operating system
Install method
MEMGIT — INSTALL & ADOPT AS YOUR MEMORY SYSTEM (https://memgit.dev)
You are an AI agent on a machine where memgit should be installed and adopted
as your persistent, version-controlled memory. memgit is git for AI memory:
a local store (a real git repo of human-readable .toon files) that gives you
BM25 relevance search (load only what matters instead of everything),
checkpoints, history, diffs between any two memory states, safe rollback
(nothing is ever deleted), threads (branches), and native MCP tools.
Treat it exactly like git for code: atomic memories, meaningful checkpoints,
reviewed diffs, and rollback when memory gets polluted.
Every command below is real — do not invent flags. Complete all three phases,
then report back.
━━ PHASE 1 · INSTALL ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Detect the OS and available package managers, then take the FIRST path that matches:
1. Python 3.11+ with pip (any OS):
pip install memgit
(or "pipx install memgit" for an isolated install)
2. Homebrew (macOS / Linux):
brew tap code4161/tap && brew install memgit
3. Windows without Python:
install Python 3.11+ from https://python.org (check "Add python.exe to PATH"),
then: pip install memgit
4. No Python available, Node.js present (MCP-only mode):
skip the CLI install — run the MCP server directly with: npx -y memgit-mcp
(CLI commands below then map to the MCP tools instead)
Optional — VS Code: additionally install the "memgit" extension
(publisher: code416-memgit) for the visual memory timeline — it complements,
not replaces, the CLI/MCP install.
Verify: memgit --version
━━ PHASE 2 · INITIALIZE & WIRE INTO YOUR HOST TOOL ━━━━━━━━━━━━━━━━━━━━━━━
1. memgit init
Auto-picks the store location: ~/.claude/memgit-store (Claude Code),
~/.cursor/memgit-store (Cursor), ~/.windsurf/memgit-store (Windsurf),
else ~/.memgit-store. Pass a directory to override. Safe to re-run.
init also auto-finds existing Claude Code memories and offers to import
them on the spot (auto-imports when non-interactive).
2. If you skipped that import, run it anytime (no path needed — it auto-finds
~/.claude/projects/*/memory):
memgit sync
3. Register the MCP server with whichever tool you run inside (safe to re-run):
memgit setup claude-code | claude-desktop | cursor | windsurf | cline | continue | gemini-cli
or: memgit setup all (auto-registers every detected tool)
or: memgit setup print-config (prints MCP JSON for any other client;
the server command is: npx -y memgit-mcp)
4. If the host tool is Claude Code, also run: memgit setup hooks
This wires memory in so it happens automatically, not on your judgment:
SessionStart injects the "memgit resume" digest; UserPromptSubmit injects
the memories relevant to each prompt (BM25, silent when nothing is relevant);
Stop nudges you to save anything durable you learned and syncs markdown
memories. (--no-recall / --no-guard opt out of the per-prompt / capture hooks.)
5. Restart the host tool so the MCP tools load. You will then have:
resume_session · search_memories · get_memory · list_memories · save_memory · get_checkpoint_log
6. Health check: memgit status && memgit log
━━ PHASE 3 · ADOPT THE DOCTRINE (this is the point) ━━━━━━━━━━━━━━━━━━━━━━
From now on, memgit is your system of record for what you learn:
RESUME BEFORE ASSUMING — when a request presupposes shared history ("continue",
"the pending tasks", "that bug from before", a fresh session after a break),
run: memgit resume (or MCP resume_session). It is the authoritative record
of the last actions taken; an open file only shows what the user is looking at.
RECALL FIRST — before answering anything about past work, decisions, or
preferences, search: memgit search "query" --toon (or MCP search_memories).
Never claim you don't remember without searching.
SAVE QUALITY, NOT VOLUME — one atomic, durable fact per memory:
memgit add <kebab-slug> "<the fact>" -t <type> -w "<why>" -W "<when to apply>" --tags a,b -p <1|2|3>
Types: fb=feedback · us=user · pj=project · rf=reference · cn=convention ·
lx=lesson · co=core (per-project operating guide) · tr=tracker (LIVE status
of one entity, slug <entity>-status — update by re-saving the same slug;
memgit is the authority for this status, files are downstream).
Priority: 3=critical (always loaded) · 2=default · 1=low
Long-form detail goes in --body "<full multi-line detail>" (or --body - to
read stdin) — the one-line fact stays searchable, the body stays lossless.
Scope to a workspace with --project <label>; MCP save_memory does this
automatically from the cwd. Search and recall are FILTERED to the current
project's family plus explicitly-global memories (v0.7.0) — widen with
--all-projects / all_projects: true when you really mean the whole store.
A save with no determinable project is quarantined as _unknown, never
silently global; mark true globals explicitly with --global / project: "".
Save: user corrections (fb), durable preferences (us), project decisions and
status (pj), hard-won lessons (lx), team conventions (cn), key links (rf),
live entity state (tr).
Skip: session chatter, secrets, anything derivable from the code itself.
CORRECT BY SUPERSEDING — when a saved memory turns out wrong or outdated,
save the correction with supersedes=[old-slug] (MCP) or
--supersedes old-slug (CLI) instead of a "CORRECTED:" prefix or a duplicate.
Superseded memories stop surfacing in search/recall/resume automatically;
history is preserved and "memgit list" still shows them marked.
BOOTSTRAP A BLANK PROJECT — adopting memgit on an existing codebase mid-project
leaves the store empty for that project. Run: memgit onboard
It prints the seeding brief: read README/docs/manifests + recent git log,
extract 10-20 durable facts, save each as a typed memory, then checkpoint
with: memgit commit -m "onboard: <project>". Do this once per project.
CHECKPOINT AT MILESTONES — after meaningful work (task done, decision made,
session handoff): memgit commit -m "what changed and why"
Checkpoints are your cross-session history; write messages a future agent
can act on.
REVIEW & REPAIR LIKE GIT —
memgit log history of checkpoints
memgit diff what changed between memory states
memgit rollback HEAD~1 --dry-run preview an undo
memgit rollback HEAD~1 -y undo memory pollution (history preserved)
KEEP THE STORE HEALTHY — the store tells you when it needs care: resume/status/
stats print a maintenance hint (with the exact command) past 500 checkpoints
or 50 MB. Act on it when you see it.
memgit stats token-savings proof + store health (--json for terse output)
memgit lint memory quality issues
memgit fsck integrity check
memgit gc reclaim space (--dry-run first; --squash-keep N to compact too)
memgit squash compact old history (collapsed checkpoints are archived, not lost)
MULTIPLE AGENTS, ONE STORE — writes are lock-serialized and concurrent commits
auto-merge, so parallel agents are safe. For isolated workstreams:
memgit thread create <agent-name>, work, then memgit merge <agent-name>.
Set MEMGIT_AUTHOR=<agent-name> so checkpoints record who did what.
SYNC & SHARE (optional) — stores are plain git repos; use "memgit git ..."
to push/pull memories across machines and teammates.
━━ REPORT BACK ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Tell the user: the install path used, memgit --version output, where the
store lives, which tools were registered, and the output of memgit status.
Then save your first memory: a 'cn' mnemonic recording that memgit is now
the memory system of record on this machine.Works with Claude Code, Cursor, Windsurf, Cline, Continue, Claude Desktop — or any MCP client via memgit setup print-config.
Get Started
Start in 30 seconds.
Free. Open source. No account needed. Works with your existing Claude Code memories.
1Install
2Set up your AI tool
memgit initInitialize and import your existing AI memory filesmemgit setup claude-codeRegister the MCP server (or: memgit setup all)memgit search "your query"AI now reads only the relevant memories — 95% fewer tokens