DISCOVER THE FUTURE OF AI AGENTSarrow_forward

ast-index

calendar_todayAdded Feb 26, 2026
categoryAgent & Tooling
codeOpen Source
RustModel Context ProtocolCLIAgent & ToolingDeveloper Tools & Coding

Fast AST-indexed code search CLI for 15 programming languages with native Rust implementation, designed for Claude Code / Cursor integration.

ast-index is a fast AST-indexed code search CLI for 15 programming languages, built with native Rust. It leverages tree-sitter for multi-language AST parsing and SQLite FTS5 for full-text indexing, enabling millisecond-level symbol search in large codebases.

Core Tech Stack

  • grep-searcher (ripgrep core) for fast text search
  • SQLite + FTS5 for full-text search index storage
  • rayon for parallel file parsing
  • tree-sitter for AST parsing across 12 languages

Key Features

Indexed Search Commands (requires ast-index rebuild first)

  • search - General symbol search
  • class - Class/interface/protocol search
  • symbol - Any symbol search
  • implementations - Find implementations of interfaces/abstract classes
  • hierarchy - Class inheritance tree
  • usages - Symbol usage (reference points)

Grep-style Search Commands (no index required)

  • todo - TODO/FIXME/HACK comments
  • callers - Function call sites
  • composables - @Composable functions
  • deprecated - @Deprecated items
  • inject - @Inject/@Autowired injection points
  • annotations - Annotated classes
  • extensions - Extension functions
  • flows - Flow/StateFlow/SharedFlow

Module Dependency Analysis

  • module / deps / dependents - Module and dependency relationships
  • unused-deps - Unused dependencies (including transitive deps, XML, resource checks)
  • api - Module public API

XML & Resource Analysis

  • xml-usages - Class usage in XML layouts
  • resource-usages - Resource usage and unused resource detection

iOS-specific Commands

  • storyboard-usages / asset-usages / swiftui / async-funcs / publishers / main-actor

Performance Benchmarks (~29k files, ~300k symbols large Android project)

Commandast-indexgrepSpeedup
imports0.3ms90ms260x
dependents2ms100ms100x
deps3ms90ms90x
class1ms90ms90x
search11ms280ms14x
usages8ms90ms12x

Performance Optimizations

  • Batch indexing: 500 files chunked parsing and writing
  • Thread pool limit: Max 8 threads for memory control
  • Skip large files (> 1 MB) and long lines (> 2000 chars)
  • SQLite cache: 8 MB
  • Hardcoded directory exclusion: node_modules, pycache, build, dist, target, vendor, .gradle, Pods, DerivedData, etc.

Installation

# Homebrew (macOS/Linux)
brew tap defendend/ast-index
brew install ast-index

# Build from source
git clone https://github.com/defendend/Claude-ast-index-search.git
cd Claude-ast-index-search
cargo build --release

Claude Code Integration

claude plugin marketplace add defendend/Claude-ast-index-search
claude plugin install ast-index

Supported Languages Kotlin, Java, Swift, Objective-C, TypeScript, JavaScript, Rust, C#, Python, Go, C++, Scala, Ruby, Perl, Dart/Flutter, plus Protocol Buffers, WSDL/XSD

Project Info

  • License: MIT License
  • Latest Version: v3.20.0 (48 releases)
  • Binary Size: ~4.4 MB

Related Projects

View All arrow_forward

STAY UPDATED

Get the latest AI tools and trends delivered straight to your inbox. No spam, just intelligence.

rocket_launch