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. 2. If prior Claude Code memories exist, import them once: memgit import claude-code 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 installs a SessionStart hook so every new session auto-starts with the "memgit resume" digest (last checkpoints, work in flight, critical rules) already in context — no tool call needed. 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 "" -t -w "" -W "" --tags a,b -p <1|2|3> Types: fb=feedback · us=user · pj=project · rf=reference · cn=convention · lx=lesson Priority: 3=critical (always loaded) · 2=default · 1=low Save: user corrections (fb), durable preferences (us), project decisions and status (pj), hard-won lessons (lx), team conventions (cn), key links (rf). Skip: session chatter, secrets, anything derivable from the code itself. 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 , work, then memgit merge . Set MEMGIT_AUTHOR= 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.