An innovative AI-powered codebase analysis system that enables AI assistants to deeply understand and work with any codebase. Built by RLabs Inc. and Claude.
- ποΈ Clean Architecture: Major refactoring to layered service architecture
- Separation of core business logic from presentation layers
- Unified MCP server with both curator and direct analysis tools
- Service-oriented design for better testability and maintenance
- π Python Support: Full language analysis for Python projects
- Import parsing (standard, from, relative, wildcard imports)
- Framework detection (Django, Flask, FastAPI, pytest, pandas, etc.)
- Pattern extraction (classes, functions, decorators)
- π Modular Language System: Extensible plugin architecture for adding new languages
- Automatic language detection based on file extensions
- Common base class for consistent implementation
- Language-specific customizations preserved
- π Specialized Tools: Three new MCP tools designed for common development tasks
get_codebase_overview
- No more guessing what a codebase doesadd_new_feature
- Stop creating tomorrow's tech debtimplement_change
- Focused fixes without breaking everything
- β‘ Performance: Intelligent caching with hierarchical hash trees (3-5x faster)
- π€ Claude-to-Claude: Prompts rewritten for natural AI-to-AI communication
- π‘οΈ Stability: Fixed MaxListenersExceeded warnings and MCP environment compatibility
Codebase Curator solves a fundamental problem in AI-assisted development: How can AI write code that truly fits into an existing codebase?
By analyzing your codebase's patterns, conventions, and architecture, then providing this knowledge through an MCP (Model Context Protocol) server, Codebase Curator enables AI assistants to:
- π― Write code that follows your project's established patterns
- ποΈ Suggest implementation approaches that fit your architecture
- π Understand complex relationships between different parts of your code
- π‘ Provide context-aware assistance based on your specific codebase
- Import Mapper - Analyzes dependency graphs and import relationships
- Framework Detector - Identifies frameworks, libraries, and tech stack
- File Organization Analyzer - Understands your project structure patterns
- Pattern Aggregator - Discovers coding patterns and conventions using AST analysis
- Code Similarity Analyzer - Finds similar code blocks and potential duplications
- Get Codebase Overview - Instant practical overview of any codebase
- Add New Feature - Comprehensive guidance for implementing new features
- Implement Change - Focused action plans for changes and fixes
- Ask Curator - Natural language questions about your codebase
- Run Analysis - Execute specific analysis algorithms
- Get Cache Stats - Monitor caching performance
- Memory System - Persists insights for future reference
- Bun runtime
- Claude CLI (for MCP server functionality)
- Node.js (automatically detected)
# Clone the repository
git clone https://github.com/RLabsInc/codebase-curator.git
cd codebase-curator
# Install dependencies
bun install
# Run CLI analysis
bun run src/presentation/cli/app.ts <command> <path>
# Start MCP server
bun run src/presentation/mcp/server.ts
# Analyze imports and dependencies
bun run src/presentation/cli/app.ts imports /path/to/project
# Detect frameworks and libraries
bun run src/presentation/cli/app.ts frameworks /path/to/project
# Analyze file organization
bun run src/presentation/cli/app.ts organization /path/to/project
# Discover code patterns
bun run src/presentation/cli/app.ts patterns /path/to/project
# Find similar code
bun run src/presentation/cli/app.ts similarity /path/to/project
# Run all analyses
bun run src/presentation/cli/app.ts all /path/to/project
-o, --output <format>
- Output format:json
,summary
, ordetailed
(default: summary)-q, --quiet
- Suppress informational output (useful for piping)-e, --exclude <patterns>
- Exclude directories/files matching patterns--curator
- Save results to.curator/
directory (for MCP integration)
- Add to your Claude Desktop config (
claude_desktop_config.json
):
{
"mcpServers": {
"codebase-curator": {
"command": "bun",
"args": ["run", "/path/to/codebase-curator/src/presentation/mcp/server.ts"],
"cwd": "/path/to/codebase-curator"
}
}
}
-
Restart Claude Desktop
-
Use the curator tools:
New Specialized Tools (v2.2+):
get_codebase_overview
- Get instant practical overview (no params needed!)add_new_feature
- Get comprehensive feature implementation guidanceimplement_change
- Get focused action plans for changes/fixes
Core Tools:
ask_curator
- Ask any question about the codebaserun_analysis
- Run specific analysis algorithmsget_curator_memory
- Retrieve accumulated insightsclear_curator_session
- Start freshget_cache_stats
- Check caching performance
Create a .curatorconfig.json
in your project root:
{
"exclude": [
"docs",
"examples",
"vendor"
],
"include": [
"test"
],
"analysis": {
"imports": {
"includeDevDependencies": true
},
"patterns": {
"minPatternFrequency": 2
}
}
}
- β TypeScript/JavaScript - Full support with AST analysis
- β JSX/TSX - React and other JSX-based frameworks
- β Python - Full support with comprehensive import parsing (v2.3+)
- β JSON - Configuration and data files
- AST-based import parsing with Bun transpiler
- ES6, CommonJS, and dynamic imports
- Framework detection: React, Vue, Angular, Next.js, Express, etc.
- Full JSX/TSX support
- Import statement parsing (import, from...import, relative imports)
- Framework detection: Django, Flask, FastAPI, pytest, pandas, NumPy, etc.
- Pattern extraction: classes, functions, async functions, decorators
- Handles Python-specific syntax and conventions
-
Phase 1: Core Languages (In Progress)
- β Python (Completed in v2.3)
- Go (Next)
- Rust
- Java/Kotlin
- C/C++
-
Phase 2: Extended Language Coverage
- Ruby
- PHP
- Swift
- C#/.NET
- And more based on community needs
-
Phase 3: Universal Data/Event Flow Analysis
- Language-agnostic pattern recognition
- Cross-language project understanding
- The ultimate vision from our project_summary.md
codebase-curator/
βββ src/
β βββ core/ # Business logic services
β β βββ AnalysisService.ts # Analysis orchestration
β β βββ CuratorService.ts # Main curator logic
β β βββ SessionService.ts # Session management
β β βββ CuratorProcessService.ts # Claude spawning
β βββ presentation/ # UI/Interface layers
β β βββ cli/ # Command-line interface
β β βββ mcp/ # MCP server interface
β βββ algorithms/ # Core analysis algorithms
β βββ languages/ # Language plugin system
β βββ services/ # Supporting services
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
βββ tests/ # Test files
βββ docs/ # Documentation
- Analysis Phase: The curator runs sophisticated algorithms to understand your codebase
- Knowledge Building: Insights are stored and accumulated over time
- AI Communication: Through MCP, AI assistants can query the curator
- Contextual Responses: The curator provides specific, actionable guidance
- Feature Integration: "How should I add authentication to this project?"
- Pattern Discovery: "What naming conventions does this project use?"
- Architecture Understanding: "Where should I add this new module?"
- Code Consistency: "What error handling pattern should I follow?"
// No parameters needed - just get the overview!
const overview = await curator.getCodebaseOverview();
// Returns practical info like:
// - What the codebase actually does
// - Where things live
// - Key patterns and conventions
// - Tech debt and gotchas
// Get comprehensive guidance for new features
const guidance = await curator.addNewFeature(
"Add user notification system with email and in-app alerts"
);
// Returns:
// - Exact file structure to create
// - Integration points with existing code
// - Code examples from THIS codebase
// - Pattern-matching implementation plan
// Get focused action plan for changes
const plan = await curator.implementChange(
"Fix memory leak in WebSocket connection handler"
);
// Returns:
// - What's actually broken (specific lines)
// - Files to modify (just what changes)
// - Before/after code snippets
// - Impact analysis
// - Test updates needed
Built with β€οΈ by RLabs Inc. and Claude
Special thanks to:
- The Anthropic team for Claude and MCP
- The Bun team for the amazing runtime
- The open-source community
MIT License - see LICENSE file for details
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Ready to give your AI assistants deep codebase understanding? π
Star β this repo if you find it useful!