AI-native code indexing tool for large codebases.
codeindex automatically generates intelligent documentation (README_AI.md) for your directories using tree-sitter parsing and external AI CLIs. Perfect for understanding large codebases, onboarding new developers, and maintaining living documentation.
- π AI-Powered Documentation: Generate comprehensive README files using Claude, GPT, or any AI CLI
- π³ Tree-sitter Parsing: Accurate symbol extraction (classes, functions, methods, imports) for Python (more languages coming)
- β‘ Parallel Scanning: Scan multiple directories concurrently for fast indexing
- π― Smart Filtering: Include/exclude patterns with glob support
- π§ Flexible Integration: Works with any AI CLI tool via configurable commands
- π Coverage Tracking: Check which directories have been indexed
- π¨ Fallback Mode: Generate basic documentation without AI
pipx install codeindexpip install codeindexgit clone https://github.com/yourusername/codeindex.git
cd codeindex
pip install -e .cd /your/project
codeindex initThis creates .codeindex.yaml in your project.
Edit .codeindex.yaml:
ai_command: 'claude -p "{prompt}" --allowedTools "Read"'
include:
- src/
exclude:
- "**/test/**"
- "**/__pycache__/**"
languages:
- python
output_file: "README_AI.md"Other AI CLI examples:
# OpenAI
ai_command: 'openai chat "{prompt}" --model gpt-4'
# Gemini
ai_command: 'gemini "{prompt}"'
# Custom script
ai_command: '/path/to/my-ai-wrapper.sh "{prompt}"'# Scan single directory
codeindex scan ./src/auth
# Preview prompt without executing
codeindex scan ./src/auth --dry-run
# Generate without AI (fallback mode)
codeindex scan ./src/auth --fallback# List all indexable directories
codeindex list-dirs
# Scan all directories in parallel (4 workers)
codeindex list-dirs | xargs -P 4 -I {} codeindex scan {}
# Or with GNU parallel
codeindex list-dirs | parallel -j 4 codeindex scan {}codeindex statusOutput:
Indexing Status
βββββββββββββββββββββββββββββββββββββββ
β
src/auth/
β
src/utils/
β οΈ src/api/ (no README_AI.md)
β
src/db/
Indexed: 3/4 (75%)
- Getting Started - Detailed installation and setup
- Configuration Guide - All config options explained
- Advanced Usage - Parallel scanning, custom prompts
- Contributing - Development setup and guidelines
- Roadmap - Future plans and milestones
- Architecture - Design decisions and ADRs
- Changelog - Version history
codeindex includes skills for Claude Code to enhance your AI-assisted development workflow.
# Navigate to codeindex directory
cd /path/to/codeindex
# Run install script
./skills/install.sh| Command | Description |
|---|---|
/mo:arch |
Query code architecture using README_AI.md indexes |
/mo:index |
Generate repository index with codeindex |
After indexing your project:
You: /mo:arch Where is the parser implemented?
Claude: Based on README_AI.md, the parser is in src/codeindex/parser.py.
It uses tree-sitter for AST parsing and extracts Symbol and Import...
Add to your project's CLAUDE.md:
Each source directory has README_AI.md - read it before modifying code to understand module structure.See skills/README.md for detailed documentation.
Generate comprehensive documentation for legacy codebases to help new developers onboard faster.
Create structured overviews of large projects (10,000+ files) for efficient exploration.
Use generated indexes with tools like Claude Code or Cursor for better code context.
Keep documentation up-to-date by regenerating README_AI.md files as code changes.
Directory β Scanner β Parser (tree-sitter) β Prompt Generator β AI CLI β README_AI.md
- Scanner: Walks directories, filters by config patterns
- Parser: Extracts symbols (classes, functions, imports) using tree-sitter
- Writer: Formats parsed data into a prompt
- Invoker: Executes external AI CLI with the prompt
- Output: AI generates
README_AI.mdwith intelligent documentation
| Language | Status | Parser |
|---|---|---|
| Python | β Supported | tree-sitter |
| TypeScript/JS | π§ Coming Soon | tree-sitter |
| Java | π§ Planned | tree-sitter |
| Go | π§ Planned | tree-sitter |
| Rust | π§ Planned | tree-sitter |
We welcome contributions! See CONTRIBUTING.md for:
- Development setup
- TDD workflow
- Code style guidelines
- How to add new languages
- Release process
# Clone and install
git clone https://github.com/yourusername/codeindex.git
cd codeindex
pip install -e ".[dev]"
# Run tests
pytest
# Lint and format
ruff check src/
ruff format src/See 2025 Q1 Roadmap for detailed plans.
Upcoming:
- Multi-language support (TypeScript, Java, Go)
- MCP service integration for Claude Code
- Incremental indexing (only scan changed files)
- Performance optimizations
- Plugin system for custom AI providers
MIT License - see LICENSE file for details.
- tree-sitter - Fast, incremental parsing
- Claude CLI - AI integration inspiration
- All contributors and users
- Questions: GitHub Discussions
- Bugs: GitHub Issues
- Feature Requests: GitHub Issues
If you find codeindex useful, please star the repository to show your support!
Made with β€οΈ by the codeindex team