What problem does it solve?
This skill finds and rewrites code based on syntax tree structure, so you can target calls, imports, functions, and other code shapes without relying on fragile text matching.
Core Features & Use Cases
- Structural search across 25 languages for calls, declarations, control flow, and other AST patterns.
- Safe rewrite workflows with offline pattern validation, dry-run previews, and two-pass application when changes are confirmed.
- Cross-platform binary installation and resolution for macOS, Linux, Windows, WSL, and Git Bash.
- Useful for codemods, API migrations, log cleanup, lint-style scans, and repository-wide refactors.
Quick Start
Ask the assistant to search or rewrite the target code with ast-grep by giving the pattern, language, and file paths.