index_codebase
Indexes or re-indexes source files and documentation in the given directory. Run this before using searchcode or searchdocs to ensure the database is up to date. Uses tree-sitter for language-agnostic structural extraction and generates dense vector embeddings using sentence-transformers (runs local
How to use it
index_codebase is exposed by the Code Memory MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the index_codebase tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
Install Code Memory
uvx code-memoryOther tools in Code Memory (3)
Perform semantic search and find structural code definitions, locate where functions/classes are defined, or map out dependency references (call graphs). Uses hybrid retrieval (BM25 + vector embeddings) to find exact matches and semantic similarities.
Understand the codebase conceptually — how things work, architectural patterns, SOPs. Searches markdown documentation, READMEs, and docstrings extracted from code.
Debug regressions and understand developer intent through Git history.