# memgit > Git for AI memory. Version-control your AI assistant's context across sessions, devices, and teams. ## What this is memgit is an open-source CLI + MCP server that brings git-style versioning to AI assistant memory. It works with Claude Code, Claude Desktop, Cursor, Windsurf, Cline/Roo-Code, Continue, and any other MCP client. ## Key concepts - Mnemonic: a single memory fact (like a git blob), stored as a readable .toon file - MindState: snapshot of all memories (like a git tree) - Checkpoint: versioned snapshot with history (like a git commit) - Thread: named memory context (like a git branch) - TOON format: compact notation for memory records; retrieval via BM25 search loads only relevant memories instead of everything ## Agent adoption prompt Fetch https://memgit.dev/llm.txt for a complete end-to-end prompt an AI agent can follow to install memgit (OS-aware install paths), wire it into its host tool via MCP, and adopt it as its version-controlled memory system. ## Install pip install memgit # or: brew tap code4161/tap && brew install memgit # MCP server only (Node.js): npx -y memgit-mcp ## Quick setup memgit init # create the store (auto-picks location) memgit import claude-code # one-time import of existing Claude Code memories memgit setup claude-code # register the MCP server (or: memgit setup all) memgit status # verify it's working ## Core commands memgit add "" -t -w "" -W "" # save a memory memgit search "query" --toon # BM25 relevance search memgit commit -m "message" # checkpoint memgit log / diff / rollback HEAD~1 # history, diff, undo memgit stats / lint / fsck # health ## Most useful pages - https://memgit.dev - https://memgit.dev/llm.txt (agent adoption prompt) - https://memgit.dev/docs - https://github.com/code4161/memgit#readme ## GitHub https://github.com/code4161/memgit