Claude Context is an MCP plugin that indexes a codebase into a vector database and exposes semantic code search to AI coding agents such as Claude Code. Instead of loading whole directories into the model's context for each request, the agent runs natural-language queries against the index and receives only the related code chunks. A controlled evaluation reports about 40% fewer tokens at equivalent retrieval quality.
Indexing chunks source files using an abstract syntax tree (AST) splitter, with a character-based splitter as fallback, embeds the chunks, and stores them in Milvus or Zilliz Cloud. Search combines BM25 keyword matching with dense vector retrieval. A Merkle tree tracks file changes so re-indexing covers only modified files. The MCP server uses stdio transport and works with any MCP-compatible client, with configuration examples for Claude Code, Codex CLI, Gemini CLI, Qwen Code, Cursor, Windsurf, VS Code, Cline, Roo Code, Augment, Zencoder, Cherry Studio, and Void.
The project is a TypeScript monorepo (Node.js 20+) with three packages: @zilliz/claude-context-core, the indexing and search engine usable directly in applications; @zilliz/claude-context-mcp, the MCP server; and a VS Code extension, Semantic Code Search.
Features
- MCP tools: indexcodebase, searchcode, clearindex, and getindexing_status
- Hybrid search: BM25 plus dense vector retrieval over the indexed chunks
- AST-based chunking: syntax-aware code splitting with automatic fallback to a character-based splitter
- Incremental indexing: Merkle trees identify changed files so only those are re-indexed
- Embedding providers: OpenAI, VoyageAI, Ollama, and Gemini, with configurable models such as text-embedding-3-large or voyage-code-3
- Vector databases: Milvus or the managed Zilliz Cloud service
- Language coverage: TypeScript, JavaScript, Python, Java, C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, Scala, and Markdown
- Customizable rules: file extensions, ignore patterns, and embedding models are configurable
- Core package API: Context, MilvusVectorDatabase, and embedding classes for building your own indexing and search flows
- VS Code extension: semantic search and navigation inside the editor
Integrates with
Claude Code
Terminal-based agentic coding tool that reads your codebase and runs tasks through natural-language commands
Codex
Lightweight coding agent that runs in your terminal
Roo Code
Discontinued VS Code assistant with Code, Architect, Ask, and Debug modes; the community fork ZooCode continues it
