Codebase Memory
Lets your AI agent explore your code as a local knowledge graph: find code, follow calls and see what a change affects.
48k stars on GitHubby DeusDataLicense MITUpdated 19 days ago
How to install
This MCP is local: it runs on your computer.
It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Codeβ¦). Choose your app:
Paste in the terminal:
claude mcp add codebase-memory -- npx -y codebase-memory-mcp
Ready! Now test it
Restart the app and paste one of these requests in the chat:
Index this project.
Where is the payment retry logic and who calls it?
What it is
Codebase Memory indexes your repository, docs, configuration and infrastructure files into a persistent local graph. Your agent can then ask focused questions instead of reading many files. Indexing and queries run on your machine with no hosted service or API key.
What it can do
- Index a project into a code knowledge graph
- Find code by symbol, text and semantic search
- Trace callers and dependencies
- Check which parts a change could affect
- Find related tests
- 17 MCP tools in total, plus an optional visual companion called CBM Lens
When to use
- βΊWhen you are new to a large repository and need to find a feature.
- βΊWhen you want to trace a call across services before changing it.
- βΊWhen you want fewer repeated file reads and lower token use.
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
codebase-memory-mcpHelps your agent explore unknown code, map architectures, and understand relationships between system parts. Useful for analyzing complexity and the impact of changes.explore-codebaseHelps your agent find its way around an unfamiliar codebase by searching the code knowledge graph for modules and relationships.codegraphHelps your agent analyze an indexed codebase through its call graph, dependencies, dead code, hotspots and semantic search.Frequently asked questions
Does my code leave my machine?
The README says source analysis and graph storage run locally. CBM Lens can optionally download a model for in-browser AI.
Do I need an API key?
No. Indexing and graph queries need no hosted service or API key.
How do I install it?
Run the install.sh script on macOS or Linux, or install.ps1 on Windows, then restart your agent and say Index this project.
Which agents work with it?
The installer supports 45 automatic or conditional client integrations, including Claude Code, Codex and OpenCode.
Why does Defender flag the binary?
The README says Microsoft Defender may flag it as a known false positive and explains how to verify the files.
Can I turn off hooks?
Yes. Run codebase-memory-mcp install --no-hooks.
If it does not work
- βΊOn Windows, run Unblock-File on install.ps1 or use PowerShell -ExecutionPolicy Bypass if a policy error appears.
- βΊRestart your coding agent after installing, then ask it to index the project.
- βΊIf Defender flags the binary, see the antivirus note in SECURITY.md.
5 new skills a week. 1 minute to read.