
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@dannyboy2042/claude-context-core
Advanced tools

The core indexing engine for Claude Context - a powerful tool for semantic search and analysis of codebases using vector embeddings and AI.
📖 New to Claude Context? Check out the main project README for an overview and quick start guide.
npm install @dannyboy2042/claude-context-core
See OpenAI Documentation for more details to get your API key.
OPENAI_API_KEY=your-openai-api-key
By default, Claude Context uses LanceDB for local vector storage - no setup required! All data is stored locally in ./.claude-context/lancedb/.
# Optional: Customize LanceDB storage path
LANCEDB_PATH=./my-custom-path
# Optional: Use Zilliz Cloud instead of local LanceDB
VECTOR_DB_TYPE=milvus
MILVUS_ADDRESS=your-zilliz-cloud-public-endpoint
MILVUS_TOKEN=your-zilliz-cloud-api-key
For larger teams or advanced features, you can optionally use Zilliz Cloud. You can sign up on Zilliz Cloud to get a free Serverless cluster.

After creating your cluster, open your Zilliz Cloud console and copy both the public endpoint and your API key.

If you need help creating your free vector database or finding these values, see the Zilliz Cloud documentation for detailed instructions.
💡 Tip: For easier configuration management across different usage scenarios, consider using global environment variables.
import {
Context,
OpenAIEmbedding,
LanceDBVectorDatabase
} from '@dannyboy2042/claude-context-core';
// Initialize embedding provider
const embedding = new OpenAIEmbedding({
apiKey: process.env.OPENAI_API_KEY || 'your-openai-api-key',
model: 'text-embedding-3-small'
});
// Initialize vector database (LanceDB - local, no setup required)
const vectorDatabase = new LanceDBVectorDatabase({
uri: process.env.LANCEDB_PATH || './.claude-context/lancedb'
});
// Create context instance
const context = new Context({
embedding,
vectorDatabase
});
// Index a codebase
const stats = await context.indexCodebase('./my-project', (progress) => {
console.log(`${progress.phase} - ${progress.percentage}%`);
});
console.log(`Indexed ${stats.indexedFiles} files with ${stats.totalChunks} chunks`);
// Search the codebase
const results = await context.semanticSearch(
'./my-project',
'function that handles user authentication',
5
);
results.forEach(result => {
console.log(`${result.relativePath}:${result.startLine}-${result.endLine}`);
console.log(`Score: ${result.score}`);
console.log(result.content);
});
text-embedding-3-small, text-embedding-3-large)interface ContextConfig {
embedding?: Embedding; // Embedding provider
vectorDatabase?: VectorDatabase; // Vector database instance (required)
codeSplitter?: Splitter; // Code splitting strategy
supportedExtensions?: string[]; // File extensions to index
ignorePatterns?: string[]; // Patterns to ignore
}
[
// Programming languages
'.ts', '.tsx', '.js', '.jsx', '.py', '.java', '.cpp', '.c', '.h', '.hpp',
'.cs', '.go', '.rs', '.php', '.rb', '.swift', '.kt', '.scala', '.m', '.mm',
// Text and markup files
'.md', '.markdown'
]
node_modules/**, dist/**, build/**, out/**.git/**, .vscode/**, .idea/***.min.js, *.bundle.js, *.mapindexCodebase(path, progressCallback?) - Index an entire codebasesemanticSearch(path, query, topK?, threshold?) - Search indexed code semanticallyhasIndex(path) - Check if codebase is already indexedclearIndex(path, progressCallback?) - Remove index for a codebaseupdateIgnorePatterns(patterns) - Update ignore patternsupdateEmbedding(embedding) - Switch embedding providerupdateVectorDatabase(vectorDB) - Switch vector databaseinterface SemanticSearchResult {
content: string; // Code content
relativePath: string; // File path relative to codebase root
startLine: number; // Starting line number
endLine: number; // Ending line number
language: string; // Programming language
score: number; // Similarity score (0-1)
fileExtension: string; // File extension
}
import { Context, LanceDBVectorDatabase, VoyageAIEmbedding } from '@dannyboy2042/claude-context-core';
// Initialize with VoyageAI embedding provider
const embedding = new VoyageAIEmbedding({
apiKey: process.env.VOYAGEAI_API_KEY || 'your-voyageai-api-key',
model: 'voyage-code-3'
});
const vectorDatabase = new LanceDBVectorDatabase({
uri: './.claude-context/lancedb'
});
const context = new Context({
embedding,
vectorDatabase
});
const context = new Context({
embedding,
vectorDatabase,
supportedExtensions: ['.ts', '.js', '.py', '.java'],
ignorePatterns: [
'node_modules/**',
'dist/**',
'*.spec.ts',
'*.test.js'
]
});
Claude Context implements an intelligent file synchronization system that efficiently tracks and processes only the files that have changed since the last indexing operation. This dramatically improves performance when working with large codebases.

The file synchronization system uses a Merkle tree-based approach combined with SHA-256 file hashing to detect changes:
~/.context/merkle/ directoryThis package is part of the Claude Context monorepo. Please see:
MIT - See LICENSE for details
Special thanks to Cheney Zhang and the Zilliz team for creating the original Claude Context project. This fork builds upon their excellent foundation to provide a local-first vector database experience with LanceDB.
FAQs
Core indexing engine for Claude Context
We found that @dannyboy2042/claude-context-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.