Magellan
Version: 3.0.0
A deterministic codebase mapping tool. Watches source files, extracts AST-level facts, and builds a searchable graph database of symbols and references.
Purpose
Magellan is the foundation of the Code Intelligence ecosystem. Built to power:
- LLMGrep — Semantic code search using natural language queries
- Mirage — AI-powered code navigation assistant
- Splice — Intelligent code refactoring engine
While usable standalone, Magellan is designed as infrastructure for downstream tools to answer questions like "find all callers of this function" with millisecond latency on multi-million line codebases.
Features
- Watch directories for file changes (Create/Modify/Delete) with async I/O
- Extract AST-level facts: functions, classes, methods, enums, modules (7 languages)
- Track symbol references and build call graphs (caller → callee)
- Store AST nodes for hierarchical code structure analysis
- Compute metrics: fan-in, fan-out, LOC, complexity per file/symbol
- Run graph algorithms: reachability, dead code detection, cycles, paths, slicing
- Export to JSON, JSONL, CSV, SCIP, DOT, LSIF formats
- LLM Context Queries - Summarized, paginated context for efficient AI integration
- LSP Enrichment - Type signatures from rust-analyzer, jdtls, clangd
- Self-Diagnostics -
magellan doctorcommand for troubleshooting
Quick Start
# Install
# Start watching a project (with progress bar!)
# Query symbols in a file
# Find a symbol (with better error messages)
# Show call references
# LLM Context Queries (NEW in v3.0.0)
# Self-diagnostics (NEW in v3.0.0)
# LSP Enrichment (NEW in v3.0.0)
# Cross-repo navigation (NEW in v3.0.0)
Proof of Seriousness
Real commands, real output. No marketing.
1. Self-Diagnostics (magellan doctor --fix)
)
)
)
)
)
)
==================================================
)
2. Progress Transparency (magellan watch --scan-initial)
)
)
)
3. Type Signatures (magellan enrich)
)
) )
4. LLM Workflow (Magellan + LLMGrep + Splice)
# Step 1: Build context for LLM
)
# Step 2: Find all callers of a function
# Step 3: Safe refactoring with Splice
)
Installation
Or build from source with specific backend:
# V3 backend (recommended for production - fastest, no SQLite dependency)
# SQLite backend (default - best compatibility)
Backends
| Feature | Description | File | Use Case |
|---|---|---|---|
native-v3 |
High-performance binary backend with KV store | .v3 |
Recommended for performance |
sqlite-backend |
Stable SQLite backend | .db |
Compatibility, debugging |
Both backends have full feature parity (v2.4.0):
- Graph operations, symbol indexing, call traversal
- AST nodes, code chunks, execution logging
- File/symbol metrics, graph algorithms
Supported Languages
| Language | Extensions |
|---|---|
| Rust | .rs |
| C / C++ | .c, .h, .cpp, .cc, .cxx, .hpp |
| Java | .java |
| JavaScript / TypeScript | .js, .mjs, .ts, .tsx |
| Python | .py |
Documentation
- MANUAL.md — Complete command reference, architecture, and examples
- CHANGELOG.md — Version history and release notes
- docs/CONTEXT_API_CONTRACT.md — Deterministic JSON contract for LLM context API
- AGENTS.md — Development guidelines for contributors
What Magellan Does NOT Do
- No semantic analysis or type checking
- No LSP server or language features
- No config files
- No web APIs or network services
License
GPL-3.0-or-later