What problem does it solve? Literal text search fails when you need to find or refactor code by its syntactic shape rather than exact strings, making large-scale codemods and pattern-based refactoring error-prone. ## Core Features & Use Cases - Structural Search: Match code patterns with meta-variables ($X, $$$) across languages like Python, TypeScript, Bash, Rust, and Go, regardless of formatting. - Multi-file Rewrites: Apply template-based rewrites with --rewrite, with dry-run by default and interactive confirmation for safe refactoring. - Relational YAML Rules: Express contextual constraints like inside, has, follows, and precedes in rule files for lint-style checks. - Use Case: Rename a keyword argument in every connect(host=..., port=...) call across a Python codebase, or find all bare except: clauses inside function definitions. ## Quick Start Ask the assistant to use ast-grep to find all calls to a specific function pattern in your source directory and rewrite them with a new signature.