Skip to content
Development
Skill

/ast-index

This skill should be used when the user asks to "find a class", "search for symbol", "find usages", "find implementations", "search codebase", "find file", "class hierarchy", "find callers", "module dependencies", "unused dependencies", "project map", "project conventions",

From plugin
ast-index
6011 skill3 agents7 commands

Claude Code

$ npx -y skills add defendend/Claude-ast-index-search --skill ast-index --agent claude-code

SKILL.md

ast-index.SKILL.md
name: ast-index
description: This skill should be used when the user asks to "find a class", "search for symbol", "find usages", "find implementations", "search codebase", "find file", "class hierarchy", "find callers", "module dependencies", "unused dependencies", "project map", "project conventions", "project structure", "what frameworks", "what architecture", "find Perl subs", "Perl exports", "find Python class", "Go struct", "Go interface", "find React component", "find TypeScript interface", "find Rust struct", "find Ruby class", "find C# controller", "find Dart class", "find Flutter widget", "find mixin", "find Scala trait", "find case class", "find object", "find PHP class", "find Laravel model", "find PHP trait", or needs fast code search in Android/Kotlin/Java, iOS/Swift/ObjC, Dart/Flutter, TypeScript/JavaScript, Rust, Ruby, C#, Scala, PHP, Perl, Python, Go, C++, or Protocol Buffers projects. Also triggered by mentions of "ast-index" CLI tool.
user-invocable: false

ast-index - Code Search for Multi-Platform Projects

Fast native Rust CLI for structural code search in Android/Kotlin/Java, iOS/Swift/ObjC, Dart/Flutter, TypeScript/JavaScript, Rust, Ruby, C#, Scala, PHP, Perl, Python, Go, C++, and Proto projects using SQLite + FTS5 index.

Critical Rules

**ALWAYS use ast-index FIRST for any code search task.** These rules are mandatory:

1. **ast-index is the PRIMARY search tool** — use it before grep, ripgrep, or Search tool 2. **Pick the command by what you know:**

  • You have an intent or a description ("how is auth handled", "processing update admin") → `ast-index explore "<query>"`. It ranks by relevance and prints the source.
  • You have an exact identifier (`UserService`, `parseConfig`) → `ast-index search` / `symbol` / `class`. Add `--with-content` to `symbol` when you need its definition body, or to `search` when the exact qualified name or kind is uncertain.
  • `search` itself falls back to `explore` ranking when a multi-word query has no literal match, so a wrong pick is not fatal — but `explore` is the right first call for questions.

3. **DO NOT duplicate results** — if ast-index found usages/implementations, that IS the complete answer 4. **DO NOT run grep "for completeness"** after ast-index returns results 5. **DO NOT re-read bodies returned by `--with-content`** — a successful result replaces the usual `sed` / `awk` / `grep` / `rg` or file-read step. Use those tools only when the body is truncated or unavailable, or when you need text outside the returned definition. 6. **Use grep/Search ONLY when:**

  • ast-index returns empty results
  • Searching for regex patterns (ast-index uses literal match)
  • Searching for string literals inside code (`"some text"`) — `usages` and

`refs` skip names inside strings and comments

  • Searching in comments content

**Why:** ast-index is 17-69x faster than grep (1-10ms vs 200ms-3s) and returns structured, accurate results.

Prerequisites

Install the CLI before use:

brew tap defendend/ast-index
brew install ast-index

Initialize index in project root:

cd /path/to/project
ast-index rebuild

The index is stored at `~/Library/Caches/ast-index/<project-hash>/index.db` (macOS) or `~/.cache/ast-index/<project-hash>/index.db` (Linux). Rebuild builds a fresh index and swaps it in; named subtrees and the collected Git history (`hotspots --collect`) are carried over.

Supported Projects

| Platform | Languages | Module System | |----------|-----------|---------------| | Android/Java | Kotlin, Java | Gradle (build.gradle.kts), Maven (pom.xml) | | iOS | Swift, Objective-C | SPM (Package.swift) | | Web | TypeScript, JavaScript, React, Vue, Svelte | package.json | | Rust | Rust | Cargo.toml | | Ruby | Ruby, Rails, RSpec | Gemfile | | .NET | C#, ASP.NET, Unity | *.csproj | | Dart/Flutter | Dart | pubspec.yaml | | Scala | Scala | Bazel (WORKSPACE, BUILD) | | PHP | PHP | composer.json | | Perl | Perl | Makefile.PL, Build.PL | | Python | Python | None (*.py files) | | Go | Go | None (*.go files) | | Proto | Protocol Buffers (proto2/proto3) | None (*.proto files) | | WSDL | WSDL, XSD | None (*.wsdl, *.xsd files) | | C/C++ | C, C++ (JNI, uservices) | None (*.cpp, *.h, *.hpp files) | | Godot | GDScript | project.godot | | Mixed | All above | All |

Project type is auto-detected by marker files (build.gradle.kts, Package.swift, Makefile.PL, etc.). Python, Go, Proto, WSDL, and C++ files are indexed alongside main project type.

Minified JavaScript/CSS is never indexed or searched: `.js`/`.mjs`/`.cjs`/`.css` files named `*.min.*` or `*-min.*`, or whose first 64 KiB is minifier output (lines averaging 1000+ bytes of code, not one long string). Grep-based commands skip them too, and `outline`/`imports` on such a file print `Skipped: minified file` instead of parsing it. `AST_INDEX_SKIP_MINIFIED=0` turns the filter off.

Core Commands

Explore (one-shot context)

**`explore`** - Rank the symbols most relevant to a query, show the best files — an outline with line ranges for a type or module (the definitions inside it, the chosen one marked `→`), the source (read fresh from disk) for a function — list graph neighbours (callers/subclasses), and locate tests by path convention — in a single call. Prefer this over a search + read loop when you want to understand an area; read the slice an outline row points at next. Language-agnostic and vendor-aware (`node_modules` `.d.ts` and cross-stack matches are down-ranked, never deleted).

ast-index explore applicant merge MergeService   # bag of symbol/file names
ast-index explore "how does auth session work"   # natural-language question
ast-index explore PaymentService --rwr           # --rwr: re-rank via call/inheritance graph
ast-index explore Repository --max-files 8        # cap source files shown (default 6)
ast-index explore Session request --rwr --format json
  • Default (Stage A) ranks by lexical match + multi-term corroboration.
Read more
@defendend
Ships withast-index

Structural, AST-aware code navigation CLI for large, multi-language repositories.

6011 skill3 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
601
Star history of defendend/Claude-ast-index-search on GitHub, a chart by star-history.com

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills3w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc3w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react13d252k
@facebook@facebookInstall Skill

Questions about ast-index.

Which coding agents can use ast-index?
ast-index installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.