AST Grep Code Search & Refactoring

0•

Performs syntax-aware AST code searches, structural refactoring, and automated codemods without text-matching false positives.

AST Grep enables Claude to search, match, and modify codebases using abstract syntax tree (AST) patterns rather than plain text matching. It helps developers locate specific syntactic constructs such as JSX props, function calls, decorators, imports, and object patterns across multiple languages. By understanding code structure, it eliminates false positives from strings or comments and provides a disciplined, safe workflow for executing large-scale structural codemods and API migrations.

Key Features

01Precision searching that ignores comments, string literals, and unrelated identifiers
02Automated codemod and mechanical refactoring capabilities with dry-run support
03Safe pattern discipline to avoid broad wildcard overmatches and syntax breaks
04Syntax-shaped pattern matching across TypeScript, JavaScript, and other supported languages
05Structured workflow integration with diff inspection and post-edit verification
060 GitHub stars

Use Cases

01Finding specific function call shapes, decorators, and JSX props without regex false positives
02Safely transforming deprecated code patterns across multiple files with automated verification
03Executing large-scale API migrations and repetitive syntax refactors across large repositories