Introduction to Claude Context
Relevant source files
The following files were used as context for generating this wiki page:
Claude Context is a multi-platform solution designed to provide AI coding agents—such as Claude Code, Cursor, and VS Code—with deep semantic context from entire codebases. By utilizing semantic search (dense vectors) combined with traditional BM25 search (hybrid search), it enables AI models to locate relevant code snippets across millions of lines of code without the prohibitive cost of loading entire directories into a limited context window.
Sources: README.md:14-23, packages/core/README.md:3-8
The project is structured as a monorepo containing a core indexing engine, a Model Context Protocol (MCP) server, and IDE-specific extensions. It handles the full lifecycle of code context management, including intelligent AST-based chunking, incremental indexing via Merkle trees, and scalable storage in vector databases like Milvus or Zilliz Cloud.
Sources: README.md:270-280, packages/core/README.md:126-130
Project Architecture
Claude Context is organized into three primary modules, each serving a specific role in the ecosystem.
The architecture diagram illustrates how the core engine serves as the foundational dependency for the MCP server and various browser/IDE extensions.
Sources: README.md:264-280, packages/core/README.md:195-200
Core Components
| Component | Description |
|---|---|
| @zilliz/claude-context-core | The fundamental indexing engine providing embedding, vector DB integration, and search logic. |
| @zilliz/claude-context-mcp | A Model Context Protocol server that allows AI agents to interact with the core engine via standard tools. |
| VSCode Extension | A native IDE integration for semantic code search and navigation. |
| Chrome Extension | An extension for indexing and searching code directly within the GitHub interface. |
| Sources: README.md:274-280, packages/chrome-extension/README.md:3-15 |
Core Features and Implementation
Hybrid Code Search
Claude Context utilizes hybrid search, combining BM25 keyword matching with dense vector embeddings. This allows for natural language queries such as "find functions that handle user authentication" to return contextually relevant results.
Sources: README.md:255-257, packages/mcp/README.md:435-437
Incremental Indexing and Synchronization
To ensure performance on large repositories, the system implements incremental indexing. It uses SHA-256 file hashing and a Merkle tree-based approach to detect only added, modified, or removed files.
Sources: packages/core/README.md:130-150
This sequence shows the process of checking for codebase changes before initiating a re-index operation.
Sources: packages/core/README.md:138-160
Intelligent Code Chunking
The engine supports two primary methods for splitting code into manageable chunks:
- AST Splitter: Analyzes the Abstract Syntax Tree for syntax-aware splitting, ensuring chunks respect code boundaries (default).
- LangChain Splitter: A character-based fallback for simple text/markup files.
Sources: packages/core/README.md:92-95, packages/vscode-extension/README.md:68-75
Technical Specifications
Supported Technologies
Claude Context supports a wide range of providers to ensure flexibility across different environments.
| Category | Supported Providers / Tools |
|---|---|
| Embeddings | OpenAI, VoyageAI, Google Gemini, Ollama (Local) |
| Vector DB | Milvus, Zilliz Cloud (Serverless/Managed) |
| Languages | TS, JS, Python, Java, C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, Scala, Markdown |
| Sources: README.md:283-290, packages/core/README.md:82-90 |
Available MCP Tools
When used as an MCP server, the following tools are exposed to AI agents:
index_codebase: Indexes a directory for hybrid search. Parameters includepath,force,splitter, andignorePatterns.search_code: Performs natural language search. Parameters includequery,limit, andextensionFilter.get_indexing_status: Returns the progress percentage or completion status of an active indexing job.clear_index: Removes the search index for a specific path.
Sources: packages/mcp/README.md:448-478, README.md:235-245
Configuration and Usage
Users can initialize the core engine in a Node.js environment using the following pattern:
import { Context, MilvusVectorDatabase, OpenAIEmbedding } from '@zilliz/claude-context-core';
const context = new Context({
embedding: new OpenAIEmbedding({ apiKey: 'sk-...' }),
vectorDatabase: new MilvusVectorDatabase({ address: 'localhost:19530' })
});
// Start indexing
const stats = await context.indexCodebase('./my-repo');
Sources: packages/core/README.md:38-65, examples/basic-usage/index.ts:38-60
Claude Context reduces token consumption by approximately 40% compared to full-directory loading, providing a cost-effective solution for large-scale codebase analysis.
Sources: README.md:248-251