defendend/Claude-ast-index-search
Cli allows AST search, ~40-50% economy tokens. Claude/Codex/Cursor searches (suitable for any AI agent that can use Bash)
What it solves
ast-index is a structural code navigation CLI designed for large, multi-language repositories. It replaces imprecise "grep-style" text searches with an AST-aware (Abstract Syntax Tree) index, allowing developers and AI agents to navigate code by exact structure—such as classes, functions, and inheritance—rather than simple text matches.
How it works
The tool builds a local SQLite index of symbols, references, imports, modules, and dependencies. It supports a vast array of languages (including Kotlin, Java, Rust, Python, Go, and C++). Users can build the index once with rebuild and keep it current with update.
For AI agents, it provides compact, parseable structural slices of code instead of raw file dumps, which can reduce token usage by 40-50% in large repositories. It also integrates with AI tools like Claude Code, Cursor, and Gemini CLI via plugins or skills.
Who it’s for
- Developers working in large monorepos or polyglot projects who need fast, precise navigation of symbols and dependencies.
- AI Agent creators who want to provide their coding agents with high-precision, low-token context about a codebase.
Highlights
- AST-Aware Navigation: Jump directly to definitions, usages, callers, and implementations across dozens of languages.
- Agent Optimization: Returns structural slices of code to save tokens and provide better context to LLMs.
- Git-Integrated Insights: Includes a
hotspotscommand to rank files by churn, bugfixes, and author count to identify unstable code. - Symbol Graph: Builds a symbol-to-symbol dependency graph to analyze impact, find cycles, and determine the most central symbols.
- High Performance: Significantly faster than grep for finding imports, dependents, and classes in large projects.
- Monorepo Support: Includes specific workflows for nested project markers and cross-root workspaces.
Related
- Project
- Dispatch
- Project
- Project
- Project