Crystallize Code Repositories into Searchable Knowledge
Turn large repositories into a searchable, AI-consumable knowledge base at roughly a 5:1 token compression ratio.
Maintainer of this project? Claim this page to edit the listing.
1.2.2Add to Favorites
Why it matters
Transform large code repositories into structured, AI-understandable knowledge bases. This asset systematically analyzes and optimizes code to create searchable knowledge for AI agents, enabling efficient understanding of complex projects.
Outcomes
What it gets done
Initialize repository crystallization and scan files.
Generate comprehensive analysis guidance and quality standards.
Create searchable knowledge bases with natural language queries.
Monitor crystallization progress and validate context quality.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-context-crystallizer | bash Capabilities
Tools your agent gets
Get comprehensive analysis guidance with templates and quality standards
Initialize repository crystallization, scan and prepare files
Get the next file for AI analysis in the crystallization process
Save generated AI knowledge and crystallized context
Monitor crystallization status and progress
Find relevant knowledge by functionality or keywords
Combine multiple contexts within token limits
Discover code relationships and dependencies
Overview
Context Crystallizer MCP Server
An MCP server that crystallizes large repositories into a searchable, AI-consumable knowledge base at roughly 5:1 token compression via per-file AI analysis. Use it on enterprise-scale repositories (10,000+ files) where an AI agent hits its context limit - not for small projects.
What it does
Context Crystallizer transforms large repositories into structured, searchable, AI-consumable knowledge through systematic per-file analysis. Each file is analyzed by an AI agent to extract its purpose, key APIs, patterns, and relationships, producing a "crystallized" context base at roughly a 5:1 token compression ratio versus the source, so agents can search by functionality ("find authentication middleware") instead of reading raw files one by one. It exposes 11 MCP tools for conversation-driven crystallization plus equivalent CLI commands for direct developer control. A representative flow: asked how authentication works in a massive project, the assistant first crystallizes the repository, reports finding 5 files with authentication logic (a JWT middleware handling token validation with Redis session caching, in this case) and explains it using the crystallized contexts, then when asked what depends on that system, calls find_related_crystallized_contexts() to discover the dependents without re-reading raw source.
When to use - and when NOT to
Use this on enterprise-scale repositories - 10,000+ files - where an AI agent hits its context limit and would otherwise have to work blindly or guess about unfamiliar code. The workflow is: initialize crystallization (scans the repo, respects .gitignore, skips node_modules/dist/build/.git and binaries/files over 1MB), have the agent crystallize files one at a time, then search or bundle the resulting contexts for any task. It is not useful for small projects that already fit comfortably in a single context window, and crystallized contexts go stale after code changes - run update_crystallized_contexts after edits to keep them current.
Capabilities
MCP tools: get_crystallization_guidance (analysis methodology and quality standards), init_crystallization (queue files, respecting .gitignore), get_next_file_to_crystallize, store_crystallized_context, get_crystallization_progress, search_crystallized_contexts (functionality search), get_crystallized_bundle (combine multiple contexts within token limits), find_related_crystallized_contexts (dependency discovery), search_by_complexity, validate_crystallization_quality (completeness/readability scoring with suggestions), update_crystallized_contexts (refresh after changes). Equivalent CLI commands: context-crystallizer init <repo-path>, search "<query>", bundle <files...>, related <file-path>, validate [file], update, progress.
How to install
npm install -g context-crystallizer
cd /path/to/your/project
context-crystallizer
Claude Desktop configuration (~/claude_desktop_config.json):
{
"mcpServers": {
"context-crystallizer": {
"command": "npx",
"args": ["context-crystallizer"],
"cwd": "/path/to/your/project"
}
}
}
Crystallized contexts persist in a .context-crystallizer/ directory in the project root; the server must be started from the project root and kept running for AI agent integration.
Who it's for
Developers and teams working with AI coding assistants on large, enterprise-scale codebases who need the assistant to understand the whole repository's functionality and relationships without exceeding its context window on every query. Licensed MIT.
Source README
Context Crystallizer ๐
AI Context Engineering for Large Repositories
Transform massive repositories into crystallized, AI-consumable knowledge through systematic analysis and optimization.
What is Crystallization?
Just as pressure transforms carbon into diamonds, Context Crystallizer applies systematic AI analysis to transform raw repositories into crystallized knowledge - structured, searchable, and optimized for AI consumption. Each file is analyzed to extract its purpose, key APIs, patterns, and relationships, creating a knowledge base that AI can efficiently search and understand.
Inspiration
Context Crystallizer was inspired by AI Distiller (aid), which pioneered the concept of intelligently extracting essential information from large codebases for AI consumption. While AI Distiller focuses on extracting public APIs and type information using tree-sitter parsers, Context Crystallizer takes a complementary approach by having AI agents generate comprehensive crystallized contexts about functionality, patterns, and relationships.
The Problem ๐ฅ
AI agents hit context length limits when working with large repositories. A typical enterprise repository has 10,000+ files, but LLMs can only process a fraction at once. This forces AI to work blindly or make assumptions about unfamiliar code.
The Solution โจ
Context Crystallizer creates a searchable crystallized context base of AI-optimized knowledge:
- ๐ Search by functionality: "find authentication middleware"
- โก Token-efficient: 5:1 compression ratio (source:crystallized context)
- ๐ค AI-optimized format: Structured specifically for LLM consumption
- ๐ Smart assembly: Combines multiple contexts within token limits
- ๐ Crystallized knowledge: Preserves essential information in optimized form
How It Works
Simple 3-step crystallization process:
- Initialize: Scan repository and prepare for crystallization
- Automatically respects
.gitignorepatterns - Skips common build directories (node_modules, dist, build, .git)
- Filters out binary files and very large files (>1MB)
- Automatically respects
- Crystallize: AI analyzes each file to extract meaningful knowledge
- Search: Find relevant crystallized contexts for any task
Quick Demo
Developer using Claude Code with a large documentation repository:
Developer: "I need to understand how authentication works in this massive project"
Claude: "I'll crystallize this repository first to build a searchable knowledge base, then find all authentication-related information."
Claude crystallizes the repository - scanning and analyzing each file
Claude: "Crystallization complete! I found 5 files with authentication logic. The main JWT middleware handles token validation with Redis session caching. Here's how it works..."
Claude provides comprehensive explanation using crystallized contexts
Developer: "What files depend on the authentication system?"
Claude: "Let me search for related crystallized contexts..."
Claude uses find_related_crystallized_contexts() to discover dependencies
Installation & Setup
Quick Start (5 minutes)
# Install globally via NPM
npm install -g context-crystallizer
# Navigate to your project
cd /path/to/your/project
# Start the MCP server
context-crystallizer
Claude Desktop Integration
Add to your Claude Desktop configuration (~/claude_desktop_config.json):
{
"mcpServers": {
"context-crystallizer": {
"command": "npx",
"args": ["context-crystallizer"],
"cwd": "/path/to/your/project"
}
}
}
Context Crystallizer Tools
Context Crystallizer provides dual access to crystallization functionality: AI agents can use MCP tools for conversation-driven analysis, while developers can use CLI commands for direct control.
AI Agent Usage (MCP Tools)
AI agents interact with Context Crystallizer through MCP (Model Context Protocol) for conversation-driven crystallization and knowledge search.
| Tool | Purpose | AI Agent Conversation Example |
|---|---|---|
| get_crystallization_guidance | Get comprehensive analysis guidance | Developer: "How should I analyze these files?" Claude: "Let me get the crystallization guidance..." Claude calls get_crystallization_guidance Claude: "Here's the complete analysis methodology with templates, quality standards, and AI-specific guidance for creating crystallized contexts." |
| init_crystallization | Initialize repository crystallization | Developer: "Set up this React project for crystallization" Claude: "I'll initialize crystallization for your React project" Claude calls init_crystallization Claude: "โ Queued 247 files for crystallization (automatically respecting .gitignore). Ready to start analyzing!" |
| get_next_file_to_crystallize | Get next file for AI analysis | Claude: "Let me get the next file to analyze..." Claude calls get_next_file_to_crystallize Claude: "Analyzing src/components/Auth.tsx - this appears to be authentication UI logic..." |
| store_crystallized_context | Save AI-generated knowledge | Claude: "I've analyzed the authentication component. Storing crystallized context..." Claude calls store_crystallized_context Claude: "โ Crystallized context stored. Progress: 45/247 files" |
| get_crystallization_progress | Monitor crystallization status | Developer: "How's the crystallization going?" Claude: "Let me check progress..." Claude calls get_crystallization_progress Claude: "Progress: 45/247 files (18% complete), ~2 hours remaining" |
| search_crystallized_contexts | Find relevant knowledge by functionality | Developer: "How does authentication work in this app?" Claude: "Let me search the crystallized contexts..." Claude calls search_crystallized_contexts with query="authentication" Claude: "Found 5 auth-related files: JWT middleware, login component, auth context..." |
| get_crystallized_bundle | Combine multiple contexts | Developer: "Show me how the payment system works" Claude: "I'll bundle all payment-related contexts..." Claude calls get_crystallized_bundle Claude: "The payment flow involves 4 components: PaymentForm, Stripe integration, order processing..." |
| find_related_crystallized_contexts | Discover code relationships | Developer: "What depends on this Auth.tsx file?" Claude: "Let me find related contexts..." Claude calls find_related_crystallized_contexts Claude: "Found 3 related files: LoginPage uses Auth.tsx, ProtectedRoute depends on it..." |
| search_by_complexity | Find contexts by difficulty level | Developer: "Show me simple files to understand first" Claude: "Finding low-complexity files..." Claude calls search_by_complexity with complexity="low" Claude: "Here are 8 simple config files and utility functions to start with..." |
| validate_crystallization_quality | Assess context quality | Developer: "Is the crystallization quality good?" Claude: "Let me validate the crystallization quality..." Claude calls validate_crystallization_quality Claude: "Quality report: 89% completeness, 92% AI readability. Suggestions: Add more error handling patterns for 3 files" |
| update_crystallized_contexts | Refresh contexts for changes | Developer: "Update crystallization after my changes" Claude: "Detecting changed files and updating contexts..." Claude calls update_crystallized_contexts Claude: "Updated 3 changed files, removed 1 deleted file. Crystallization is current!" |
CLI Usage (Developer Commands)
Developers can use direct CLI commands for precise control over crystallization operations.
| Command | Purpose | Example | Parameters |
|---|---|---|---|
| guidance | Get comprehensive analysis guidance | context-crystallizer guidance |
--repo-path <path> (optional) |
| init | Initialize repository crystallization | context-crystallizer init ./my-repo |
<repo-path> (required)--exclude <patterns...> (optional, adds to .gitignore & defaults) |
| progress | Check crystallization progress | context-crystallizer progress |
--json (optional) |
| search | Search crystallized contexts | context-crystallizer search "authentication" |
<query> (required)--max-tokens <number>--category <type>--json |
| bundle | Bundle multiple contexts | context-crystallizer bundle src/auth src/api |
<files...> (required)--max-tokens <number>--json |
| related | Find related contexts | context-crystallizer related src/auth.ts |
<file-path> (required)--max-results <number>--json |
| validate | Validate crystallization quality | context-crystallizer validate [file] |
[file-path] (optional)--report--json |
| update | Update changed contexts | context-crystallizer update |
--force--include-unchanged--cleanup-deleted--check-only--report--json |
| mcp | Start MCP server | context-crystallizer mcp |
None |
Usage Patterns
๐ Initial Setup & Crystallization
Developer โ Start: context-crystallizer
Developer โ Configure: Claude Desktop with MCP
Developer โ Request: "Crystallize this repository"
Claude โ Calls: init_crystallization, get_next_file_to_crystallize, store_crystallized_context
Claude โ Reports: Progress and completion
๐ Daily Development Workflow
Developer โ Ask: "How does feature X work?"
Claude โ Calls: search_crystallized_contexts
Claude โ Explains: Using found crystallized knowledge
Developer โ Ask: "What will this change affect?"
Claude โ Calls: find_related_crystallized_contexts
Claude โ Warns: About potential impacts
๐ง Maintenance & Updates
Developer โ Notification: "I changed some files"
Claude โ Calls: update_crystallized_contexts
Claude โ Reports: "Updated 3 contexts, all current"
Developer โ Question: "Is crystallization still good quality?"
Claude โ Calls: validate_crystallization_quality
Claude โ Reports: Quality metrics and suggestions
CLI & Developer Usage
Starting the MCP Server
# Install globally
npm install -g context-crystallizer
# Navigate to your project directory
cd /path/to/your/project
# Start the MCP server (required for AI agent integration)
context-crystallizer
The server will start and display:
Context Crystallizer MCP server running... Ready to transform repositories into crystallized knowledge!
Integration Options
1. Claude Desktop Integration
Add to ~/claude_desktop_config.json:
{
"mcpServers": {
"context-crystallizer": {
"command": "npx",
"args": ["context-crystallizer"],
"cwd": "/path/to/your/project"
}
}
}
2. MCP-Compatible Clients
Any MCP-compatible client can connect to the server and use the 11 crystallization tools. The server implements the standard MCP protocol for tool discovery and execution.
3. Direct Development
For development and testing:
# Development with hot reload
npm run dev
# Production build
npm run build
npm start
# TypeScript development
npm run dev:mcp
Developer Notes
- Server Lifecycle: The MCP server must be running for AI agent integration
- Project Context: Always start the server from your project root directory
- Persistent Storage: Crystallized contexts are saved in
.context-crystallizer/directory - File Watching: Use
update_crystallized_contextstool after making code changes - Quality Monitoring: Regular quality validation ensures accurate crystallized knowledge
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.