Purpose
repo-memory is designed to solve a common problem: every time an AI session touches the same codebase, it starts from scratch, repeatedly retrieves the same files, rediscovers the same conventions, and repeatedly asks questions the user has already answered. This is even more severe in multi-user, multi-tool scenarios; for example, a team member's Cursor and your own Claude Code will each independently learn the same codebase. Although CLAUDE.md / .cursorrules already exist for human-written rules, there is a lack of a mechanism for storing agent-verified facts, such as "the auth middleware is located at src/auth/middleware.py:42" "PR #387 chose httpx instead of requests because of HTTP/2" "do not run migrations during peak hours." repo-memory is designed to fill this gap.
Main Capabilities
- Maintain a .ai-memory/ directory in the repository as shared working memory tracked by Git.
- Each AI tool can read from and write to this directory.
- Pure file storage, synchronized through Git, with no daemon, database, authentication, and works offline.
- Provides the CLI command repo-memory and the MCP stdio server repo-memory-mcp.
- The MCP server exposes 5 tools: get_repo_memory, add_fact, list_facts, add_decision, add_gotcha.
- repo-memory init appends a short discoverability note to the repository's CLAUDE.md (or to AGENTS.md if it already exists), telling AI agents entering the repository to first check .ai-memory/ and record new discoveries back into it. This operation is idempotent, and repeated runs will not produce duplicate content. This behavior can be disabled with --no-claude-md. The appended content block is delimited by <!-- BEGIN: repo-memory --> and <!-- END: repo-memory -->, making it easy to freely manually edit other parts of CLAUDE.md.
- All commands accept --root PATH, so that the root path can be specified when the current working directory is not the repository root.
Usage
After installation, run initialization, then treat .ai-memory/ as ordinary files and commit them:
repo-memory init
git add .ai-memory/
git commit -m "Add AI memory"
After anyone (human or AI) pulls the repository, they can immediately see these facts and decisions.
MCP server installation: add the configuration to your client configuration (Claude Desktop / Cursor / Cline), or set the REPO_MEMORY_ROOT environment variable instead of the --repo . argument.
Use Cases
- When multiple AI tools (Claude, Cursor, Cline, etc.) and multiple developers share the same codebase, there is a need to share verified facts, architectural decisions, and gotchas.
- When you want to incorporate AI learning results into the regular code review process: questionable or erroneous facts are filtered out during code review.
- When offline availability is needed (on a plane, train, or conference WiFi environment).
- When per-repository isolation is needed: facts about repository A do not leak into repository B, and storage is repository-local.
Data Format
facts.jsonl -- one JSON object per line, written in append-only mode, expired entries are retained, and readers can refer to the verified_at field to decide whether to re-verify.
Limitations
- Requires Python >=3.10.
- Only depends on the official mcp SDK (for the MCP server).
- Reasons for using Git instead of a database: zero infrastructure, no hosted service, account creation, or API key rotation; Git history itself is the authoritative source, and git blame can show which agent added which fact and when; works offline; filtered through PR review; scoped per repository.
- For more information such as fees, pricing, and specific platform support, no information is currently provided.