ast-grep-find

Search codebases by AST patterns to locate functions, imports, and class definitions.

1|Updated Jan 2, 2026
One-click install
npx skills add https://github.com/tfunk1030/vibe --skill ast-grep-find-tfunk1030
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ast-grep-find
Source: https://github.com/tfunk1030/vibe/tree/main/.claude/skills/ast-grep-find
Command: npx skills add https://github.com/tfunk1030/vibe --skill ast-grep-find-tfunk1030

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Structural code search that understands syntax, enabling precise matches beyond simple text search and enabling safe refactors.

Core Features & Use Cases

  • AST-pattern search: Find function calls, imports, class definitions by structure, not by text.
  • Refactor with precision: Apply changes across a codebase using AST-aware rules to avoid false positives.
  • Use Case: Quickly locate all usages of a function to prepare a mass rename or dependency update.

Quick Start

Run the AST search against your project to locate syntax patterns and apply refactors with the provided tooling.

Frequently Asked Questions about ast-grep-find

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search for code patterns using AST instead of plain text?

AST-based code search parses source files into an abstract syntax tree to match structural nodes like function calls and imports, preventing the false positives common in plain text search.

How can I safely refactor function calls across multiple languages?

You can safely refactor function calls by applying AST-aware pattern matching rules across a codebase, ensuring changes target structural definitions rather than arbitrary string matches.

What is syntax-aware code search and when do I need it?

Syntax-aware code search matches code structure rather than text, needed when preparing mass renames, locating class definitions, or updating dependencies without triggering false positives.

Does AST pattern matching work for finding all usages of a function before a rename?

Yes, AST pattern matching locates all structural usages of a function across relevant directories to prepare safe, non-destructive refactors and dependency updates efficiently.

What is the best way to locate imports and class definitions structurally?

The best way to locate imports and class definitions structurally is using AST-based searches, which understand syntax to find exact structural nodes instead of relying on text matching.

Why does text search return false positives during codebase refactoring?

Text search returns false positives because it ignores syntax structure, whereas AST-based refactoring parses the source tree and applies pattern-based commands to safely match only relevant structural nodes.